From 2e0441195b65316cbef40574d55c7f1b305b3615 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 13 Sep 2013 21:56:45 +0200 Subject: [PATCH 1/2] Title: Unread in category/feed vs. global Distinguish in the title of the page between the number of unread articles in the category/feed displayed vs. the total number of unread articles. --- app/controllers/indexController.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 8cc3bb15a..493384c5b 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -29,10 +29,9 @@ class indexController extends ActionController { $nb_not_read = $this->view->nb_not_read; if($nb_not_read > 0) { - View::prependTitle (' (' . $nb_not_read . ') - '); - } else { - View::prependTitle (' - '); + View::appendTitle (' (' . $nb_not_read . ')'); } + View::prependTitle (' - '); $entryDAO = new EntryDAO (); $feedDAO = new FeedDAO (); @@ -132,7 +131,8 @@ class indexController extends ActionController { $catDAO = new CategoryDAO (); $cat = $catDAO->searchById ($type['id']); if ($cat) { - View::prependTitle ($cat->name ()); + $nbnr = $cat->nbNotRead (); + View::prependTitle ($cat->name () . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_c = $type['id']; return false; } else { @@ -142,7 +142,8 @@ class indexController extends ActionController { $feedDAO = new FeedDAO (); $feed = $feedDAO->searchById ($type['id']); if ($feed) { - View::prependTitle ($feed->name ()); + $nbnr = $feed->nbNotRead (); + View::prependTitle ($feed->name () . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_f = $type['id']; $this->view->get_c = $feed->category (); return false; From d47137cddd6a02bf609728c76b8adc7cdea1adf3 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 14 Sep 2013 15:29:09 +0200 Subject: [PATCH 2/2] Affiche le titre en cours sur la ligne du jours MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit En particulier en affichage mobile, il n'était pas facile de voir quelle catégorie ou flux on était en train de lire. Ce patch l'affiche sur la ligne du jours, avec une suggestion de style. --- app/controllers/indexController.php | 18 ++++++++++++------ app/views/helpers/view/normal_view.phtml | 6 +++--- public/themes/default/freshrss.css | 12 ++++++++++++ public/themes/flat-design/freshrss.css | 12 ++++++++++++ 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 493384c5b..d1c615d6d 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -3,7 +3,7 @@ class indexController extends ActionController { private $get = false; private $nb_not_read = 0; - private $mode = 'all'; + private $mode = 'all'; //TODO: Is this used? public function indexAction () { $output = Request::param ('output'); @@ -40,6 +40,7 @@ class indexController extends ActionController { $this->view->cat_aside = $catDAO->listCategories (); $this->view->nb_favorites = $entryDAO->countFavorites (); $this->view->nb_total = $entryDAO->count (); + $this->view->currentName = ''; $this->view->get_c = ''; $this->view->get_f = ''; @@ -116,23 +117,27 @@ class indexController extends ActionController { */ private function checkAndProcessType ($type) { if ($type['type'] == 'all') { - View::prependTitle (Translate::t ('your_rss_feeds')); + $this->view->currentName = Translate::t ('your_rss_feeds'); + View::prependTitle ($this->view->currentName); $this->view->get_c = $type['type']; return false; } elseif ($type['type'] == 'favoris') { - View::prependTitle (Translate::t ('your_favorites')); + $this->view->currentName = Translate::t ('your_favorites'); + View::prependTitle ($this->view->currentName); $this->view->get_c = $type['type']; return false; } elseif ($type['type'] == 'public') { - View::prependTitle (Translate::t ('public')); + $this->view->currentName = Translate::t ('public'); + View::prependTitle ($this->view->currentName); $this->view->get_c = $type['type']; return false; } elseif ($type['type'] == 'c') { $catDAO = new CategoryDAO (); $cat = $catDAO->searchById ($type['id']); if ($cat) { + $this->view->currentName = $cat->name (); $nbnr = $cat->nbNotRead (); - View::prependTitle ($cat->name () . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); + View::prependTitle ($this->view->currentName . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_c = $type['id']; return false; } else { @@ -142,8 +147,9 @@ class indexController extends ActionController { $feedDAO = new FeedDAO (); $feed = $feedDAO->searchById ($type['id']); if ($feed) { + $this->view->currentName = $feed->name (); $nbnr = $feed->nbNotRead (); - View::prependTitle ($feed->name () . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); + View::prependTitle ($this->view->currentName . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_f = $type['id']; $this->view->get_c = $feed->category (); return false; diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index fb4e60cf6..e5d03776c 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -16,13 +16,13 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { isDay (Days::TODAY)) { ?> -
-
+
- : currentName; ?>
isDay (Days::YESTERDAY)) { ?> -
-
+
- : currentName; ?>
isDay (Days::BEFORE_YESTERDAY)) { ?> -
+
: currentName; ?>
diff --git a/public/themes/default/freshrss.css b/public/themes/default/freshrss.css index 3f0b3c23c..926aabca8 100644 --- a/public/themes/default/freshrss.css +++ b/public/themes/default/freshrss.css @@ -180,6 +180,18 @@ .day:first-child { border-top: none; } + .day em { + color:#AAB; + font-size:2em; + height:1.5em; + opacity:.4; + overflow:hidden; + padding:0 .2em 0 0; + position:absolute; + right:0; + text-align:right; + width:75% + } .flux { border-left: 3px solid #aaa; diff --git a/public/themes/flat-design/freshrss.css b/public/themes/flat-design/freshrss.css index 653de0420..4b58a1a84 100644 --- a/public/themes/flat-design/freshrss.css +++ b/public/themes/flat-design/freshrss.css @@ -179,6 +179,18 @@ body { background: #ecf0f1; border-radius: 0 20px 20px 0; } + .day em { + color:#AAB; + font-size:2em; + height:1.5em; + opacity:.4; + overflow:hidden; + padding:0 .2em 0 0; + position:absolute; + right:0; + text-align:right; + width:75%; + } .flux { }