From 80cffa6de51771cd80995fb1c4f1e04ee868eb45 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 21 Oct 2014 16:46:36 +0200 Subject: 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 --- app/views/index/global.phtml | 4 +- app/views/index/normal.phtml | 191 +++++++++++++++++++++++++++++++++++++++++++ app/views/index/rss.phtml | 29 +++++++ 3 files changed, 221 insertions(+), 3 deletions(-) create mode 100644 app/views/index/normal.phtml create mode 100755 app/views/index/rss.phtml (limited to 'app/views/index') diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml index a72e431df..ab63c409a 100644 --- a/app/views/index/global.phtml +++ b/app/views/index/global.phtml @@ -5,9 +5,7 @@ $url_base = array( 'c' => 'index', 'a' => 'index', - 'params' => array( - 'state' => FreshRSS_Context::$state - ) + 'params' => array() ); foreach ($this->categories as $cat) { diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml new file mode 100644 index 000000000..6333d63db --- /dev/null +++ b/app/views/index/normal.phtml @@ -0,0 +1,191 @@ +partial('aside_flux'); +$this->partial('nav_menu'); + +if (!empty($this->entries)) { + $display_today = true; + $display_yesterday = true; + $display_others = true; + if (FreshRSS_Auth::hasAccess()) { + $sharing = FreshRSS_Context::$conf->sharing; + } else { + $sharing = array(); + } + $hidePosts = !FreshRSS_Context::$conf->display_posts; + $lazyload = FreshRSS_Context::$conf->lazyload; + $topline_read = FreshRSS_Context::$conf->topline_read; + $topline_favorite = FreshRSS_Context::$conf->topline_favorite; + $topline_date = FreshRSS_Context::$conf->topline_date; + $topline_link = FreshRSS_Context::$conf->topline_link; + $bottomline_read = FreshRSS_Context::$conf->bottomline_read; + $bottomline_favorite = FreshRSS_Context::$conf->bottomline_favorite; + $bottomline_sharing = FreshRSS_Context::$conf->bottomline_sharing && (count($sharing)); + $bottomline_tags = FreshRSS_Context::$conf->bottomline_tags; + $bottomline_date = FreshRSS_Context::$conf->bottomline_date; + $bottomline_link = FreshRSS_Context::$conf->bottomline_link; + + $content_width = FreshRSS_Context::$conf->content_width; +?> + +
+ +
entries as $item) { + if ($display_today && $item->isDay(FreshRSS_Days::TODAY, $this->today)) { + ?>
currentName; ?>
isDay(FreshRSS_Days::YESTERDAY, $this->today)) { + ?>
currentName; ?>
isDay(FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { + ?>
currentName; ?>
+
  • 'entry', 'a' => 'read', 'params' => array('id' => $item->id())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?>isRead() ? 'read' : 'unread'); ?>
  • 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?>isFavorite() ? 'starred' : 'non-starred'); ?>
  • categories, $item->feed()); //We most likely already have the feed object in cache + if ($feed == null) { + $feed = $item->feed(true); + if ($feed == null) { + $feed = FreshRSS_Feed::example(); + } + } + ?>
  • ✇ name(); ?>
  • +
  • title(); ?>
  • +
  • date(); ?> 
  • + +
+ +
+
+

title(); ?>

+ author(); + echo $author != '' ? '
' . _t('by_author', $author) . '
' : '', + $lazyload && $hidePosts ? lazyimg($item->content()) : $item->content(); + ?> +
+
  • 'entry', 'a' => 'read', 'params' => array('id' => $item->id())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?>isRead() ? 'read' : 'unread'); ?>
  • 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?>isFavorite() ? 'starred' : 'non-starred'); ?>
  • +
  • link()); + $title = urlencode($item->title() . ' · ' . $feed->name()); + ?> + +
  • tags() : null; + if (!empty($tags)) { + ?>
  • + +
  • date(); ?>
  • +
+
+
+ + + renderHelper('pagination'); ?> +
+ +partial('nav_entries'); ?> + + +
+

+

+
+ diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml new file mode 100755 index 000000000..e34b15ab1 --- /dev/null +++ b/app/views/index/rss.phtml @@ -0,0 +1,29 @@ +'; ?> + + + <?php echo $this->rss_title; ?> + + rss_title); ?> + + GMT + +entries as $item) { +?> + + <?php echo $item->title(); ?> + link(); ?> + author(); ?> + + + + content(); +?>]]> + date(true)); ?> + id(); ?> + + + + + -- cgit v1.2.3