<?php
if (! $this->compact): ?>
    <div class="controls separated">
        <?= $this->tabs ?>
        <div class="action-links">
            <?php if ($this->hasPermission('toplevelview/edit')): ?>
            <?= $this->qlink(
                $this->translate('Add'),
                'toplevelview/edit/add',
                [],
                [
                    'class' => 'action-link',
                    'icon'  => 'plus',
                ]
            ) ?>
            <?php endif; ?>
        </div>
    </div>
<?php endif ?>
<div class="content separated">
    <div class="tlv-overview-tiles">
        <?php
        foreach ($views as $name => $view):
            $url = $this->url('toplevelview/show', ['name' => $name]);
            ?>
            <a href="<?= $url ?>" class="tlv-overview-tile">
                <div class="tlv-title"><?= $view->getMeta('name') ?></div>
                <div class="tlv-name"><?= $name ?></div>
                <?php if ($view->hasBeenLoadedFromSession()): ?>
                    <p class="warning-note"><?= $this->translate('Unsaved changes!') ?></p>
                <?php endif; ?>
            </a>
        <?php endforeach; ?>
    </div>
</div>
