Add the number of unread items when reading an article

This commit is contained in:
Frédéric Guillot 2013-09-06 18:10:46 -04:00
parent a596472100
commit 95f5dd1257

View File

@ -100,6 +100,7 @@ Router\get_action('show', function() {
switch ($menu) { switch ($menu) {
case 'unread': case 'unread':
$nav = Model\get_nav_item($item); $nav = Model\get_nav_item($item);
$nb_unread_items = Model\count_items('unread');
break; break;
case 'history': case 'history':
$nav = Model\get_nav_item($item, array('read')); $nav = Model\get_nav_item($item, array('read'));
@ -113,6 +114,7 @@ Router\get_action('show', function() {
} }
Response\html(Template\layout('show_item', array( Response\html(Template\layout('show_item', array(
'nb_unread_items' => isset($nb_unread_items) ? $nb_unread_items : null,
'item' => $item, 'item' => $item,
'feed' => $feed, 'feed' => $feed,
'item_nav' => isset($nav) ? $nav : null, 'item_nav' => isset($nav) ? $nav : null,