From 960f86ba20fdf7320c957141a9983d17c7e521fa Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 2 Nov 2014 10:05:26 -0500 Subject: Add a feature to hide articles when they are read This is a new reading option to hide articles when they are read. The hidding process occurs when the article is left for an other article. This way, even when the article is marked as read on opening, it is hidden only while navigating to an other article. I'm not really happy with the behavior when the "mark while scrolling" option is enabled. Please review. It is missing the i18n since we're not supposed to push them before it exists on i18n.freshrss.org. Or maybe I misunderstood the process. See #476 --- app/views/helpers/javascript_vars.phtml | 1 + 1 file changed, 1 insertion(+) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 8e9141d4e..6424d8d04 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -18,6 +18,7 @@ $url_logout = Minz_Url::display(array( ), 'php'); echo 'var context={', + 'auto_remove_article:', FreshRSS_Context::isAutoRemoveAvailable() ? 'true' : 'false', ',', 'hide_posts:', $hide_posts ? 'false' : 'true', ',', 'display_order:"', Minz_Request::param('order', FreshRSS_Context::$conf->sort_order), '",', 'auto_mark_article:', $mark['article'] ? 'true' : 'false', ',', -- cgit v1.2.3 From a3a77b09e96f66eec4e31e638b58c785cfb369a3 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 22 Nov 2014 08:01:31 -0500 Subject: Add an automatic sticky post configuration Before, when the article while marked as read while scrolling and auto removed after reading, the display was in the middle of the following article. Now, the article is forced to be a sticky article so the user display is forced to be on top of the following article. --- app/Models/Context.php | 18 ++++++++++++++++++ app/views/helpers/javascript_vars.phtml | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/Models/Context.php b/app/Models/Context.php index cbd6a5888..3dc5349ad 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -287,4 +287,22 @@ class FreshRSS_Context { } return true; } + + /** + * Determine if the "sticky post" option is enabled. It can be enable + * by the user when it is selected in the configuration page or by the + * application when the context allows to auto-remove articles when they + * are read. + * + * @return boolean + */ + public static function isStickyPostEnabled() { + if (self::$conf->sticky_post) { + return true; + } + if (self::isAutoRemoveAvailable()) { + return true; + } + return false; + } } diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 6424d8d04..0961ac3fe 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -27,7 +27,7 @@ echo 'var context={', 'auto_load_more:', FreshRSS_Context::$conf->auto_load_more ? 'true' : 'false', ',', 'auto_actualize_feeds:', $auto_actualize ? 'true' : 'false', ',', 'does_lazyload:', FreshRSS_Context::$conf->lazyload ? 'true' : 'false', ',', - 'sticky_post:', FreshRSS_Context::$conf->sticky_post ? 'true' : 'false', ',', + 'sticky_post:', FreshRSS_Context::isStickyPostEnabled() ? 'true' : 'false', ',', 'html5_notif_timeout:', FreshRSS_Context::$conf->html5_notif_timeout, ',', 'auth_type:"', Minz_Configuration::authType(), '",', 'current_user_mail:', $mail ? ('"' . $mail . '"') : 'null', ',', -- cgit v1.2.3 From 8a40a726575947c074216ad9084275e0195f9c30 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 10 Dec 2014 23:16:12 +0100 Subject: Fix i18n for logs, pagination and javascript vars Logs first to avoid annoying message when refreshing log page --- app/Controllers/indexController.php | 2 +- app/i18n/en/gen.php | 26 ++++++++++++++------------ app/i18n/en/index.php | 6 ++++++ app/i18n/fr/gen.php | 26 ++++++++++++++------------ app/i18n/fr/index.php | 6 ++++++ app/views/helpers/javascript_vars.phtml | 8 ++++---- app/views/helpers/logs_pagination.phtml | 8 ++++---- app/views/index/logs.phtml | 8 ++++---- 8 files changed, 53 insertions(+), 37 deletions(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 1cf618f7f..eff47ed58 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -217,7 +217,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { Minz_Error::error(403); } - Minz_View::prependTitle(_t('logs') . ' · '); + Minz_View::prependTitle(_t('index.logs.title') . ' · '); if (Minz_Request::isPost()) { FreshRSS_LogDAO::truncate(); diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index eadc80360..28659cccb 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -2,6 +2,7 @@ return array( 'action' => array( + 'back_to_rss_feeds' => '← Go back to your RSS feeds', 'disable' => 'Disable', 'enable' => 'Enable', 'manage' => 'Manage', @@ -11,6 +12,13 @@ return array( 'login' => 'Login', 'logout' => 'Logout', ), + 'js' => array( + 'category_empty' => 'Empty category', + 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', + 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', + 'notif_body_new_articles' => 'There are \\d new articles to read on FreshRSS.', + 'notif_title_new_articles' => 'FreshRSS: new articles!', + ), 'menu' => array( 'about' => 'About', 'admin' => 'Administration', @@ -29,6 +37,12 @@ return array( 'user_management' => 'Manage users', 'user_profile' => 'Profile', ), + 'pagination' => array( + 'first' => 'First', + 'last' => 'Last', + 'next' => 'Next', + 'previous' => 'Previous', + ), 'title' => array( '_' => 'Title', 'authentication' => 'Authentication', @@ -96,7 +110,6 @@ return array( 'auto_remove_article' => 'Hide articles after reading', 'auto_share' => 'Share', 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', - 'back_to_rss_feeds' => '← Go back to your RSS feeds', 'bad_opml_file' => 'Your OPML file is invalid', 'base_url' => 'Base URL', 'bdd' => 'Database', @@ -125,7 +138,6 @@ return array( 'category_created' => 'Category %s has been created.', 'category_deleted' => 'Category has been deleted.', 'category_emptied' => 'Category has been emptied', - 'category_empty' => 'Empty category', 'category_name_exists' => 'Category name already exists.', 'category_no_id' => 'You must precise the id of the category.', 'category_no_name' => 'Category name cannot be empty.', @@ -136,11 +148,8 @@ return array( 'change_value' => 'You should change this value by any other', 'checks' => 'Checks', 'choose_language' => 'Choose a language for FreshRSS', - 'clear_logs' => 'Clear the logs', 'collapse_article' => 'Collapse', 'configuration_updated' => 'Configuration has been updated', - 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', - 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', 'congratulations' => 'Congratulations!', 'content_width' => 'Content width', 'create' => 'Create', @@ -204,7 +213,6 @@ return array( 'file_to_import' => 'File to import
(OPML, Json or Zip)', 'file_to_import_no_zip' => 'File to import
(OPML or Json)', 'finish_installation' => 'Complete installation', - 'first' => 'First', 'first_article' => 'Skip to the first article', 'fix_errors_before' => 'Fix errors before skip to the next step.', 'focus_search' => 'Access search box', @@ -252,7 +260,6 @@ return array( 'keep_logged_in' => 'Keep me logged in (1 month)', 'language' => 'Language', 'language_defined' => 'Language has been defined.', - 'last' => 'Last', 'last_3_month' => 'Last three months', 'last_6_month' => 'Last six months', 'last_article' => 'Skip to the last article', @@ -267,7 +274,6 @@ return array( 'login_persona_problem' => 'Connection problem with Persona?', 'login_required' => 'Login required:', 'login_with_persona' => 'Login with Persona', - 'logs_empty' => 'Log file is empty', 'mar' => 'mar', 'march' => 'Mar', 'mark_cat_read' => 'Mark category as read', @@ -283,7 +289,6 @@ return array( 'n_feeds_actualized' => '%d feeds have been updated', 'new_article' => 'There are new available articles, click to refresh the page.', 'new_category' => 'New category', - 'next' => 'Next', 'next_article' => 'Skip to the next article', 'next_page' => 'Skip to the next page', 'next_step' => 'Go to the next step', @@ -301,8 +306,6 @@ return array( 'not_reads' => '%d unread', 'not_yet_implemented' => 'Not yet implemented', 'nothing_to_load' => 'There are no more articles', - 'notif_body_new_articles' => 'There are \\d new articles to read on FreshRSS.', - 'notif_title_new_articles' => 'FreshRSS: new articles!', 'nov' => 'nov', 'november' => 'Nov', 'number_articles' => '%d articles', @@ -329,7 +332,6 @@ return array( 'php_is_nok' => 'Your PHP version is %s but FreshRSS requires at least version %s', 'php_is_ok' => 'Your PHP version is %s, which is compatible with FreshRSS', 'prefix' => 'Table prefix', - 'previous' => 'Previous', 'previous_article' => 'Skip to the previous article', 'previous_page' => 'Skip to the previous page', 'print' => 'Print', diff --git a/app/i18n/en/index.php b/app/i18n/en/index.php index 5e05657d1..97df646c4 100644 --- a/app/i18n/en/index.php +++ b/app/i18n/en/index.php @@ -1,6 +1,12 @@ array( + '_' => 'Logs', + 'clear' => 'Clear the logs', + 'empty' => 'Log file is empty', + 'title' => 'Logs', + ), 'menu' => array( 'about' => 'About FreshRSS', 'actualize' => 'Actualize', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index d22e51f2d..3d3878eb1 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -2,6 +2,7 @@ return array( 'action' => array( + 'back_to_rss_feeds' => '← Retour à vos flux RSS', 'disable' => 'Désactiver', 'enable' => 'Activer', 'manage' => 'Gérer', @@ -11,6 +12,13 @@ return array( 'login' => 'Connexion', 'logout' => 'Déconnexion', ), + 'js' => array( + 'category_empty' => 'Catégorie vide', + 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', + 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', + 'notif_body_new_articles' => 'Il y a \\d nouveaux articles à lire sur FreshRSS.', + 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', + ), 'menu' => array( 'about' => 'À propos', 'admin' => 'Administration', @@ -29,6 +37,12 @@ return array( 'user_management' => 'Gestion des utilisateurs', 'user_profile' => 'Profil', ), + 'pagination' => array( + 'first' => 'Début', + 'last' => 'Fin', + 'next' => 'Suivant', + 'previous' => 'Précédent', + ), 'title' => array( '_' => 'Titre', 'authentication' => 'Authentification', @@ -96,7 +110,6 @@ return array( 'auto_remove_article' => 'Cacher les articles après lecture', 'auto_share' => 'Partager', 'auto_share_help' => 'S’il n’y a qu’un mode de partage, celui-ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', - 'back_to_rss_feeds' => '← Retour à vos flux RSS', 'bad_opml_file' => 'Votre fichier OPML n’est pas valide.', 'base_url' => 'Base de l’URL', 'bdd' => 'Base de données', @@ -125,7 +138,6 @@ return array( 'category_created' => 'La catégorie %s a été créée.', 'category_deleted' => 'La catégorie a été supprimée.', 'category_emptied' => 'La catégorie a été vidée.', - 'category_empty' => 'Catégorie vide', 'category_name_exists' => 'Une catégorie possède déjà ce nom.', 'category_no_id' => 'Vous devez préciser l’id de la catégorie.', 'category_no_name' => 'Vous devez préciser un nom pour la catégorie.', @@ -136,11 +148,8 @@ return array( 'change_value' => 'Vous devriez changer cette valeur par n’importe quelle autre', 'checks' => 'Vérifications', 'choose_language' => 'Choisissez la langue pour FreshRSS', - 'clear_logs' => 'Effacer les logs', 'collapse_article' => 'Refermer', 'configuration_updated' => 'La configuration a été mise à jour.', - 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', - 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', 'congratulations' => 'Félicitations !', 'content_width' => 'Largeur du contenu', 'create' => 'Créer', @@ -204,7 +213,6 @@ return array( 'file_to_import' => 'Fichier à importer
(OPML, Json ou Zip)', 'file_to_import_no_zip' => 'Fichier à importer
(OPML ou Json)', 'finish_installation' => 'Terminer l’installation', - 'first' => 'Début', 'first_article' => 'Passer au premier article', 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', 'focus_search' => 'Accéder à la recherche', @@ -252,7 +260,6 @@ return array( 'keep_logged_in' => 'Rester connecté (1 mois)', 'language' => 'Langue', 'language_defined' => 'La langue a bien été définie.', - 'last' => 'Fin', 'last_3_month' => 'Depuis les trois derniers mois', 'last_6_month' => 'Depuis les six derniers mois', 'last_article' => 'Passer au dernier article', @@ -267,7 +274,6 @@ return array( 'login_persona_problem' => 'Problème de connexion à Persona ?', 'login_required' => 'Accès protégé par mot de passe :', 'login_with_persona' => 'Connexion avec Persona', - 'logs_empty' => 'Les logs sont vides.', 'mar' => 'mar.', 'march' => 'mars', 'mark_cat_read' => 'Marquer la catégorie comme lue', @@ -283,7 +289,6 @@ return array( 'n_feeds_actualized' => '%d flux ont été mis à jour.', 'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.', 'new_category' => 'Nouvelle catégorie', - 'next' => 'Suivant', 'next_article' => 'Passer à l’article suivant', 'next_page' => 'Passer à la page suivante', 'next_step' => 'Passer à l’étape suivante', @@ -301,8 +306,6 @@ return array( 'not_reads' => '%d non lus', 'not_yet_implemented' => 'Pas encore implémenté', 'nothing_to_load' => 'Fin des articles', - 'notif_body_new_articles' => 'Il y a \\d nouveaux articles à lire sur FreshRSS.', - 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', 'nov' => 'nov.', 'november' => 'novembre', 'number_articles' => '%d articles', @@ -329,7 +332,6 @@ return array( 'php_is_nok' => 'Votre version de PHP est la %s mais FreshRSS requiert au moins la version %s', 'php_is_ok' => 'Votre version de PHP est la %s, qui est compatible avec FreshRSS', 'prefix' => 'Préfixe des tables', - 'previous' => 'Précédent', 'previous_article' => 'Passer à l’article précédent', 'previous_page' => 'Passer à la page précédente', 'print' => 'Imprimer', diff --git a/app/i18n/fr/index.php b/app/i18n/fr/index.php index 3fea1b879..4b8c85033 100644 --- a/app/i18n/fr/index.php +++ b/app/i18n/fr/index.php @@ -1,6 +1,12 @@ array( + '_' => 'Logs', + 'clear' => 'Effacer les logs', + 'empty' => 'Les logs sont vides.', + 'title' => 'Logs', + ), 'menu' => array( 'about' => 'À propos de FreshRSS', 'actualize' => 'Actualiser', diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 0961ac3fe..6577e0109 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -59,10 +59,10 @@ echo 'url={', "},\n"; echo 'i18n={', - 'confirmation_default:"', _t('confirm_action'), '",', - 'notif_title_articles:"', _t('notif_title_new_articles'), '",', - 'notif_body_articles:"', _t('notif_body_new_articles'), '",', - 'category_empty:"', _t('category_empty'), '"', + 'confirmation_default:"', _t('gen.js.confirm_action'), '",', + 'notif_title_articles:"', _t('gen.js.notif_title_new_articles'), '",', + 'notif_body_articles:"', _t('gen.js.notif_body_new_articles'), '",', + 'category_empty:"', _t('gen.js.category_empty'), '"', "},\n"; echo 'icons={', diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index ad46279c7..58b3c68f4 100755 --- a/app/views/helpers/logs_pagination.phtml +++ b/app/views/helpers/logs_pagination.phtml @@ -9,14 +9,14 @@
  • currentPage > 1) { ?> - « + «
  • currentPage - 1; ?>
  • currentPage > 1) { ?> - +
  • @@ -34,13 +34,13 @@ currentPage + 1; ?>
  • currentPage < $this->nbPage) { ?> - +
  • nbPage; ?>
  • currentPage < $this->nbPage) { ?> - » + »
  • diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml index 101692daf..0262325f5 100644 --- a/app/views/index/logs.phtml +++ b/app/views/index/logs.phtml @@ -1,10 +1,10 @@
    - + -

    +

    - +

    logsPaginator->items(); ?> @@ -20,6 +20,6 @@ logsPaginator->render('logs_pagination.phtml','page'); ?>
    -

    +

    -- cgit v1.2.3