summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/index/index.phtml
blob: 37975839d587f4a2d27175530761f21739af00db (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
<?php
/** @var array $views */

if (! $this->compact): ?>
    <div class="controls">
        <?= $this->tabs ?>
    </div>
<?php endif ?>
<div class="content">
    <div class="tlv-overview-tiles">
        <div class="action-links">
            <?= $this->qlink(
                $this->translate('Add'),
                'toplevelview/edit/add',
                array(),
                array(
                    'class' => 'action-link',
                    'icon'  => 'plus',
                )
            ) ?>
        </div>

        <?php
        foreach ($views as $name => $view):
            /** @var \Icinga\Module\Toplevelview\ViewConfig $view */
            $url = $this->url('toplevelview/show', array('name' => $name));
            ?>
            <div class="tlv-overview-tile">
                <div class="tlv-title"><?= $this->qlink($view->getMeta('name'), $url) ?></div>
                <div class="tlv-name"><?= $name ?></div>
                <?php if ($view->hasBeenLoadedFromSession()): ?>
                    <div class="unsaved"><?= $this->translate('Unsaved changes!') ?></div>
                <?php endif; ?>

                <?php if (! $this->compact && $this->hasPermission('toplevelview/edit')): ?>
                    <div class="action-links">
                        <?= $this->qlink(
                            $this->translate('Edit'),
                            'toplevelview/edit',
                            array('name' => $view->getName()),
                            array(
                                'class' => 'action-link',
                                'icon'  => 'edit',
                            )
                        ) ?>
                    </div>
                <?php endif; ?>
            </div>
        <?php endforeach; ?>
    </div>
</div>