<?php
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$item = $resource->item();
?>
<div class="resource-details" data-resource-values="<?php echo $escape($values); ?>">

    <?php if ($linkTitle): ?>
    <h3 class="o-title"><?php echo $resource->link($resource->displayTitle()); ?></h3>
    <?php else: ?>
    <h3 class="o-title"><?php echo $escape($resource->displayTitle()); ?></h3>
    <?php endif; ?>
    <div class="o-description"><?php echo $escape($resource->displayDescription()); ?></div>

    <?php echo $this->thumbnail($resource, 'square'); ?>

    <div class="meta-group">
        <h4><?php echo $translate('ID'); ?></h4>
        <div class="value"><?php echo $escape($resource->id()); ?></div>
    </div>

    <div class="meta-group">
        <h4><?php echo $translate('Part of Item'); ?></h4>
        <div class="value"><?php echo $item->link($item->displayTitle()); ?></div>
    </div>

    <?php if ($resource->lang()): ?>
    <div class="meta-group">
        <h4><?php echo $translate('Language'); ?></h4>
        <div class="value"><?php echo $escape($resource->lang()); ?></div>
    </div>
    <?php endif; ?>

    <?php if ($resource->mediaType()): ?>
    <div class="meta-group">
        <h4><?php echo $translate('MIME type'); ?></h4>
        <div class="value"><?php echo $escape($resource->mediaType()); ?></div>
    </div>
    <?php endif; ?>

    <?php if (is_numeric($resource->size())): ?>
    <div class="meta-group">
        <h4><?php echo $translate('Size'); ?></h4>
        <div class="value"><?php echo sprintf($translate('%s bytes'), number_format($resource->size())); ?></div>
    </div>
    <?php endif; ?>

    <div class="meta-group">
        <h4><?php echo $escape($translate('Visibility')); ?></h4>
        <div class="value"><?php echo ($resource->isPublic()) ? $translate('Public') : $translate('Private'); ?></div>
    </div>

    <?php $this->trigger('view.details', array('entity' => $resource)); ?>
</div>
