diff options
Diffstat (limited to 'app/views/helpers/view/normal_view.phtml')
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 127 |
1 files changed, 72 insertions, 55 deletions
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 5e46f3c8e..a1df87579 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -37,50 +37,59 @@ if (!empty($this->entries)) { $bottomline_link = $this->conf->bottomline_link; ?> -<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"> - <?php foreach ($this->entries as $item) { ?> +<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php + foreach ($this->entries as $item) { + if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { + ?><div class="day" id="day_today"><?php + echo Minz_Translate::t ('today'); + ?><span class="date"> — <?php echo timestamptodate (time (), false); ?></span><?php + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_today = false; + } + if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { + ?><div class="day" id="day_yesterday"><?php + echo Minz_Translate::t ('yesterday'); + ?><span class="date"> — <?php echo timestamptodate (time () - 86400, false); ?></span><?php + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_yesterday = false; + } + if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { + ?><div class="day" id="day_before_yesterday"><?php + echo Minz_Translate::t ('before_yesterday'); + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_others = false; + } - <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { ?> - <div class="day" id="day_today"> - <?php echo Minz_Translate::t ('today'); ?> - <span class="date"> - <?php echo timestamptodate (time (), false); ?></span> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_today = false; } ?> - <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { ?> - <div class="day" id="day_yesterday"> - <?php echo Minz_Translate::t ('yesterday'); ?> - <span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_yesterday = false; } ?> - <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { ?> - <div class="day" id="day_before_yesterday"> - <?php echo Minz_Translate::t ('before_yesterday'); ?> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_others = false; } ?> - - <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> + ?><div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> <ul class="horizontal-list flux_header"><?php if ($this->loginOk) { if ($topline_read) { ?><li class="item manage"><?php - ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } if ($topline_favorite) { - ?><li class="item manage"><?php - ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } } $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache if (empty($feed)) $feed = $item->feed (true); - ?> - <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> + ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li> <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> @@ -103,24 +112,30 @@ if (!empty($this->entries)) { if ($this->loginOk) { if ($bottomline_read) { ?><li class="item manage"><?php - ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } if ($bottomline_favorite) { ?><li class="item manage"><?php - ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } } ?> - <li class="item"> - <?php + <li class="item"><?php if ($bottomline_sharing) { $link = urlencode ($item->link ()); - $title = urlencode ($item->title () . ' - ' . $feed->name ()); - ?> - <div class="dropdown"> + $title = urlencode ($item->title () . ' · ' . $feed->name ()); + ?><div class="dropdown"> <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"> <?php echo FreshRSS_Themes::icon('share'); ?> @@ -181,29 +196,30 @@ if (!empty($this->entries)) { </ul> </div> <?php } ?> - </li> - <?php - $tags = $bottomline_tags ? $item->tags() : null; - if (!empty($tags)) { - ?> - <li class="item"> + </li><?php + $tags = $bottomline_tags ? $item->tags() : null; + if (!empty($tags)) { + ?><li class="item"> <div class="dropdown"> <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> - <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"> - <?php echo FreshRSS_Themes::icon('tag'); ?> - <?php echo Minz_Translate::t ('related_tags'); ?> - </a> + <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php + echo FreshRSS_Themes::icon('tag'), Minz_Translate::t ('related_tags'); + ?></a> <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - <?php foreach($tags as $tag) { ?> - <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li> - <?php } ?> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + foreach($tags as $tag) { + ?><li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php + } ?> </ul> </div> - </li> - <?php } ?> - <?php if ($bottomline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($bottomline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> + </li><?php + } + if ($bottomline_date) { + ?><li class="item date"><?php echo $item->date (); ?></li><?php + } + if ($bottomline_link) { + ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php + } ?> </ul> </div> </div> @@ -217,5 +233,6 @@ if (!empty($this->entries)) { <?php } else { ?> <div id="stream" class="alert alert-warn normal"> <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> + <?php echo Minz_Translate::t ('think_to_add'); ?> </div> -<?php } ?>
\ No newline at end of file +<?php } ?> |
