From b55571de8f19fab15202826950184cfcb90d364c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 8 Apr 2014 23:26:41 -0400 Subject: Split reading configuration page I splitted the reading configuration page in 2 pages. The display configuration page to prepare for #265 and the reading configuration page. It is just a test, feel free to discard that. I also change some wording to be consistent through out the application. --- app/layout/aside_configure.phtml | 5 ++++- app/layout/header.phtml | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app/layout') diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 27f11ab6d..43adeb3c6 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,7 +1,10 @@ @@ -243,6 +222,23 @@ + order === 'DESC') { + $order = 'ASC'; + $icon = 'up'; + $title = 'older_first'; + } else { + $order = 'DESC'; + $icon = 'down'; + $title = 'newer_first'; + } + $url_order = $this->url; + $url_order['params']['order'] = $order; + ?> + + + + -- cgit v1.2.3 From 6323311cb4f2c89c695feb747566a05b5cb8044a Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 13 Apr 2014 18:06:11 -0400 Subject: Add div.stick to collapse button space --- app/layout/nav_menu.phtml | 124 +++++++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 61 deletions(-) (limited to 'app/layout') diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index eaa564023..58e561754 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -18,67 +18,69 @@ $class = ''; } ?> - - - - state & FreshRSS_Entry::STATE_NOT_READ) { - $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_NOT_READ; - $checked = 'true'; - $class = 'active'; - } else { - $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_NOT_READ; - $checked = 'false'; - $class = ''; - } - ?> - - - - state & FreshRSS_Entry::STATE_FAVORITE) { - $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_FAVORITE; - $checked = 'true'; - $class = 'active'; - } else { - $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_FAVORITE; - $checked = 'false'; - $class = ''; - } - ?> - - - - state & FreshRSS_Entry::STATE_NOT_FAVORITE) { - $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_NOT_FAVORITE; - $checked = 'true'; - $class = 'active'; - } else { - $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_NOT_FAVORITE; - $checked = 'false'; - $class = ''; - } - ?> - - - +
+ + + + state & FreshRSS_Entry::STATE_NOT_READ) { + $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_NOT_READ; + $checked = 'true'; + $class = 'active'; + } else { + $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_NOT_READ; + $checked = 'false'; + $class = ''; + } + ?> + + + + state & FreshRSS_Entry::STATE_FAVORITE) { + $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_FAVORITE; + $checked = 'true'; + $class = 'active'; + } else { + $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_FAVORITE; + $checked = 'false'; + $class = ''; + } + ?> + + + + state & FreshRSS_Entry::STATE_NOT_FAVORITE) { + $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_NOT_FAVORITE; + $checked = 'true'; + $class = 'active'; + } else { + $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_NOT_FAVORITE; + $checked = 'false'; + $class = ''; + } + ?> + + + +
Date: Mon, 14 Apr 2014 18:34:24 -0400 Subject: Revert delete favorite button --- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/layout/aside_flux.phtml | 9 +++++++++ 3 files changed, 11 insertions(+) (limited to 'app/layout') diff --git a/app/i18n/en.php b/app/i18n/en.php index 01f31eca7..b41fb4281 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -27,6 +27,7 @@ return array ( 'subscription_management' => 'Subscriptions management', 'main_stream' => 'Main stream', 'all_feeds' => 'All feeds', + 'favorite_feeds' => 'Favourites (%d)', 'not_read' => '%d unread', 'not_reads' => '%d unread', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 299d4d242..e7d61f313 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -27,6 +27,7 @@ return array ( 'subscription_management' => 'Gestion des abonnements', 'main_stream' => 'Flux principal', 'all_feeds' => 'Tous les flux', + 'favorite_feeds' => 'Favoris (%d)', 'not_read' => '%d non lu', 'not_reads' => '%d non lus', diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 0542e6b66..817dae676 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -28,6 +28,15 @@ +
  • + +
  • + cat_aside as $cat) { $feeds = $cat->feeds (); -- cgit v1.2.3 From f25783ef5de2c4b7f9746eb7ad92fb0b018738b1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 15 Apr 2014 12:16:31 +0200 Subject: Minor syntax changes for: New toggle buttons to filter articles See http://programmers.stackexchange.com/questions/23852/bitwise-or-vs-adding-flags https://github.com/marienfressinaud/FreshRSS/pull/486 https://github.com/marienfressinaud/FreshRSS/issues/376 --- app/Models/EntryDAO.php | 23 +++++++++-------------- app/layout/nav_menu.phtml | 16 ++++++++-------- 2 files changed, 17 insertions(+), 22 deletions(-) (limited to 'app/layout') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 285ad431f..73893a88d 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -406,7 +406,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { return isset ($entries[0]) ? $entries[0] : null; } - private function sqlListWhere($type = 'a', $id = '', $state = null , $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { + private function sqlListWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { if (!$state) { $state = FreshRSS_Entry::STATE_ALL; } @@ -418,8 +418,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { $where .= 'f.priority > 0 '; $joinFeed = true; break; - case 's': - // This is deprecated. The favorite button does not exist anymore + case 's': //Deprecated: use $state instead $where .= 'e1.is_favorite = 1 '; break; case 'c': @@ -443,21 +442,17 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { $where .= 'AND e1.is_read = 0 '; } } - if ($state & FreshRSS_Entry::STATE_READ) { - if (!($state & FreshRSS_Entry::STATE_NOT_READ)) { - $where .= 'AND e1.is_read = 1 '; - } - } - if ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) { - if (!($state & FreshRSS_Entry::STATE_FAVORITE)) { - $where .= 'AND e1.is_favorite = 0 '; - } + elseif ($state & FreshRSS_Entry::STATE_READ) { + $where .= 'AND e1.is_read = 1 '; } if ($state & FreshRSS_Entry::STATE_FAVORITE) { if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) { $where .= 'AND e1.is_favorite = 1 '; } } + elseif ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) { + $where .= 'AND e1.is_favorite = 0 '; + } switch ($order) { case 'DESC': @@ -539,7 +534,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { . ($limit > 0 ? ' LIMIT ' . $limit : '')); //TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/ } - public function listWhere($type = 'a', $id = '', $state = null, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { + public function listWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { list($values, $sql) = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filter, $date_min, $showOlderUnreadsorFavorites, $keepHistoryDefault); $sql = 'SELECT e.id, e.guid, e.title, e.author, UNCOMPRESS(e.content_bin) AS content, e.link, e.date, e.is_read, e.is_favorite, e.id_feed, e.tags ' @@ -555,7 +550,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { return self::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC)); } - public function listIdsWhere($type = 'a', $id = '', $state = null, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { //For API + public function listIdsWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { //For API list($values, $sql) = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filter, $date_min, $showOlderUnreadsorFavorites, $keepHistoryDefault); $stm = $this->bd->prepare($sql); diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 58e561754..9990448ba 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -9,11 +9,11 @@ loginOk) { ?> url; if ($this->state & FreshRSS_Entry::STATE_READ) { - $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_READ; + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_READ; $checked = 'true'; $class = 'active'; } else { - $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_READ; + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_READ; $checked = 'false'; $class = ''; } @@ -28,11 +28,11 @@ state & FreshRSS_Entry::STATE_NOT_READ) { - $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_NOT_READ; + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_READ; $checked = 'true'; $class = 'active'; } else { - $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_NOT_READ; + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_NOT_READ; $checked = 'false'; $class = ''; } @@ -46,11 +46,11 @@ state & FreshRSS_Entry::STATE_FAVORITE) { - $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_FAVORITE; + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_FAVORITE; $checked = 'true'; $class = 'active'; } else { - $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_FAVORITE; + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_FAVORITE; $checked = 'false'; $class = ''; } @@ -64,11 +64,11 @@ state & FreshRSS_Entry::STATE_NOT_FAVORITE) { - $url_state['params']['state'] = $this->state - FreshRSS_Entry::STATE_NOT_FAVORITE; + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_FAVORITE; $checked = 'true'; $class = 'active'; } else { - $url_state['params']['state'] = $this->state + FreshRSS_Entry::STATE_NOT_FAVORITE; + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_NOT_FAVORITE; $checked = 'false'; $class = ''; } -- cgit v1.2.3