Skip to content

Commit

Permalink
Merge pull request #183 from Pfonks/master
Browse files Browse the repository at this point in the history
Add flag for dinos (closes #171)
  • Loading branch information
luoe authored Oct 3, 2024
2 parents 8875b82 + b04e76d commit 4b48baa
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ SP1:
# Maximum number of participants that can attend the event.
max_participants: 120
# Boolean value indicating if the event is open for past members.
# Not required!
# IMPORTANT: If not set, it will be set to false.
dinos: false
# Event timing details.
event_date:
# Start date and time of the event, formatted as DD.MM.YYYY HH:MM.
Expand Down
1 change: 1 addition & 0 deletions check_yml_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def is_icon(s: str) -> bool:
Optional("info"): str,
"location": str,
"max_participants": int,
Optional("dinos"): bool,
"event_date": {
"start": And(str, is_date),
Optional("end"): And(str, is_date),
Expand Down
1 change: 1 addition & 0 deletions event.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<h2 class="description icon clock"><?= $event->getEventDateString() ?></h2>
<h2 class="description icon marker"><?= $event->location; ?></h2>
<h2 class="description"><?= $i18n['remaining'] . ": " . $event->getRemainingSpots() ?></h2>
<?php if($event->dinosAllowed) {?> <h4 class="description"> <?= $i18n['dinos'] ?></h4> <?php } ?>
<?= $event->text ?>
<br>
<?php
Expand Down
2 changes: 2 additions & 0 deletions event_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Event
public string $name;
public string $location;
private int $maxParticipants;
public bool $dinosAllowed;
public bool $cancelled;
public string $text;
public string $info;
Expand All @@ -55,6 +56,7 @@ public function __construct(array $data)

$this->location = $data['location'];
$this->maxParticipants = $data['max_participants'] ?? false;
$this->dinosAllowed = $data['dinos'] ?? false;
$this->cancelled = $data['cancelled'] ?? false;
// Text and info
$this->text = Event::i18n($data, 'text') ?? $i18n->translate(strtolower($this->link) . '_text') ?? '';
Expand Down
3 changes: 2 additions & 1 deletion i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@
"fb_name": "Flunkyball",
"fb_text": "Wir laden euch herzlich ein, eure linken Füße und eure Zielgenauigkeit beim Flunky Ball zu testen. Egal, ob ihr bereits Flunky Ball Profis seid oder es zum ersten Mal ausprobiert.<br> Wir sorgen für die Flunky Ball Ausrüstung und eine tolle Atmosphäre, ihr müsst nur euch selbst mitbringen. Damit wir alles bestens vorbereiten können, freuen wir uns, wenn ihr euch vorab anmeldet.",
"wf_name": "Weihnachtsfeier",
"wf_text": "Wir laden euch herzlich zur diesjährigen Weihnachtsfeier ein. Es gibt Waffeln, Glühwein und Bowle. Weihnachtsmützen optional!"
"wf_text": "Wir laden euch herzlich zur diesjährigen Weihnachtsfeier ein. Es gibt Waffeln, Glühwein und Bowle. Weihnachtsmützen optional!",
"dinos" : "Dinos willkommen!"
}
3 changes: 2 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@
"fb_name": "Flunkyball",
"fb_text": "We like to invite you to test your left feet and your accuracy in Flunky Ball. Whether you're already Flunky Ball pros or trying it for the first time, you're all welcome.<br>We provide the Flunky Ball equipment and a fantastic atmosphere - all you need to bring is yourselves. To ensure everything is well-prepared, we'd appreciate it if you could register in advance.",
"wf_name": "Christmas Party",
"wf_text": "We'd like to invite you to the annual christmas party. There will be waffles, spiced wine and good company."
"wf_text": "We'd like to invite you to the annual christmas party. There will be waffles, spiced wine and good company.",
"dinos" : "Dinos welcome!"
}

0 comments on commit 4b48baa

Please sign in to comment.