Tag list: added info when there are no tags

This commit is contained in:
Marcin Kurczewski 2013-11-23 16:01:21 +01:00
parent d274f1c044
commit ee224b84db

View file

@ -25,11 +25,14 @@
</ul> </ul>
</nav> </nav>
<?php $max = max([0]+array_map(function($x) { return $x['post_count']; }, $this->context->transport->tags)); ?> <?php if (empty($this->context->transport->tags)): ?>
<?php $add = 0. ?> <p class="alert alert-warning">No tags to show.</p>
<?php $mul = 10. / max(1, log(max(1, $max))) ?> <?php else: ?>
<?php $url = \Chibi\UrlHelper::route('post', 'list', ['query' => '_query_']) ?> <?php $max = max([0]+array_map(function($x) { return $x['post_count']; }, $this->context->transport->tags)); ?>
<div class="tags"> <?php $add = 0. ?>
<?php $mul = 10. / max(1, log(max(1, $max))) ?>
<?php $url = \Chibi\UrlHelper::route('post', 'list', ['query' => '_query_']) ?>
<div class="tags">
<ul> <ul>
<?php foreach ($this->context->transport->tags as $tag): ?> <?php foreach ($this->context->transport->tags as $tag): ?>
<?php $name = $tag['name'] ?> <?php $name = $tag['name'] ?>
@ -41,4 +44,5 @@
</li> </li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
</div> </div>
<?php endif ?>