From c96225df6d6ba3aca0c6786c7f091f02c11d6e8d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 12 May 2013 16:51:45 +0200 Subject: Fix issue #84 : affichage erreur si fichier OPML invalide --- app/models/Exception/FeedException.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models') diff --git a/app/models/Exception/FeedException.php b/app/models/Exception/FeedException.php index bc61e1736..bff297eb9 100644 --- a/app/models/Exception/FeedException.php +++ b/app/models/Exception/FeedException.php @@ -11,3 +11,9 @@ class BadUrlException extends FeedException { parent::__construct ('`' . $url . '` is not a valid URL'); } } + +class OpmlException extends FeedException { + public function __construct ($name_file) { + parent::__construct ('OPML file is invalid'); + } +} -- cgit v1.2.3 From 9e219cbf5014c8f4f52f3ca6722f7a20cdcc13dd Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 12 May 2013 19:21:39 +0200 Subject: Fix issue #70 : lorsqu'on rencontre un problème avec un flux, on l'indique à l'utilisateur (couleur rouge) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 3 +-- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/layout/aside_feed.phtml | 2 +- app/layout/aside_flux.phtml | 2 +- app/models/Feed.php | 30 ++++++++++++++++++++++++++++++ app/views/configure/feed.phtml | 4 ++++ public/theme/freshrss.css | 3 +++ public/theme/global.css | 7 +++++++ 9 files changed, 49 insertions(+), 4 deletions(-) (limited to 'app/models') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 77f1787d0..a41d7a33f 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -159,8 +159,7 @@ class feedController extends ActionController { $feedDAO->updateLastUpdate ($feed->id ()); } catch (FeedException $e) { Log::record ($e->getMessage (), Log::ERROR); - // TODO si on a une erreur ici, il faut mettre - // le flux à jour en BDD (error = 1) (issue #70) + $feedDAO->isInError ($feed->id ()); } // On arrête à 10 flux pour ne pas surcharger le serveur diff --git a/app/i18n/en.php b/app/i18n/en.php index c832a519f..3c3a1fbcc 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -114,6 +114,7 @@ return array ( 'or' => 'or', 'informations' => 'Informations', + 'feed_in_error' => 'This feed has encountered a problem. Please verify that it is always reachable.', 'website_url' => 'Website URL', 'feed_url' => 'Feed URL', 'number_articles' => 'Number of articles', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 165b183eb..d270c9b96 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -114,6 +114,7 @@ return array ( 'or' => 'ou', 'informations' => 'Informations', + 'feed_in_error' => 'Ce flux a rencontré un problème. Veuillez vérifier qu\'il est toujours accessible.', 'website_url' => 'URL du site', 'feed_url' => 'URL du flux', 'number_articles' => 'Nombre d\'articles', diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 158f012d0..4c56d12fc 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -43,7 +43,7 @@ feeds)) { ?> feeds as $feed) { ?> -
  • +
  • name (); ?> diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index d1fe6b759..449ffaff4 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -62,7 +62,7 @@
      get_f == $feed->id ()) { $f_active = true; } ?> -
    • +
    • diff --git a/app/models/Log.php b/app/models/Log.php new file mode 100644 index 000000000..5c280fa7a --- /dev/null +++ b/app/models/Log.php @@ -0,0 +1,47 @@ +date; + } + public function level () { + return $this->level; + } + public function info () { + return $this->information; + } + public function _date ($date) { + $this->date = $date; + } + public function _level ($level) { + $this->level = $level; + } + public function _info ($information) { + $this->information = $information; + } +} + +class LogDAO extends Model_txt { + public function __construct () { + parent::__construct (LOG_PATH . '/application.log', 'r+'); + } + + public function lister () { + $logs = array (); + + $i = 0; + while (($line = $this->readLine ()) !== false) { + $logs[$i] = new Log_Model (); + $logs[$i]->_date (preg_replace ("'\[(.*?)\] \[(.*?)\] --- (.*?)'U", "\\1", $line)); + $logs[$i]->_level (preg_replace ("'\[(.*?)\] \[(.*?)\] --- (.*?)'U", "\\2", $line)); + $logs[$i]->_info (preg_replace ("'\[(.*?)\] \[(.*?)\] --- (.*?)'U", "\\3", $line)); + $i++; + } + + return $logs; + } +} \ No newline at end of file diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml new file mode 100755 index 000000000..0088dabc6 --- /dev/null +++ b/app/views/helpers/logs_pagination.phtml @@ -0,0 +1,47 @@ + + +nbPage > 1) { ?> +
        + +
      • + currentPage > 1) { ?> + « Début + +
      • + + currentPage - 1; ?> +
      • + currentPage > 1) { ?> + ‹ Précédent + +
      • + + currentPage - 2; $i <= $this->currentPage + 2; $i++) { ?> + 0 && $i <= $this->nbPage) { ?> + currentPage) { ?> + +
      • + +
      • + + + + + currentPage + 1; ?> +
      • + currentPage < $this->nbPage) { ?> + Suivant › + +
      • + nbPage; ?> +
      • + currentPage < $this->nbPage) { ?> + Fin » + +
      • +
      + diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml new file mode 100644 index 000000000..c72a84c86 --- /dev/null +++ b/app/views/index/logs.phtml @@ -0,0 +1,21 @@ +
      + + +

      + + logsPaginator->items (); ?> + + +
      + logsPaginator->render ('logs_pagination.phtml', 'page'); ?> + + +
      date ())); ?>info (); ?>
      + + + logsPaginator->render ('logs_pagination.phtml','page'); ?> +
      + +

      + +
      \ No newline at end of file diff --git a/lib/minz/View.php b/lib/minz/View.php index 5c329c159..2bb747aa9 100755 --- a/lib/minz/View.php +++ b/lib/minz/View.php @@ -71,7 +71,7 @@ class View { } else { Log::record ('File doesn\'t exist : `' . $this->view_filename . '`', - Log::WARNING); + Log::NOTICE); } } diff --git a/lib/minz/dao/Model_txt.php b/lib/minz/dao/Model_txt.php index ad15c8b36..c9d5cfe77 100755 --- a/lib/minz/dao/Model_txt.php +++ b/lib/minz/dao/Model_txt.php @@ -27,7 +27,7 @@ class Model_txt { */ public function __construct ($nameFile, $mode = 'a+') { $this->filename = $nameFile; - $this->file = fopen ($this->filename, $mode); + $this->file = @fopen ($this->filename, $mode); if (!$this->file) { throw new FileNotExistException ( diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index f5d4f6a83..4919639af 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -349,14 +349,29 @@ } .pagination .item { display: table-cell; - border-top: 1px solid #aaa; line-height: 40px; } + .pagination .item.pager-current { + font-weight: bold; + font-size: 140%; + } + .pagination .item.pager-first, + .pagination .item.pager-previous, + .pagination .item.pager-next, + .pagination .item.pager-last { + width: 100px; + } .pagination .item a { display: block; color: #333; font-style: italic; } + .pagination:first-child .item { + border-bottom: 1px solid #aaa; + } + .pagination:last-child .item { + border-top: 1px solid #aaa; + } .loading { background: url("loader.gif") center center no-repeat; font-size: 0; @@ -421,6 +436,33 @@ vertical-align: middle; } +.logs { + border: 1px solid #aaa; +} + .logs .log { + padding: 5px 2%; + overflow: auto; + background: #fafafa; + border-bottom: 1px solid #999; + color: #333; + font-size: 90%; + } + .logs .log .date { + display: block; + } + .logs .log.error { + background: #fdd; + color: #844; + } + .logs .log.warning { + background: #ffe; + color: #c95; + } + .logs .log.notice { + background: #f4f4f4; + color: #aaa; + } + @media(max-width: 840px) { .header, .aside .btn-important, -- cgit v1.2.3 From 8cf9ee76504d2eabd969aff1760b4edb59dfb358 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 17:36:42 +0200 Subject: Fix issue #69 : ajout d'une option pour optimiser la BDD + correction bug script actualisation lorsque connexion paramétrée MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actualize_script.php | 1 + app/controllers/entryController.php | 19 +++++++++++++++++++ app/i18n/en.php | 4 ++++ app/i18n/fr.php | 4 ++++ app/models/Entry.php | 6 ++++++ app/views/configure/display.phtml | 11 +++++++++++ 6 files changed, 45 insertions(+) (limited to 'app/models') diff --git a/actualize_script.php b/actualize_script.php index 76bbe2e4f..7f72e419e 100755 --- a/actualize_script.php +++ b/actualize_script.php @@ -24,4 +24,5 @@ require (APP_PATH . '/App_FrontController.php'); $front_controller = new App_FrontController (); $front_controller->init (); +Session::_param('mail', true); // permet de se passer de la phase de connexion $front_controller->run (); diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php index 9d6d9a944..c7e13f471 100755 --- a/app/controllers/entryController.php +++ b/app/controllers/entryController.php @@ -97,4 +97,23 @@ class entryController extends ActionController { } } } + + public function optimizeAction() { + // La table des entrées a tendance à grossir énormément + // Cette action permet d'optimiser cette table permettant de grapiller un peu de place + // Cette fonctionnalité n'est à appeler qu'occasionnellement + $entryDAO = new EntryDAO(); + $entryDAO->optimizeTable(); + + $notif = array ( + 'type' => 'good', + 'content' => Translate::t ('optimization_complete') + ); + Session::_param ('notification', $notif); + + Request::forward(array( + 'c' => 'configure', + 'a' => 'display' + ), true); + } } diff --git a/app/i18n/en.php b/app/i18n/en.php index dbb6b1bfe..e40be045a 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -78,6 +78,8 @@ return array ( 'category_emptied' => 'Category has been emptied', 'feed_deleted' => 'Feed has been deleted', + 'optimization_complete' => 'Optimization complete', + 'your_rss_feeds' => 'Your RSS feeds', 'your_favorites' => 'Your favorites', 'public' => 'Public', @@ -154,6 +156,8 @@ return array ( 'share' => 'Share', 'by_email' => 'By mail', 'on_shaarli' => 'On your Shaarli', + 'optimize_bdd' => 'Optimize database', + 'optimize_todo_sometimes' => 'To do occasionally to reduce size of database', 'article' => 'Article', 'title' => 'Title', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 75a76cc7a..69c7a8ffe 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -78,6 +78,8 @@ return array ( 'category_emptied' => 'La catégorie a été vidée', 'feed_deleted' => 'Le flux a été supprimé', + 'optimization_complete' => 'Optimisation terminée', + 'your_rss_feeds' => 'Vos flux RSS', 'your_favorites' => 'Vos favoris', 'public' => 'Public', @@ -154,6 +156,8 @@ return array ( 'share' => 'Partager', 'by_email' => 'Par mail', 'on_shaarli' => 'Sur votre Shaarli', + 'optimize_bdd' => 'Optimiser la base de données', + 'optimize_todo_sometimes' => 'À faire de temps en temps pour réduire la taille de la BDD', 'article' => 'Article', 'title' => 'Titre', diff --git a/app/models/Entry.php b/app/models/Entry.php index 050407390..6af3178ee 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -509,6 +509,12 @@ class EntryDAO extends Model_pdo { return $res[0]['count']; } + + public function optimizeTable() { + $sql = 'OPTIMIZE TABLE entry'; + $stm = $this->bd->prepare ($sql); + $stm->execute (); + } } class HelperEntry { diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index ea4fecd34..c46a02143 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -121,6 +121,17 @@ + +
      + +
      + + + + +
      +
      +
      -- cgit v1.2.3 From 36316a6d7e81c3e73cad1362194e73a9006b0c72 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 16 Jun 2013 20:28:57 +0200 Subject: Implémentation des vues lecture et globale (issue #67) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/Category.php | 6 +++--- app/views/helpers/global_view.phtml | 32 +++++++++++++++++++++++++++++-- app/views/helpers/normal_view.phtml | 2 +- app/views/helpers/reader_view.phtml | 1 + app/views/javascript/main.phtml | 19 ++++++++++++++++++- public/theme/freshrss.css | 38 +++++++++++++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 7 deletions(-) (limited to 'app/models') diff --git a/app/models/Category.php b/app/models/Category.php index 273559b1e..0c991588d 100755 --- a/app/models/Category.php +++ b/app/models/Category.php @@ -35,10 +35,10 @@ class Category extends Model { public function feeds () { if (is_null ($this->feeds)) { $feedDAO = new FeedDAO (); - return $feedDAO->listByCategory ($this->id ()); - } else { - return $this->feeds; + $this->feeds = $feedDAO->listByCategory ($this->id ()); } + + return $this->feeds; } public function _id ($value) { diff --git a/app/views/helpers/global_view.phtml b/app/views/helpers/global_view.phtml index b666fe620..8e5e363f8 100644 --- a/app/views/helpers/global_view.phtml +++ b/app/views/helpers/global_view.phtml @@ -1,5 +1,33 @@ +partial ('nav_menu'); ?> + +
      partial ('nav_menu'); + foreach ($this->cat_aside as $cat) { + $feeds = $cat->feeds (); + $catNotRead = $cat->nbNotRead (); + if (!empty ($feeds)) { ?> + + +
      \ No newline at end of file diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml index 515084047..2ca365552 100644 --- a/app/views/helpers/normal_view.phtml +++ b/app/views/helpers/normal_view.phtml @@ -7,7 +7,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { $items = $this->entryPaginator->items (); ?> -
      +
      partial ('nav_menu'); if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { $items = $this->entryPaginator->items (); diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 5b325ac8d..e290e02d3 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -9,6 +9,16 @@ var hide_posts = false; $mark = $this->conf->markWhen (); ?> +function is_reader_mode() { + var stream = $("#stream.reader"); + return stream.html() != null; +} + +function is_normal_mode() { + var stream = $("#stream.normal"); + return stream.html() != null; +} + function redirect (url, new_tab) { if (url) { if (new_tab) { @@ -117,7 +127,7 @@ function init_posts () { if (hide_posts) { - $("#stream:not(.reader) .flux:not(.active) .flux_content").hide (); + $(".flux:not(.active) .flux_content").hide (); } $(".flux_header .item.title, .flux_header .item.date").click (function () { @@ -153,6 +163,10 @@ function init_posts () { } function init_column_categories () { + if(!is_normal_mode()) { + return; + } + $(".category").addClass ("stick"); $(".categories .category .btn:first-child").width ("160px"); $(".category").append (""); @@ -268,6 +282,9 @@ function init_shortcuts () { } $(document).ready (function () { + if(is_reader_mode()) { + hide_posts = false; + } init_posts (); init_column_categories (); init_shortcuts (); diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index 60498ad5b..345bd5252 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -298,6 +298,44 @@ color: #666; } +#stream.global { + text-align: center; +} + #stream.global .category { + display: inline-block; + width: 280px; + margin: 20px 10px; + vertical-align: top; + background: #fff; + border: 1px solid #aaa; + border-radius: 5px; + text-align: left; + box-shadow: 0 0 5px #bbb; + } + #stream.global .cat_header { + height: 35px; + padding: 0 10px; + background: #eee; + border-bottom: 1px solid #aaa; + border-radius: 5px 5px 0 0; + line-height: 35px; + font-size: 120%; + } + #stream.global .cat_header a { + color: #333; + text-shadow: 0 -1px 0px #aaa; + } + #stream.global .category .feeds { + max-height: 250px; + margin: 0; + list-style: none; + overflow: auto; + } + #stream.global .category .feeds .item { + padding: 0 10px; + font-size: 90%; + } + .content { max-width: 550px; margin: 0 auto; -- cgit v1.2.3 From 48cfe1571ececb9fae0c361d9147690b04d310e0 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 16 Jun 2013 20:48:56 +0200 Subject: Fix issue #67 : différentes vues implémentées + possibilité de choisir la vue par défaut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/configureController.php | 3 +++ app/controllers/indexController.php | 8 +++++++- app/models/RSSConfiguration.php | 16 ++++++++++++++++ app/views/configure/display.phtml | 5 +++++ app/views/helpers/global_view.phtml | 6 +++++- 5 files changed, 36 insertions(+), 2 deletions(-) (limited to 'app/models') diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index 4cfc1c085..9ed0ad1eb 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -140,6 +140,7 @@ class configureController extends ActionController { if (Request::isPost ()) { $language = Request::param ('language', 'en'); $nb = Request::param ('posts_per_page', 10); + $mode = Request::param ('view_mode', 'normal'); $view = Request::param ('default_view', 'all'); $display = Request::param ('display_posts', 'no'); $lazyload = Request::param ('lazyload', 'yes'); @@ -153,6 +154,7 @@ class configureController extends ActionController { $this->view->conf->_language ($language); $this->view->conf->_postsPerPage (intval ($nb)); + $this->view->conf->_viewMode ($mode); $this->view->conf->_defaultView ($view); $this->view->conf->_displayPosts ($display); $this->view->conf->_lazyload ($lazyload); @@ -169,6 +171,7 @@ class configureController extends ActionController { $values = array ( 'language' => $this->view->conf->language (), 'posts_per_page' => $this->view->conf->postsPerPage (), + 'view_mode' => $this->view->conf->viewMode (), 'default_view' => $this->view->conf->defaultView (), 'display_posts' => $this->view->conf->displayPosts (), 'lazyload' => $this->view->conf->lazyload (), diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 3f10720c2..a5a5501e7 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -6,13 +6,19 @@ class indexController extends ActionController { private $mode = 'all'; public function indexAction () { - if (Request::param ('output') == 'rss') { + $output = Request::param ('output'); + + if ($output == 'rss') { $this->view->_useLayout (false); } else { View::appendScript (Url::display ('/scripts/shortcut.js')); View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main'))); View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'actualize'))); View::appendScript (Url::display ('/scripts/endless_mode.js')); + + if(!$output) { + Request::_param ('output', $this->view->conf->viewMode()); + } } $entryDAO = new EntryDAO (); diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index 6ebc30e8e..b188c0e65 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -7,6 +7,7 @@ class RSSConfiguration extends Model { ); private $language; private $posts_per_page; + private $view_mode; private $default_view; private $display_posts; private $lazyload; @@ -21,6 +22,7 @@ class RSSConfiguration extends Model { $confDAO = new RSSConfigurationDAO (); $this->_language ($confDAO->language); $this->_postsPerPage ($confDAO->posts_per_page); + $this->_viewMode ($confDAO->view_mode); $this->_defaultView ($confDAO->default_view); $this->_displayPosts ($confDAO->display_posts); $this->_lazyload ($confDAO->lazyload); @@ -41,6 +43,9 @@ class RSSConfiguration extends Model { public function postsPerPage () { return $this->posts_per_page; } + public function viewMode () { + return $this->view_mode; + } public function defaultView () { return $this->default_view; } @@ -91,6 +96,13 @@ class RSSConfiguration extends Model { $this->posts_per_page = 10; } } + public function _viewMode ($value) { + if ($value == 'global' || $value == 'reader') { + $this->view_mode = $value; + } else { + $this->view_mode = 'normal'; + } + } public function _defaultView ($value) { if ($value == 'not_read') { $this->default_view = 'not_read'; @@ -154,6 +166,7 @@ class RSSConfiguration extends Model { class RSSConfigurationDAO extends Model_array { public $language = 'en'; public $posts_per_page = 20; + public $view_mode = 'normal'; public $default_view = 'not_read'; public $display_posts = 'no'; public $lazyload = 'yes'; @@ -185,6 +198,9 @@ class RSSConfigurationDAO extends Model_array { if (isset ($this->array['posts_per_page'])) { $this->posts_per_page = $this->array['posts_per_page']; } + if (isset ($this->array['view_mode'])) { + $this->view_mode = $this->array['view_mode']; + } if (isset ($this->array['default_view'])) { $this->default_view = $this->array['default_view']; } diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index c46a02143..8484a7116 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -46,6 +46,11 @@
      +
      +
      + +
      + + + +
      +
      -- cgit v1.2.3 From 7396b3d89724a6280684f0d2099fe17834a0f923 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 23 Jun 2013 17:40:05 +0200 Subject: Fix #77 : articles marqués comme lus au défilement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Possibilité de marquer les articles automatiquement comme lus lors du défilement de la page. Le marquage survient aux 3/4 de l'article visible. Ajout d'une option pour activer / désactiver (défaut) la fonctionnalité et disparition de l'option de marquage au chargement de la page. Ajout de 2 boutons pour marquer comme lu et en favori en bas des articles --- app/controllers/configureController.php | 4 ++-- app/controllers/indexController.php | 2 +- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/models/RSSConfiguration.php | 18 +++++++++++---- app/views/configure/display.phtml | 6 ++--- app/views/helpers/normal_view.phtml | 15 ++++++++++++ app/views/javascript/main.phtml | 41 +++++++++++++++++++++++---------- public/theme/freshrss.css | 14 +++++------ 9 files changed, 73 insertions(+), 31 deletions(-) (limited to 'app/models') diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index 9ed0ad1eb..ce53e1040 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -149,7 +149,7 @@ class configureController extends ActionController { $mail = Request::param ('mail_login', false); $openArticle = Request::param ('mark_open_article', 'no'); $openSite = Request::param ('mark_open_site', 'no'); - $openPage = Request::param ('mark_open_page', 'no'); + $scroll = Request::param ('mark_scroll', 'no'); $urlShaarli = Request::param ('shaarli', ''); $this->view->conf->_language ($language); @@ -164,7 +164,7 @@ class configureController extends ActionController { $this->view->conf->_markWhen (array ( 'article' => $openArticle, 'site' => $openSite, - 'page' => $openPage, + 'scroll' => $scroll, )); $this->view->conf->_urlShaarli ($urlShaarli); diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index a5a5501e7..594d379fb 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -153,7 +153,7 @@ class indexController extends ActionController { ); } - View::prependTitle (Translate::t ('see_logs') . ' - '); + View::prependTitle (Translate::t ('logs') . ' - '); $logs = array(); try { diff --git a/app/i18n/en.php b/app/i18n/en.php index 209bbcd87..648d70caf 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -153,7 +153,7 @@ return array ( 'auto_read_when' => 'Mark automatically as read when', 'article_selected' => 'Article is selected', 'article_open_on_website' => 'Article is opened on its original website', - 'page_loaded' => 'Page is loaded', + 'scroll' => 'Page scrolls', 'your_shaarli' => 'Your Shaarli', 'sharing' => 'Sharing', 'share' => 'Share', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 172f06953..714443f38 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -153,7 +153,7 @@ return array ( 'auto_read_when' => 'Marquer automatiquement comme lu lorsque', 'article_selected' => 'L\'article est sélectionné', 'article_open_on_website' => 'L\'article est ouvert sur le site d\'origine', - 'page_loaded' => 'La page est chargée', + 'scroll' => 'Au défilement de la page', 'your_shaarli' => 'Votre Shaarli', 'sharing' => 'Partage', 'share' => 'Partager', diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index b188c0e65..dde120e4a 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -76,8 +76,8 @@ class RSSConfiguration extends Model { public function markWhenSite () { return $this->mark_when['site']; } - public function markWhenPage () { - return $this->mark_when['page']; + public function markWhenScroll () { + return $this->mark_when['scroll']; } public function urlShaarli () { return $this->url_shaarli; @@ -151,9 +151,19 @@ class RSSConfiguration extends Model { } } public function _markWhen ($values) { + if(!isset($values['article'])) { + $values['article'] = 'yes'; + } + if(!isset($values['site'])) { + $values['site'] = 'yes'; + } + if(!isset($values['scroll'])) { + $values['scroll'] = 'yes'; + } + $this->mark_when['article'] = $values['article']; $this->mark_when['site'] = $values['site']; - $this->mark_when['page'] = $values['page']; + $this->mark_when['scroll'] = $values['scroll']; } public function _urlShaarli ($value) { $this->url_shaarli = ''; @@ -185,7 +195,7 @@ class RSSConfigurationDAO extends Model_array { public $mark_when = array ( 'article' => 'yes', 'site' => 'yes', - 'page' => 'no' + 'scroll' => 'no' ); public $url_shaarli = ''; diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 8484a7116..7da5b2947 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -111,9 +111,9 @@ conf->markWhenSite () == 'yes' ? ' checked="checked"' : ''; ?> /> -
      diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml index eaf1e4276..126fa5a78 100644 --- a/app/views/helpers/normal_view.phtml +++ b/app/views/helpers/normal_view.phtml @@ -64,6 +64,21 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
        + conf) || is_logged ()) { ?> +
      • + isRead ()) { ?> +   + +   + + + isFavorite ()) { ?> +   + +   + +
      • +