szurubooru/src/Views/post-small.phtml
Marcin Kurczewski 95961fe7d5 Added tag sorting here and there
- Title attribute in post thumbnail
- Page title in post view
- Footer in featured post
2013-12-14 16:55:07 +01:00

46 lines
2 KiB
PHTML

<?php $classNames = ['post', 'post-type-' . TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type))] ?>
<?php $masstag = (isset($this->context->source) and $this->context->source == 'mass-tag' and !empty($this->context->additionalInfo)) ?>
<?php if ($masstag): ?>
<?php $classNames []= 'taggable' ?>
<?php if ($this->context->post->isTaggedWith($this->context->additionalInfo)): ?>
<?php $classNames []= 'tagged' ?>
<?php endif ?>
<?php endif ?>
<div class="<?php echo implode(' ', $classNames) ?>">
<?php if ($masstag): ?>
<a class="toggle-tag" href="<?php echo \Chibi\UrlHelper::route('post', 'toggle-tag', ['id' => $this->context->post->id, 'tag' => $this->context->additionalInfo, 'enable' => '_enable_']) ?>" data-text-tagged="Tagged" data-text-untagged="Untagged">
<?php echo in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?>
</a>
<?php endif ?>
<?php if ($this->context->user->hasEnabledPostTagTitles()): ?>
<a title="<?php echo TextHelper::reprTags($this->context->post->sharedTag) ?>" class="link" href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
<?php else: ?>
<a class="link" href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
<?php endif ?>
<img class="thumb" src="<?php echo \Chibi\UrlHelper::route('post', 'thumb', ['name' => $this->context->post->name]) ?>" alt="@<?php echo $this->context->post->id ?>"/>
<?php
$x =
[
'score' => $this->context->post->score,
'comments' => $this->context->post->comment_count,
'favs' => $this->context->post->fav_count,
];
?>
<?php if (!empty($x)): ?>
<div class="info-bar">
<?php foreach ($x as $key => $val): ?>
<?php if ($val == 0): ?>
<span class="inactive">
<?php else: ?>
<span>
<?php endif ?>
<i class="icon-<?php echo $key ?>"></i>
&nbsp;<?php echo $val ?>
</span>
<?php endforeach ?>
</div>
<?php endif ?>
</a>
</div>