Add tags to form overview
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2025-07-16 15:14:46 +02:00
parent 32246e534e
commit 4e43609619
3 changed files with 21 additions and 0 deletions

View File

@ -190,6 +190,18 @@ class Form extends Model implements HasMedia
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
{
if (!$this->is_active) {

View File

@ -46,6 +46,7 @@ class FormResource extends JsonResource
'mail_bottom' => $this->mail_bottom,
'registration_from' => $this->registration_from?->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,
'participants_count' => $this->participants_count,
'is_active' => $this->is_active,

View File

@ -146,6 +146,7 @@
<th>Name</th>
<th>Von</th>
<th>Bis</th>
<th>Tags</th>
<th>Anzahl TN</th>
<th />
</tr>
@ -162,6 +163,13 @@
<td>
<div v-text="form.to_human" />
</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>
<div v-text="form.participants_count" />
</td>