diff options
| author | 2014-10-20 19:35:22 +0200 | |
|---|---|---|
| committer | 2014-10-20 19:35:22 +0200 | |
| commit | 8a7bab3a55442f85553ab1d897084e89c10f7e05 (patch) | |
| tree | 3d98b3f07a3bab84b3c39116c9d5e4ec81abdba5 /app/views/index | |
| parent | 1a22a87fb1b1fcb61d201de399c33c2185dc1f6e (diff) | |
Refactoring of indexController
Global view has been moved to a different action (all is not working)
See https://github.com/marienfressinaud/FreshRSS/issues/634
and https://github.com/marienfressinaud/FreshRSS/issues/655
Diffstat (limited to 'app/views/index')
| -rw-r--r-- | app/views/index/global.phtml | 46 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 2 |
2 files changed, 46 insertions, 2 deletions
diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml new file mode 100644 index 000000000..a72e431df --- /dev/null +++ b/app/views/index/global.phtml @@ -0,0 +1,46 @@ +<?php //$this->partial('nav_menu'); ?> + +<div id="stream" class="global categories"> +<?php + $url_base = array( + 'c' => 'index', + 'a' => 'index', + 'params' => array( + 'state' => FreshRSS_Context::$state + ) + ); + + foreach ($this->categories as $cat) { + $feeds = $cat->feeds(); + $url_base['params']['get'] = 'c_' . $cat->id(); + + if (!empty($feeds)) { +?> + <div class="box"> + <div class="box-title"><a data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo Minz_Url::display($url_base); ?>"><?php echo $cat->name(); ?></a></div> + + <ul class="box-content"> + <?php + foreach ($feeds as $feed) { + $nb_not_read = $feed->nbNotRead(); + $error = $feed->inError() ? 'error ' : ''; + $empty = $feed->nbEntries() === 0 ? 'empty ' : ''; + $url_base['params']['get'] = 'f_' . $feed->id(); + ?> + <li class="item feed<?php echo $error, $empty; ?>"> + <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 Minz_Url::display($url_base); ?>"><?php echo $feed->name(); ?></a> + </li> + <?php } ?> + </ul> + </div> +<?php + } + } +?> +</div> + +<div id="overlay"></div> +<div id="panel"<?php echo FreshRSS_Context::$conf->display_posts ? '' : ' class="hide_posts"'; ?>> + <a class="close" href="#"><?php echo _i('close'); ?></a> +</div> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index a59063557..8b93461dd 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -7,8 +7,6 @@ if (FreshRSS_Auth::hasAccess() || Minz_Configuration::allowAnonymous()) { $this->renderHelper('view/normal_view'); } elseif ($output === 'reader') { $this->renderHelper('view/reader_view'); - } elseif ($output === 'global') { - $this->renderHelper('view/global_view'); } elseif ($output === 'rss') { $this->renderHelper('view/rss_view'); } else { |
