2013-10-29 09:04:42 +01:00
|
|
|
<?php $classNames = ['post', 'post-type-' . TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type))] ?>
|
2013-11-21 20:58:53 +01:00
|
|
|
<?php $masstag = (isset($this->context->source) and $this->context->source == 'mass-tag' and !empty($this->context->additionalInfo)) ?>
|
|
|
|
<?php if ($masstag): ?>
|
2013-10-29 09:04:42 +01:00
|
|
|
<?php $classNames []= 'taggable' ?>
|
2013-11-21 21:06:18 +01:00
|
|
|
<?php if ($this->context->post->isTaggedWith($this->context->additionalInfo)): ?>
|
2013-10-29 09:04:42 +01:00
|
|
|
<?php $classNames []= 'tagged' ?>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<div class="<?php echo implode(' ', $classNames) ?>">
|
2013-11-21 20:58:53 +01:00
|
|
|
<?php if ($masstag): ?>
|
2013-11-25 11:59:59 +01:00
|
|
|
<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">
|
2013-10-29 09:04:42 +01:00
|
|
|
<?php echo in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?>
|
|
|
|
</a>
|
|
|
|
<?php endif ?>
|
2013-11-25 12:07:50 +01:00
|
|
|
|
|
|
|
<?php if ($this->context->user->hasEnabledPostTagTitles()): ?>
|
|
|
|
<a title="<?php echo join(', ', array_map(['TextHelper', 'reprTag'], $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 ?>
|
2013-10-23 00:16:52 +02:00
|
|
|
<img class="thumb" src="<?php echo \Chibi\UrlHelper::route('post', 'thumb', ['name' => $this->context->post->name]) ?>" alt="@<?php echo $this->context->post->id ?>"/>
|
2013-11-16 22:02:32 +01:00
|
|
|
<?php
|
|
|
|
$x =
|
|
|
|
[
|
|
|
|
'score' => $this->context->post->score,
|
|
|
|
'comments' => $this->context->post->countOwn('comment'),
|
|
|
|
'favs' => $this->context->post->countOwn('favoritee'),
|
|
|
|
];
|
|
|
|
?>
|
|
|
|
<?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>
|
|
|
|
<?php echo $val ?>
|
|
|
|
</span>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</div>
|
|
|
|
<?php endif ?>
|
2013-10-19 20:05:03 +02:00
|
|
|
</a>
|
|
|
|
</div>
|