<?php
/** @var \Icinga\Module\Toplevelview\ViewConfig $view */
/** @var \Icinga\Module\Toplevelview\Tree\TLVTree $tree */

$tree = $view->getTree();
if (! $this->compact):
?>
<div class="controls separated">
    <?= $this->tabs ?>
    <?= $this->partial('show/actions.phtml', $this) ?>
</div>
<?php endif ?>
<div class="content tlv-content">
    <?php if ($view->hasBeenLoadedFromSession()): ?>
        <div class="warning-note">
            <?= $this->translate('This config is only stored in your session!'
                . ' Make sure to save it to disk once your work is complete!') ?>
        </div>
    <?php endif; ?>
    <div class="tlv-header">
        <h1><?= $view->getMeta('name') ?></h1>
        <div class="last-refresh"><?= $this->timeAgo($tree->getFetchTime()) ?></div>
        <?= $this->badges($tree->getStatus(), false, true) ?>
    </div>
    <div class="tlv-view-tiles">
        <?php foreach ($tree->getChildren() as $topTile): ?>
            <?= $this->tiles($topTile) ?>
        <?php endforeach; ?>
    </div>
</div>
