aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2018-01-11 22:41:44 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-01-11 22:41:44 +0100
commiteb814e682bdb932f71529f4d36644c9bb0c6474e (patch)
tree95f3459da5948ed37c34c47b1ba27e7fa72df640
parenta14c160beb360ffb00f255621030c77878f6c8a1 (diff)
Allow favorite in reading mode (#1761)
I've got the inspiration from the mark as read action. So I've used the id of the feed to trigger the action and not the url in the link. This way, it works all the time. It works in reading mode, it works in normal mode when icon are not displayed. See #1545
-rw-r--r--app/views/index/reader.phtml18
1 files changed, 16 insertions, 2 deletions
diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml
index f2af75af0..eb6613b28 100644
--- a/app/views/index/reader.phtml
+++ b/app/views/index/reader.phtml
@@ -18,11 +18,25 @@ if (!empty($this->entries)) {
<?php
$feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache
if (empty($feed)) $feed = $item->feed(true);
+ $favoriteUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id()));
+ if ($item->isFavorite()) {
+ $favoriteUrl['params']['is_favorite'] = 0;
+ }
+ $readUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id()));
+ if ($item->isRead()) {
+ $readUrl['params']['is_read'] = 0;
+ }
?>
- <a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $item->link(); ?>">
+ <a class="read" href="<?php echo Minz_Url::display($readUrl); ?>">
+ <?php echo _i($item->isRead() ? 'read' : 'unread'); ?>
+ </a>
+ <a class="bookmark" href="<?php echo Minz_Url::display($favoriteUrl); ?>">
+ <?php echo _i($item->isFavorite() ? 'starred' : 'non-starred'); ?>
+ </a>
+ <a href="<?php echo _url('index', 'reader', 'get', 'f_' . $feed->id()); ?>">
<img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span>
</a>
- <h1 class="title"><?php echo $item->title(); ?></h1>
+ <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></h1>
<div class="author"><?php
$author = $item->author();