Add tags to form overview
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
32246e534e
commit
4e43609619
|
@ -190,6 +190,18 @@ class Form extends Model implements HasMedia
|
||||||
return Sorting::from($this->meta['sorting']);
|
return Sorting::from($this->meta['sorting']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isInDates(): bool {
|
||||||
|
if ($this->registration_from && $this->registration_from->gt(now())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->registration_until && $this->registration_until->lt(now())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function canRegister(): bool
|
public function canRegister(): bool
|
||||||
{
|
{
|
||||||
if (!$this->is_active) {
|
if (!$this->is_active) {
|
||||||
|
|
|
@ -46,6 +46,7 @@ class FormResource extends JsonResource
|
||||||
'mail_bottom' => $this->mail_bottom,
|
'mail_bottom' => $this->mail_bottom,
|
||||||
'registration_from' => $this->registration_from?->format('Y-m-d H:i:s'),
|
'registration_from' => $this->registration_from?->format('Y-m-d H:i:s'),
|
||||||
'registration_until' => $this->registration_until?->format('Y-m-d H:i:s'),
|
'registration_until' => $this->registration_until?->format('Y-m-d H:i:s'),
|
||||||
|
'is_in_dates' => $this->isInDates(),
|
||||||
'config' => $this->config,
|
'config' => $this->config,
|
||||||
'participants_count' => $this->participants_count,
|
'participants_count' => $this->participants_count,
|
||||||
'is_active' => $this->is_active,
|
'is_active' => $this->is_active,
|
||||||
|
|
|
@ -146,6 +146,7 @@
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Von</th>
|
<th>Von</th>
|
||||||
<th>Bis</th>
|
<th>Bis</th>
|
||||||
|
<th>Tags</th>
|
||||||
<th>Anzahl TN</th>
|
<th>Anzahl TN</th>
|
||||||
<th />
|
<th />
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -162,6 +163,13 @@
|
||||||
<td>
|
<td>
|
||||||
<div v-text="form.to_human" />
|
<div v-text="form.to_human" />
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="bool-row">
|
||||||
|
<ui-bool true-comment="aktiv" false-comment="inaktiv" :value="form.is_active">A</ui-bool>
|
||||||
|
<ui-bool true-comment="private Veranstaltung" false-comment="nicht private Veranstaltung" :value="form.is_private">P</ui-bool>
|
||||||
|
<ui-bool true-comment="Anmeldung möglich (lt. 'Registrierung von / bis')" false-comment="Anmeldeschluss erreicht" :value="form.is_in_dates">D</ui-bool>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div v-text="form.participants_count" />
|
<div v-text="form.participants_count" />
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue