summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-04 14:15:59 -0800
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-04 14:15:59 -0800
commitaff58561e94396f2078c4f724cc50ab8acf26898 (patch)
tree6aad9fbd05ed6b3cbd690ae7b71e2d3785193f54 /app
parentcabacaff97f45ab858cc68fe00b0dd2585b6af02 (diff)
parente7dd4829799e9e14456e1b1fc3aca20412394798 (diff)
Merge pull request #214 from Alkarex/updateUnreads
Mise à jour automatique des nombres d'articles non lus et favoris
Diffstat (limited to 'app')
-rw-r--r--app/layout/aside_flux.phtml47
1 files changed, 17 insertions, 30 deletions
diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml
index 8928ffca0..22f52d25a 100644
--- a/app/layout/aside_flux.phtml
+++ b/app/layout/aside_flux.phtml
@@ -30,20 +30,16 @@
<?php } ?>
<li>
- <div class="all">
- <a class="btn<?php echo $this->get_c == 'all' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index'); ?>">
- <i class="icon i_all"></i>
- <?php echo Translate::t ('all_feeds', $this->nb_total); ?>
- <?php if ($this->nb_not_read > 0) { ?>
- <span class="notRead"><?php echo $this->nb_not_read > 1 ? Translate::t ('not_reads', $this->nb_not_read) : Translate::t ('not_read', $this->nb_not_read); ?></span>
- <?php } ?>
+ <div class="category all">
+ <a data-unread="<?php echo $this->nb_not_read; ?>" class="btn<?php echo $this->get_c == 'all' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index'); ?>">
+ <i class="icon i_all"></i><?php echo Translate::t ('all_feeds', $this->nb_total); ?>
</a>
</div>
</li>
<li>
- <div class="favorites">
- <a class="btn<?php echo $this->get_c == 'favoris' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 'favoris'); ?>">
+ <div class="category favorites">
+ <a data-unread="0" class="btn<?php echo $this->get_c == 'favoris' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 'favoris'); ?>">
<i class="icon i_bookmark"></i>
<?php echo Translate::t ('favorite_feeds', $this->nb_favorites); ?>
</a>
@@ -51,36 +47,27 @@
</li>
<?php foreach ($this->cat_aside as $cat) { ?>
- <?php $feeds = $cat->feeds (); $catNotRead = $cat->nbNotRead (); ?>
+ <?php $feeds = $cat->feeds (); ?>
<?php if (!empty ($feeds)) { ?>
<li>
<?php $c_active = false; if ($this->get_c == $cat->id ()) { $c_active = true; } ?>
<div class="category<?php echo $c_active ? ' active' : ''; ?>">
- <a class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id ()); ?>">
- <?php echo $cat->name (); ?>
- <?php if ($catNotRead > 0) { ?>
- <span class="notRead" title="<?php echo $catNotRead > 1 ? Translate::t ('not_reads', $catNotRead) : Translate::t ('not_read', $catNotRead); ?>"><?php echo $catNotRead ; ?></span>
- <?php } ?>
- </a>
+ <a data-unread="<?php echo $cat->nbNotRead (); ?>" class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id ()); ?>"><?php echo $cat->name (); ?></a>
</div>
<ul class="feeds<?php echo $c_active ? ' active' : ''; ?>">
- <?php foreach ($feeds as $feed) { ?>
- <?php $nbEntries = $feed->nbEntries (); ?>
- <?php $f_active = false; if ($this->get_f == $feed->id ()) { $f_active = true; } ?>
- <li class="item<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>">
+ <?php foreach ($feeds as $feed) {
+ $feed_id = $feed->id (); $nbEntries = $feed->nbEntries ();
+ $f_active = ($this->get_f == $feed_id);
+ ?>
+ <li id="f_<?php echo $feed_id; ?>" class="item<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>">
<div class="dropdown">
<div class="dropdown-target"></div>
- <a class="dropdown-toggle" data-fid="<?php echo $feed->id (); ?>" data-fweb="<?php echo $feed->website (); ?>"><i class="icon i_configure"></i></a>
+ <a class="dropdown-toggle" data-fweb="<?php echo $feed->website (); ?>"><i class="icon i_configure"></i></a>
<?php /* feed_config_template */ ?>
</div>
- <?php $not_read = $feed->nbNotRead (); ?>
- <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" />
- <?php echo $not_read > 0 ? '<b>' : ''; ?>
- <a class="feed" href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>">
- <?php echo ($not_read > 0 ? '(' . $not_read . ') ' : ''), $feed->name(); ?>
- </a>
- <?php echo $not_read > 0 ? '</b>' : ''; ?>
+ <img class="favicon" src="<?php echo $feed->favicon (); ?>" />
+ <a class="feed" data-unread="<?php echo $feed->nbNotRead (); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed_id); ?>"><?php echo $feed->name(); ?></a>
</li>
<?php } ?>
</ul>
@@ -94,13 +81,13 @@
<script id="feed_config_template" type="text/html">
<ul class="dropdown-menu">
<li class="dropdown-close"><a href="#close">&nbsp;</a></li>
- <li class="item"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . '!!!!!!'); ?>"><?php echo Translate::t ('filter'); ?></a></li>
+ <li class="item"><a href="<?php echo _url ('index', 'index', 'get', 'f_!!!!!!'); ?>"><?php echo Translate::t ('filter'); ?></a></li>
<li class="item"><a target="_blank" href="http://example.net/"><?php echo Translate::t ('see_website'); ?></a></li>
<?php if (!login_is_conf ($this->conf) || is_logged ()) { ?>
<li class="separator"></li>
<li class="item"><a href="<?php echo _url ('configure', 'feed', 'id', '!!!!!!'); ?>"><?php echo Translate::t ('administration'); ?></a></li>
<li class="item"><a href="<?php echo _url ('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo Translate::t ('actualize'); ?></a></li>
- <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', 'f_' . '!!!!!!'); ?>"><?php echo Translate::t ('mark_read'); ?></a></li>
+ <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', 'f_!!!!!!'); ?>"><?php echo Translate::t ('mark_read'); ?></a></li>
<?php } ?>
</ul>
</script>