aboutsummaryrefslogtreecommitdiff
path: root/templates/dates/course_date_list.php
blob: 997152d34d1aeab06b54d4828f271fa1d87ea446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * @var CourseDateList $collection
 * @var bool $with_room_names
 * @var bool $with_cancelled_dates
 *
 * @var SeminarCycleDate $regular_date
 * @var CourseDate $single_date
 * @var CourseExDate $cancelled_date
 */
?>
<? if (!$collection->isEmpty()) : ?>
    <ul class="list-unstyled">
        <? foreach ($collection->getRegularDates() as $regular_date) : ?>
            <li>
                <?= $regular_date->toString('long-start', true) ?>
            </li>
        <? endforeach ?>
        <? foreach ($collection->getSingleDates() as $single_date) : ?>
            <li>
                <?= htmlReady($single_date->getFullName('long')) ?>
                <? if ($with_room_names): ?>
                    <? $room = $single_date->getRoom() ?>
                    <? if ($room): ?>
                        <a href="<?= $room->getActionLink() ?>" data-dialog>
                            <?= htmlReady($room->name) ?>
                        </a>
                    <? else: ?>
                        <?= htmlReady($single_date->raum) ?>
                    <? endif ?>
                <? endif ?>
            </li>
        <? endforeach ?>
        <? if ($with_cancelled_dates) : ?>
            <? foreach ($collection->getCancelledDates() as $cancelled_date) : ?>
                <li>
                    <?= htmlReady($cancelled_date->getFullName()) ?>
                </li>
            <? endforeach ?>
        <? endif ?>
    </ul>
<? endif ?>