<?php
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$this->htmlElement('body')->appendAttribute('class', 'sites show');
?>

<?php echo $this->pageTitle($site->title(), 1, $translate('Sites')); ?>

<div id="page-actions">
    <?php $this->trigger('view.show.page_actions', ['resource' => $site]); ?>
    <?php if ($site->userIsAllowed('update')): ?>
        <?php echo $site->link($translate('Edit'), null, ['class' => 'button']); ?>
    <?php endif; ?>
    <?php echo $this->hyperlink($translate('View'), $site->siteUrl(), ['class' => 'button', 'target' => '_blank']); ?>
</div>
<div class="breadcrumbs">
    <?php echo $this->hyperlink($translate('Back to site list'), $this->url('admin/site'), ['class' => 'o-icon-left']); ?>
</div>

<dl>
    <div class="property">
        <dt><?php echo $escape($translate('URL slug')); ?></dt>
        <dd class="value"><?php echo $escape($site->slug()); ?></dd>
    </div>
    <div class="property">
        <dt><?php echo $escape($translate('Title')); ?></dt>
        <dd class="value"><?php echo $escape($site->title()); ?></dd>
    </div>
    <div class="property">
        <dt><?php echo $escape($translate('Theme')); ?></dt>
        <dd class="value"><?php echo $escape($site->theme()); ?></dd>
    </div>
    <?php
    $summary = $site->summary();
    if ($summary):
    ?>
    <div class="property">
        <dt><?php echo $escape($translate('Summary')); ?></dt>
        <dd class="value"><?php echo nl2br($escape($summary)); ?></dd>
    </div>
    <?php endif; ?>
    <?php
    $thumbnail = $site->thumbnail();
    if ($thumbnail): ?>
    <div class="property">
        <dt><?php echo $escape($translate('Thumbnail')); ?></dt>
        <dd class="value"><?php echo $this->thumbnail($thumbnail, 'square', ['class' => 'selected-asset-image']); ?></dd>
    </div>
    <?php endif; ?>
</dl>

<?php $this->trigger('view.show.after'); ?>
