From c88f57c0360eca7f8f152d35e54872bf845e0ca0 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 12 May 2013 16:11:37 +0200 Subject: Fix issue #83 : affichage d'un message d'erreur si la connexion à la base de données échoue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/i18n/fr.php | 1 + 1 file changed, 1 insertion(+) (limited to 'app/i18n/fr.php') diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 33f094c21..74dfaf8be 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -259,6 +259,7 @@ return array ( 'do_not_change_if_doubt' => 'Laissez tel quel dans le doute', 'bdd_conf_is_ok' => 'La configuration de la base de données a été enregistrée.', + 'bdd_conf_is_ko' => 'Vérifiez les informations d\'accès à la base de données.', 'host' => 'Hôte', 'username' => 'Nom utilisateur', 'password' => 'Mot de passe', -- cgit v1.2.3 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/controllers/configureController.php | 33 +++++++++++++++++++++++++-------- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/models/Exception/FeedException.php | 6 ++++++ lib/lib_rss.php | 2 +- 5 files changed, 34 insertions(+), 9 deletions(-) (limited to 'app/i18n/fr.php') diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index 2f56da177..8500a4a04 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -218,14 +218,31 @@ class configureController extends ActionController { } elseif ($this->view->req == 'import' && Request::isPost ()) { if ($_FILES['file']['error'] == 0) { // on parse le fichier OPML pour récupérer les catégories et les flux associés - list ($categories, $feeds) = opml_import (file_get_contents ($_FILES['file']['tmp_name'])); - - // On redirige vers le controller feed qui va se charger d'insérer les flux en BDD - // les flux sont mis au préalable dans des variables de Request - Request::_param ('q', 'null'); - Request::_param ('categories', $categories); - Request::_param ('feeds', $feeds); - Request::forward (array ('c' => 'feed', 'a' => 'massiveImport')); + try { + list ($categories, $feeds) = opml_import ( + file_get_contents ($_FILES['file']['tmp_name']) + ); + + // On redirige vers le controller feed qui va se charger d'insérer les flux en BDD + // les flux sont mis au préalable dans des variables de Request + Request::_param ('q', 'null'); + Request::_param ('categories', $categories); + Request::_param ('feeds', $feeds); + Request::forward (array ('c' => 'feed', 'a' => 'massiveImport')); + } catch (OpmlException $e) { + Log::record ($e->getMessage (), Log::ERROR); + + $notif = array ( + 'type' => 'bad', + 'content' => Translate::t ('bad_opml_file') + ); + Session::_param ('notification', $notif); + + Request::forward (array ( + 'c' => 'configure', + 'a' => 'importExport' + ), true); + } } } diff --git a/app/i18n/en.php b/app/i18n/en.php index 52a1674ba..c832a519f 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -58,6 +58,7 @@ return array ( 'rss_feed_management' => 'RSS feeds management', 'configuration_updated' => 'Configuration has been updated', 'general_and_reading_management'=> 'General and reading management', + 'bad_opml_file' => 'Your OPML file is invalid', 'shortcuts_updated' => 'Shortcuts have been updated', 'shortcuts_management' => 'Shortcuts management', 'feeds_marked_read' => 'Feeds have been marked as read', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 74dfaf8be..165b183eb 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -58,6 +58,7 @@ return array ( 'rss_feed_management' => 'Gestion des flux RSS', 'configuration_updated' => 'La configuration a été mise à jour', 'general_and_reading_management'=> 'Gestion générale et affichage', + 'bad_opml_file' => 'Votre fichier OPML n\'est pas valide', 'shortcuts_updated' => 'Les raccourcis ont été mis à jour', 'shortcuts_management' => 'Gestion des raccourcis', 'feeds_marked_read' => 'Les flux ont été marqués comme lu', 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'); + } +} diff --git a/lib/lib_rss.php b/lib/lib_rss.php index c574cd3fd..77d3ac2db 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -65,7 +65,7 @@ function opml_import ($xml) { $opml = @simplexml_load_string ($xml); if (!$opml) { - return array (array (), array ()); + throw new OpmlException (); } $categories = array (); -- 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/i18n/fr.php') 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/views/index/index.phtml b/app/views/index/index.phtml index 7037b2405..1a07cdb46 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -66,7 +66,13 @@ if ($output == 'rss') {

      title (); ?>

      author (); ?> ' . Translate::t ('by_author', $author) . '
      ' : ''; ?> - content ()); ?> + conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?>
        diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 443f62c31..9596b1647 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -125,8 +125,9 @@ function init_posts () { init_img (); - // TODO rendre optionnel + conf->lazyload() == 'yes') { ?> $(".flux .content img").lazyload(); + if (hide_posts) { $(".flux:not(.active) .flux_content").hide (); -- cgit v1.2.3 From 3ba63a170ec385910f2e743c648dd977c5eee135 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 13:25:48 +0200 Subject: Suppression des 'notes' sur les articles, pas utile --- app/controllers/entryController.php | 71 ------------------------------------- app/i18n/en.php | 4 --- app/i18n/fr.php | 4 --- app/views/entry/note.phtml | 65 --------------------------------- app/views/index/index.phtml | 7 ---- 5 files changed, 151 deletions(-) delete mode 100644 app/views/entry/note.phtml (limited to 'app/i18n/fr.php') diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php index 35f3150ea..9d6d9a944 100755 --- a/app/controllers/entryController.php +++ b/app/controllers/entryController.php @@ -97,75 +97,4 @@ class entryController extends ActionController { } } } - - public function noteAction () { - View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main'))); - - $not_found = false; - $entryDAO = new EntryDAO (); - $catDAO = new CategoryDAO (); - - $id = Request::param ('id'); - if ($id) { - $entry = $entryDAO->searchById ($id); - - if ($entry) { - $feed = $entry->feed (true); - - if (Request::isPost ()) { - $note = htmlspecialchars (Request::param ('note', '')); - $public = Request::param ('public', 'no'); - if ($public == 'yes') { - $public = true; - } else { - $public = false; - } - - $values = array ( - 'annotation' => $note, - 'is_public' => $public, - 'lastUpdate' => time () - ); - - if ($entryDAO->updateEntry ($id, $values)) { - $notif = array ( - 'type' => 'good', - 'content' => Translate::t ('updated') - ); - } else { - $notif = array ( - 'type' => 'bad', - 'content' => Translate::t ('error_occured') - ); - } - Session::_param ('notification', $notif); - Request::forward (array ( - 'c' => 'entry', - 'a' => 'note', - 'params' => array ( - 'id' => $id - ) - ), true); - } - } else { - $not_found = true; - } - } else { - $not_found = true; - } - - if ($not_found) { - Error::error ( - 404, - array ('error' => array (Translate::t ('page_not_found'))) - ); - } else { - $this->view->entry = $entry; - $this->view->cat_aside = $catDAO->listCategories (); - $this->view->nb_favorites = $entryDAO->countFavorites (); - $this->view->nb_total = $entryDAO->count (); - $this->view->get_c = $feed->category (); - $this->view->get_f = $feed->id (); - } - } } diff --git a/app/i18n/en.php b/app/i18n/en.php index 30bed791f..0d0ab5269 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -155,10 +155,6 @@ return array ( 'by_email' => 'By mail', 'on_shaarli' => 'On your Shaarli', - 'note' => 'Note', - 'add_note' => 'Add a note', - 'update_note' => 'Update your note', - 'ask_public_article' => 'Public article?', 'article' => 'Article', 'title' => 'Title', 'author' => 'Author', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 87b87945f..97e36f923 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -155,10 +155,6 @@ return array ( 'by_email' => 'Par mail', 'on_shaarli' => 'Sur votre Shaarli', - 'note' => 'Note', - 'add_note' => 'Ajouter une note', - 'update_note' => 'Modifier votre note', - 'ask_public_article' => 'Article public ?', 'article' => 'Article', 'title' => 'Titre', 'author' => 'Auteur', diff --git a/app/views/entry/note.phtml b/app/views/entry/note.phtml deleted file mode 100644 index 061060106..000000000 --- a/app/views/entry/note.phtml +++ /dev/null @@ -1,65 +0,0 @@ -partial ('aside_flux'); ?> - -
        - - - - - -
        - -
        - -
        -
        -
        - -
        - -
        -
        - -
        -
        - - -
        -
        - - - - - - entry->author (); - if ($author) { ?> -
        - -
        - -
        -
        - - -
        - -
        - entry->date (); ?> -
        -
        - -
        - -
        - entry->content (); ?> -
        -
        - -
        diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 1a07cdb46..30df591eb 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -76,13 +76,6 @@ if ($output == 'rss') {
          -
        • - notes () != '') { ?> - - - - -
        • +
        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/i18n/fr.php') 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 d3078fb726639eed478a2a449b0a9043af04a756 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 19:42:02 +0200 Subject: Mise en place de la structure pour les différentes vues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/i18n/en.php | 3 + app/i18n/fr.php | 3 + app/layout/nav_menu.phtml | 67 +++++++++++++------ app/views/helpers/global_view.phtml | 5 ++ app/views/helpers/normal_view.phtml | 114 ++++++++++++++++++++++++++++++++ app/views/helpers/reader_view.phtml | 5 ++ app/views/helpers/rss.phtml | 30 --------- app/views/helpers/rss_view.phtml | 30 +++++++++ app/views/index/index.phtml | 128 ++---------------------------------- lib/lib_text.php | 8 +++ public/theme/freshrss.css | 7 +- 11 files changed, 228 insertions(+), 172 deletions(-) create mode 100644 app/views/helpers/global_view.phtml create mode 100644 app/views/helpers/normal_view.phtml create mode 100644 app/views/helpers/reader_view.phtml delete mode 100755 app/views/helpers/rss.phtml create mode 100755 app/views/helpers/rss_view.phtml (limited to 'app/i18n/fr.php') diff --git a/app/i18n/en.php b/app/i18n/en.php index e40be045a..4dbfde715 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -37,6 +37,9 @@ return array ( 'before_one_day' => 'Before one day', 'before_one_week' => 'Before one week', 'display' => 'Display', + 'normal_view' => 'Normal view', + 'reader_view' => 'Reading view', + 'global_view' => 'Global view', 'show_all_articles' => 'Show all articles', 'show_not_reads' => 'Show only unread', 'older_first' => 'Oldest first', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 69c7a8ffe..7a58b984c 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -37,6 +37,9 @@ return array ( 'before_one_day' => 'Antérieurs à 1 jour', 'before_one_week' => 'Antérieurs à 1 semaine', 'display' => 'Affichage', + 'normal_view' => 'Vue normale', + 'reader_view' => 'Vue lecture', + 'global_view' => 'Vue globale', 'show_all_articles' => 'Afficher tous les articles', 'show_not_reads' => 'Afficher les non lus', 'older_first' => 'Plus anciens en premier', diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 3411f344b..dbe597985 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -59,43 +59,72 @@ diff --git a/app/views/helpers/global_view.phtml b/app/views/helpers/global_view.phtml new file mode 100644 index 000000000..b666fe620 --- /dev/null +++ b/app/views/helpers/global_view.phtml @@ -0,0 +1,5 @@ +partial ('nav_menu'); +?> + +Non implémenté \ No newline at end of file diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml new file mode 100644 index 000000000..515084047 --- /dev/null +++ b/app/views/helpers/normal_view.phtml @@ -0,0 +1,114 @@ +partial ('aside_flux'); +$this->partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); +?> + +
        + + + + isDay (Days::TODAY)) { ?> +
        -
        + + isDay (Days::YESTERDAY)) { ?> +
        -
        + + isDay (Days::BEFORE_YESTERDAY)) { ?> +
        + + +
        +
          + conf) || is_logged ()) { ?> +
        • + isRead ()) { ?> +   + +   + + + isFavorite ()) { ?> +   + +   + +
        • + + feed (true); ?> +
        • name (); ?>
        • +
        • title (); ?>
        • +
        • date (); ?>
        • + +
        + +
        +
        +

        title (); ?>

        + author (); ?> + ' . Translate::t ('by_author', $author) . '
        ' : ''; ?> + conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> +
        + +
          +
        • + +
        • + tags(); ?> + +
        • + +
        • + +
        +
        +
        + + + entryPaginator->render ('pagination.phtml', 'next'); ?> +
        + + +
        + +
        + \ No newline at end of file diff --git a/app/views/helpers/reader_view.phtml b/app/views/helpers/reader_view.phtml new file mode 100644 index 000000000..b666fe620 --- /dev/null +++ b/app/views/helpers/reader_view.phtml @@ -0,0 +1,5 @@ +partial ('nav_menu'); +?> + +Non implémenté \ No newline at end of file diff --git a/app/views/helpers/rss.phtml b/app/views/helpers/rss.phtml deleted file mode 100755 index 83de6de2e..000000000 --- a/app/views/helpers/rss.phtml +++ /dev/null @@ -1,30 +0,0 @@ -'; ?> - - - <?php echo View::title(); ?> - - - - GMT - -entryPaginator->items (); -foreach ($items as $item) { -?> - - <?php echo htmlspecialchars(html_entity_decode($item->title ())); ?> - link (); ?> - author (); ?> - - - - content (); -?>]]> - date (true)); ?> - id (); ?> - - - - - diff --git a/app/views/helpers/rss_view.phtml b/app/views/helpers/rss_view.phtml new file mode 100755 index 000000000..83de6de2e --- /dev/null +++ b/app/views/helpers/rss_view.phtml @@ -0,0 +1,30 @@ +'; ?> + + + <?php echo View::title(); ?> + + + + GMT + +entryPaginator->items (); +foreach ($items as $item) { +?> + + <?php echo htmlspecialchars(html_entity_decode($item->title ())); ?> + link (); ?> + author (); ?> + + + + content (); +?>]]> + date (true)); ?> + id (); ?> + + + + + diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 30df591eb..46ff33b3a 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,127 +1,13 @@ /i', - '', - $content - ); -} $output = Request::param ('output', 'normal'); if ($output == 'rss') { - $this->renderHelper ('rss'); + $this->renderHelper ('rss_view'); +} elseif($output == 'reader') { + $this->renderHelper ('reader_view'); +} elseif($output == 'global') { + $this->renderHelper ('global_view'); } else { - $this->partial ('aside_flux'); - $this->partial ('nav_menu'); - - if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); -?> - -
        - - - - isDay (Days::TODAY)) { ?> -
        -
        - - isDay (Days::YESTERDAY)) { ?> -
        -
        - - isDay (Days::BEFORE_YESTERDAY)) { ?> -
        - - -
        -
          - conf) || is_logged ()) { ?> -
        • - isRead ()) { ?> -   - -   - - - isFavorite ()) { ?> -   - -   - -
        • - - feed (true); ?> -
        • name (); ?>
        • -
        • title (); ?>
        • -
        • date (); ?>
        • - -
        - -
        -
        -

        title (); ?>

        - author (); ?> - ' . Translate::t ('by_author', $author) . '
        ' : ''; ?> - conf->lazyload() == 'yes') { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> -
        - -
          -
        • - -
        • - tags(); ?> - -
        • - -
        • - -
        -
        -
        - - - entryPaginator->render ('pagination.phtml', 'next'); ?> -
        - - -
        - -
        - - + $this->renderHelper ('normal_view'); +} \ No newline at end of file diff --git a/lib/lib_text.php b/lib/lib_text.php index 6e8f7b2bf..9792e191e 100644 --- a/lib/lib_text.php +++ b/lib/lib_text.php @@ -86,3 +86,11 @@ function parse_tags ($desc) { return $desc_parse; } + +function lazyimg($content) { + return preg_replace( + '//i', + '', + $content + ); +} \ No newline at end of file diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index 636f9e09d..26bb21d8f 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -245,11 +245,10 @@ line-height: 40px; } .flux_header .item.website .favicon { - padding: 12px; + padding: 5px; } .flux_header .item.website a { display: block; - padding: 0; height: 40px; } .flux_header .item.title { @@ -293,6 +292,7 @@ padding: 20px 10px; line-height: 170%; font-family: 'OpenSans'; + word-wrap: break-word; } .content .title { margin: 0 0 5px; @@ -480,6 +480,9 @@ width: 40px; text-align: center; } + .flux_header .item.website .favicon { + padding: 12px; + } .content { font-size: 120%; -- cgit v1.2.3 From 32499c0b3e519ef2fc255f5990448195256476ac Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 23 Jun 2013 12:45:27 +0200 Subject: Fix issue #91 : flux en erreur repasse normal Lorsqu'on actualise un flux en erreur, si celui-ci est de nouveau accessible, il repasse en normal Ajout d'un bouton pour actualiser les flux sur la page de gestion --- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/models/Feed.php | 2 +- app/views/configure/feed.phtml | 8 ++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) (limited to 'app/i18n/fr.php') diff --git a/app/i18n/en.php b/app/i18n/en.php index 4dbfde715..209bbcd87 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -119,7 +119,7 @@ return array ( 'or' => 'or', 'informations' => 'Informations', - 'feed_in_error' => 'This feed has encountered a problem. Please verify that it is always reachable.', + 'feed_in_error' => 'This feed has encountered a problem. Please verify that it is always reachable then actualize it.', '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 7a58b984c..172f06953 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -119,7 +119,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.', + 'feed_in_error' => 'Ce flux a rencontré un problème. Veuillez vérifier qu\'il est toujours accessible puis actualisez-le.', 'website_url' => 'URL du site', 'feed_url' => 'URL du flux', 'number_articles' => 'Nombre d\'articles', diff --git a/app/models/Feed.php b/app/models/Feed.php index 15568d06a..4c6a3d229 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -292,7 +292,7 @@ class FeedDAO extends Model_pdo { } public function updateLastUpdate ($id) { - $sql = 'UPDATE feed SET lastUpdate=? WHERE id=?'; + $sql = 'UPDATE feed SET lastUpdate=?, error=0 WHERE id=?'; $stm = $this->bd->prepare ($sql); $values = array ( diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index 650da5641..ec2ff3bdb 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -31,6 +31,14 @@ flux->url (); ?> +
        + +
        + + + +
        +
        -- 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/i18n/fr.php') 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 ()) { ?> +   + +   + +
        • +