<?php
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$this->htmlElement('body')->appendAttribute('class', 'browse vocabularies vocabulary-classes');
?>

<?php echo $this->pageTitle($translate($vocabulary->label()), 1, $translate('Vocabularies'), $translate('Classes')); ?>

<p><?php echo $escape($translate($vocabulary->comment())); ?></p>
<p><strong><?php echo $translate('Prefix:'); ?></strong> <?php echo $escape($vocabulary->prefix()); ?><br>
<strong><?php echo $translate('Namespace URI:'); ?></strong> <?php echo $escape($vocabulary->namespaceUri()); ?></p>

<?php if (count($resourceClasses)): ?>
<div class="browse-controls">
    <?php echo $this->pagination(); ?>
    <?php echo $this->browse()->renderSortSelector('resource_classes'); ?>
</div>

<table class="tablesaw tablesaw-stack" data-tablesaw-mode="stack">
    <thead>
        <tr>
            <th><?php echo $translate('Label'); ?></th>
            <th><?php echo $translate('Term'); ?></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($resourceClasses as $resourceClass): ?>
        <tr>
            <td>
                <span class="resource-class-label">
                    <?php echo $escape($translate($resourceClass->label())); ?>
                </span>
                <ul class="actions">
                    <?php $this->trigger('view.browse.actions', ['resource' => $resourceClass]); ?>
                    <li><?php echo $this->hyperlink('', '#', [
                        'data-sidebar-content-url' => $resourceClass->url('show-details'),
                        'class' => 'o-icon-more sidebar-content',
                        'title' => $translate('Details'),
                    ]); ?></li>
                </ul>
            </td>
            <td><?php echo $escape($translate($resourceClass->term())); ?></td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<?php echo $this->pagination(); ?>

<div class="sidebar">
    <?php echo $this->hyperlink('', '#', [
        'class' => 'sidebar-close o-icon-close',
        'title' => $translate('Close'),
    ]); ?>
    <div class="sidebar-content"></div>
</div>

<?php else: ?>

<div class="no-resources">
    <p><?php echo $translate('This vocabulary has no classes.'); ?></p>
</div>

<?php endif; ?>
