aboutsummaryrefslogtreecommitdiff
path: root/app/layout/aside_flux.phtml
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-21 16:46:36 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-21 16:55:19 +0200
commit80cffa6de51771cd80995fb1c4f1e04ee868eb45 (patch)
tree5199c6512140b804e2c456d263d40816ab79a6eb /app/layout/aside_flux.phtml
parent8a7bab3a55442f85553ab1d897084e89c10f7e05 (diff)
Views are in dedicated actions + improve Context
- Seperate normal, global and rss outputs in dedicated actions (NOT WORKING YET!) - Rewrite aside_flux and nav_menu to use Context object - Improve Context object See https://github.com/marienfressinaud/FreshRSS/issues/634
Diffstat (limited to 'app/layout/aside_flux.phtml')
-rw-r--r--app/layout/aside_flux.phtml103
1 files changed, 37 insertions, 66 deletions
diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml
index 114ccbf56..e572e9d48 100644
--- a/app/layout/aside_flux.phtml
+++ b/app/layout/aside_flux.phtml
@@ -1,82 +1,53 @@
-<div class="aside aside_flux<?php if (FreshRSS_Context::$conf->hide_read_feeds && ($this->state & FreshRSS_Entry::STATE_NOT_READ) && !($this->state & FreshRSS_Entry::STATE_READ)) echo ' state_unread'; ?>" id="aside_flux">
+<div class="aside aside-flux" id="aside-flux">
<a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a>
- <ul class="categories">
- <?php if (FreshRSS_Auth::hasAccess()) { ?>
- <form id="mark-read-aside" method="post" style="display: none"></form>
+ <?php if (FreshRSS_Auth::hasAccess()) { ?>
+ <div class="stick configure-feeds">
+ <a class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('subscription_management'); ?></a>
+ <a class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a>
+ </div>
+ <?php } elseif (Minz_Configuration::needsLogin()) { ?>
+ <a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a>
+ <?php } ?>
+
+ <form id="mark-read-aside" method="post" style="display: none"></form>
- <li>
- <div class="stick configure-feeds">
- <a class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('subscription_management'); ?></a>
- <a class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a>
- </div>
+ <ul class="tree">
+ <li class="tree-folder<?php echo FreshRSS_Context::isCurrentGet('a') ? ' active' : ''; ?>">
+ <a class="tree-folder-title" data-unread="<?php echo format_number(FreshRSS_Context::$total_unread); ?>" href="<?php echo _url('index', 'index'); ?>"><?php echo _i('all'), ' ', _t('main_stream'); ?></a>
+ </li>
+
+ <li class="tree-folder<?php echo FreshRSS_Context::isCurrentGet('s') ? ' active' : ''; ?>">
+ <a class="tree-folder-title" data-unread="<?php echo format_number(FreshRSS_Context::$total_starred['unread']); ?>" href="<?php echo _url('index', 'index', 'get', 's'); ?>"><?php echo _i('bookmark'), ' ', _t('favorite_feeds', format_number(FreshRSS_Context::$total_starred['all'])); ?></a>
</li>
- <?php } elseif (Minz_Configuration::needsLogin()) { ?>
- <li><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></li>
- <?php } ?>
<?php
- $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array());
- if (FreshRSS_Context::$conf->view_mode !== Minz_Request::param('output', 'normal')) {
- $arUrl['params']['output'] = 'normal';
- }
+ foreach ($this->categories as $cat) {
+ $feeds = $cat->feeds();
+ if (!empty($feeds)) {
?>
- <li>
- <div class="category all<?php echo $this->get_c == 'a' ? ' active' : ''; ?>">
- <a data-unread="<?php echo formatNumber($this->nb_not_read); ?>" class="btn<?php echo $this->get_c == 'a' ? ' active' : ''; ?>" href="<?php echo Minz_Url::display($arUrl); ?>">
- <?php echo _i('all'); ?>
- <?php echo _t('main_stream'); ?>
- </a>
- </div>
- </li>
+ <li class="tree-folder<?php echo FreshRSS_Context::isCurrentGet('c_' . $cat->id()) ? ' active' : ''; ?>">
+ <a class="tree-folder-title" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo _i('category'), ' ', $cat->name(); ?></a>
- <li>
- <div class="category favorites<?php echo $this->get_c == 's' ? ' active' : ''; ?>">
- <a data-unread="<?php echo formatNumber($this->nb_favorites['unread']); ?>" class="btn<?php echo $this->get_c == 's' ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 's'; echo Minz_Url::display($arUrl); ?>">
- <?php echo _i('bookmark'); ?>
- <?php echo _t('favorite_feeds', formatNumber($this->nb_favorites['all'])); ?>
- </a>
- </div>
+ <ul class="items">
+ <?php foreach ($feeds as $feed) { ?>
+ <li class="item<?php echo FreshRSS_Context::isCurrentGet('f_' . $feed->id()) ? ' active' : ''; ?>">
+ <div class="dropdown">
+ <div class="dropdown-target"></div>
+ <a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a>
+ <?php /* feed_config_template */ ?>
+ </div>
+ <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" />
+ <a data-unread="<?php echo format_number($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>
</li>
-
<?php
- foreach ($this->cat_aside as $cat) {
- $feeds = $cat->feeds();
- if (!empty($feeds)) {
- $c_active = false;
- $c_show = false;
- if ($this->get_c == $cat->id()) {
- $c_active = true;
- if (!FreshRSS_Context::$conf->display_categories || $this->get_f) {
- $c_show = true;
- }
}
- ?><li data-unread="<?php echo $cat->nbNotRead(); ?>"<?php if ($c_active) echo ' class="active"'; ?>><?php
- ?><div class="category stick<?php echo $c_active ? ' active' : ''; ?>"><?php
- ?><a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id(); echo Minz_Url::display($arUrl); ?>"><?php echo $cat->name(); ?></a><?php
- ?><a class="btn dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a><?php
- ?></div><?php
- ?><ul class="feeds<?php echo $c_show ? ' active' : ''; ?>"><?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' : ''; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>"><?php
- ?><div class="dropdown"><?php
- ?><div class="dropdown-target"></div><?php
- ?><a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a><?php
- /* feed_config_template */
- ?></div><?php
- ?> <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php
- ?><a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority(); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed_id; echo Minz_Url::display($arUrl); ?>"><?php echo $feed->name(); ?></a><?php
- ?></li><?php
- }
- ?></ul><?php
- ?></li><?php
}
- } ?>
+ ?>
</ul>
- <span class="aside_flux_ender"><!-- For fixed menu --></span>
</div>
<script id="feed_config_template" type="text/html">