summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/announcements/index.phtml
blob: ff87c66bde990c12e2c4b46c2f7bb4b2395051d2 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php if (! $this->compact): ?>
<div class="controls">
    <?= $this->tabs ?>
    <?= $this->paginator ?>
    <div class="sort-controls-container">
        <?= $this->limiter ?>
        <?= $this->sortBox ?>
    </div>
    <?= $this->filterEditor ?>
</div>
<?php endif ?>
<div class="content">
<?php if ($this->hasPermission('application/announcements')) {
    echo $this->qlink(
        $this->translate('Create a New Announcement') ,
        'announcements/new',
        null,
        array(
            'class'             => 'button-link',
            'data-base-target'  => '_next',
            'icon'              => 'plus',
            'title'             => $this->translate('Create a new announcement')
        )
    );
} ?>
<?php if (empty($this->announcements)): ?>
    <p><?= $this->translate('No announcements found.') ?></p>
</div>
<?php return; endif ?>
    <table data-base-target="_next" class="table-row-selectable common-table">
    <thead>
        <tr>
            <th><?= $this->translate('Author') ?></th>
            <th><?= $this->translate('Message') ?></th>
            <th><?= $this->translate('Start') ?></th>
            <th><?= $this->translate('End') ?></th>
            <th></th>
        </tr>
    </thead>
    <tbody>
    <?php foreach ($this->announcements as $announcement): /** @var object $announcement */ ?>
        <tr>
            <td><?= $this->escape($announcement->author) ?></td>
        <?php if ($this->hasPermission('application/announcements')): ?>
            <td>
                <a href="<?= $this->href('announcements/update', array('id' => $announcement->id)) ?>">
                    <?= $this->ellipsis($this->escape($announcement->message), 100) ?>
                </a>
            </td>
        <?php else: ?>
            <td><?= $this->ellipsis($this->escape($announcement->message), 100) ?></td>
        <?php endif ?>
            <td><?= $this->formatDateTime($announcement->start) ?></td>
            <td><?= $this->formatDateTime($announcement->end) ?></td>
        <?php if ($this->hasPermission('application/announcements')): ?>
            <td class="icon-col"><?= $this->qlink(
                null,
                'announcements/remove',
                array('id' => $announcement->id),
                array(
                    'class' => 'action-link',
                    'icon'  => 'cancel',
                    'title' => $this->translate('Remove this announcement')
                )
            ) ?></td>
        <?php endif ?>
        </tr>
    <?php endforeach ?>
    </tbody>
    </table>
</div>