From fb32aa4ef1253573115766bc48068ea1a7db4082 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 17 Mar 2013 02:47:54 +0100 Subject: Amélioration affichage notifications + améliorations divers niveau affichage + ajout options pour auto-marquage des articles comme lus (à l'ouverture de l'article / du site / de la page) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/configureController.php | 9 +++++++ app/layout/aside_configure.phtml | 5 +--- app/layout/aside_flux.phtml | 2 ++ app/layout/header.phtml | 4 +-- app/models/RSSConfiguration.php | 27 +++++++++++++++++++ app/views/configure/display.phtml | 20 +++++++++++++- app/views/configure/importExport.phtml | 4 +-- app/views/index/about.phtml | 6 +++++ app/views/javascript/main.phtml | 45 +++++++++++++++++++++++++++----- public/data/Configuration.array.php | 5 ++++ public/theme/base.css | 26 ++++++++++++------ public/theme/fonts/openSans.woff | Bin 0 -> 21956 bytes 12 files changed, 129 insertions(+), 24 deletions(-) create mode 100644 public/theme/fonts/openSans.woff diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index 9a42599a8..e807fb06d 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -112,6 +112,9 @@ class configureController extends ActionController { $sort = Request::param ('sort_order', 'low_to_high'); $old = Request::param ('old_entries', 3); $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'); $this->view->conf->_postsPerPage (intval ($nb)); $this->view->conf->_defaultView ($view); @@ -119,6 +122,11 @@ class configureController extends ActionController { $this->view->conf->_sortOrder ($sort); $this->view->conf->_oldEntries ($old); $this->view->conf->_mailLogin ($mail); + $this->view->conf->_markWhen (array ( + 'article' => $openArticle, + 'site' => $openSite, + 'page' => $openPage, + )); $values = array ( 'posts_per_page' => $this->view->conf->postsPerPage (), @@ -127,6 +135,7 @@ class configureController extends ActionController { 'sort_order' => $this->view->conf->sortOrder (), 'old_entries' => $this->view->conf->oldEntries (), 'mail_login' => $this->view->conf->mailLogin (), + 'mark_when' => $this->view->conf->markWhen (), ); $confDAO = new RSSConfigurationDAO (); diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 3f62ed9e7..ee527d75e 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -2,7 +2,7 @@
  • - Général et affichage + Général et lecture
  • Catégories @@ -10,7 +10,4 @@
  • Raccourcis
  • -
  • - Import / Export OPML -
  • diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 0a68a335a..5bf8c8160 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -51,7 +51,9 @@
  • Filtrer
  • + conf) || is_logged ()) { ?>
  • Gestion
  • +
  • Voir le site
  • diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 351984aa7..852170b64 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -32,11 +32,11 @@ diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index f32a67a3a..270ec2ce1 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -8,6 +8,7 @@ class RSSConfiguration extends Model { private $old_entries; private $shortcuts = array (); private $mail_login = ''; + private $mark_when = array (); public function __construct () { $confDAO = new RSSConfigurationDAO (); @@ -18,6 +19,7 @@ class RSSConfiguration extends Model { $this->_oldEntries ($confDAO->old_entries); $this->_shortcuts ($confDAO->shortcuts); $this->_mailLogin ($confDAO->mail_login); + $this->_markWhen ($confDAO->mark_when); } public function postsPerPage () { @@ -41,6 +43,18 @@ class RSSConfiguration extends Model { public function mailLogin () { return $this->mail_login; } + public function markWhen () { + return $this->mark_when; + } + public function markWhenArticle () { + return $this->mark_when['article']; + } + public function markWhenSite () { + return $this->mark_when['site']; + } + public function markWhenPage () { + return $this->mark_when['page']; + } public function _postsPerPage ($value) { if (is_int (intval ($value))) { @@ -89,6 +103,11 @@ class RSSConfiguration extends Model { $this->mail_login = false; } } + public function _markWhen ($values) { + $this->mark_when['article'] = $values['article']; + $this->mark_when['site'] = $values['site']; + $this->mark_when['page'] = $values['page']; + } } class RSSConfigurationDAO extends Model_array { @@ -107,6 +126,11 @@ class RSSConfigurationDAO extends Model_array { 'prev_page' => 'left', ); public $mail_login = ''; + public $mark_when = array ( + 'article' => 'yes', + 'site' => 'yes', + 'page' => 'no' + ); public function __construct () { parent::__construct (PUBLIC_PATH . '/data/Configuration.array.php'); @@ -132,6 +156,9 @@ class RSSConfigurationDAO extends Model_array { if (isset ($this->array['mail_login'])) { $this->mail_login = $this->array['mail_login']; } + if (isset ($this->array['mark_when'])) { + $this->mark_when = $this->array['mark_when']; + } } public function update ($values) { diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index bf488dbe0..12292c137 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -20,7 +20,7 @@ - Configuration de l'affichage + Configuration de lecture
    @@ -67,6 +67,24 @@
    +
    + +
    + + + +
    +
    +
    diff --git a/app/views/configure/importExport.phtml b/app/views/configure/importExport.phtml index e660274d6..fd274b5b2 100644 --- a/app/views/configure/importExport.phtml +++ b/app/views/configure/importExport.phtml @@ -11,9 +11,7 @@ -partial ('aside_configure'); ?> - -
    +
    Import / export au format OPML
    diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index ab19fe18a..e958807d2 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -10,7 +10,13 @@
    Pour les rapports de bugs
    sur Github ou par mail
    + +
    Licence
    +
    AGPL 3

    FreshRSS est un agrégateur de flux RSS à auto-héberger à l'image de RSSLounge, TinyTinyRSS ou Leed. Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. L'objectif étant d'offrir une alternative sérieuse au futur feu-Google Reader.

    + +

    Crédits

    + Les icônes sont issus du projet GNOME. La police Open Sans utilisée a été créée par Steve Matteson. FreshRSS repose sur Minz, un framework PHP.
    diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index a4e3229bf..d2bde2a42 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -4,7 +4,10 @@ var hide_posts = true; var hide_posts = false; -conf->shortcuts (); ?> +conf->shortcuts (); + $mark = $this->conf->markWhen (); +?> function redirect (url, new_tab) { if (url) { @@ -32,13 +35,22 @@ function slide (new_active, old_active) { offset: new_active.position ().top }); } + + + mark_read(new_active, true); + } -function mark_read (active) { - if (active[0] === undefined) { +var load = false; +function mark_read (active, only_not_read) { + if (active[0] === undefined || ( + only_not_read === true && !active.hasClass("not_read")) || + load === true) { return false; } + load = true; + url = active.find ("a.read").attr ("href"); if (url === undefined) { return false; @@ -57,6 +69,8 @@ function mark_read (active) { } else { active.addClass ("not_read"); } + + load = false; }); } @@ -95,6 +109,13 @@ function init_img () { } function init_posts () { + + if ($(".flux.not_read")[0] != undefined) { + url = $(".nav_menu a.read_all").attr ("href"); + redirect (url, false); + } + + init_img (); if (hide_posts) { @@ -112,7 +133,7 @@ function init_posts () { $(".flux a.read").click (function () { active = $(this).parents (".flux"); - mark_read (active); + mark_read (active, false); return false; }); @@ -127,6 +148,12 @@ function init_posts () { $(".flux .content a").click (function () { $(this).attr ('target', '_blank'); }); + + + $(".flux .link a").click (function () { + mark_read($(this).parent().parent().parent(), true); + }); + } function init_column_categories () { @@ -152,13 +179,13 @@ $(document).ready (function () { shortcut.add("", function () { // on marque comme lu ou non lu active = $(".flux.active"); - mark_read (active); + mark_read (active, false); }, { 'disable_in_input':true }); shortcut.add("shift+", function () { // on marque tout comme lu - url = $("#top a.read_all").attr ("href"); + url = $(".nav_menu a.read_all").attr ("href"); redirect (url, false); }, { 'disable_in_input':true @@ -233,6 +260,12 @@ $(document).ready (function () { shortcut.add("", function () { url = $(".flux.active .link a").attr ("href"); + + $(".flux.active").each (function () { + mark_read($(this), true); + }); + + redirect (url, true); }, { 'disable_in_input':true diff --git a/public/data/Configuration.array.php b/public/data/Configuration.array.php index 2ab67f731..ce5a1a8ee 100644 --- a/public/data/Configuration.array.php +++ b/public/data/Configuration.array.php @@ -15,4 +15,9 @@ return array ( 'next_page' => 'right', 'prev_page' => 'left', ), + 'mark_when' => array ( + 'article' => 'yes', + 'site' => 'yes', + 'page' => 'no', + ), ); diff --git a/public/theme/base.css b/public/theme/base.css index b3295cdd4..1cae71243 100644 --- a/public/theme/base.css +++ b/public/theme/base.css @@ -1,3 +1,10 @@ +/* FONTS */ +@font-face { + font-family: 'OpenSans'; + src: local('fonts/openSans.woff') format('woff'); +} + + * { margin: 0; padding: 0; @@ -682,6 +689,7 @@ input { margin: 0 auto; padding: 10px; line-height: 170%; + font-family: 'OpenSans'; } .content h1, .content h2, .content h3 { margin: 20px 0 5px; @@ -708,12 +716,15 @@ input { } .content q, .content blockquote { display: block; - margin: 0; - padding: 10px 20px; + margin: 5px 0; + padding: 5px 20px; font-style: italic; border-left: 4px solid #ccc; color: #666; } + .content blockquote p { + margin: 0; + } /*** PAGINATION ***/ .pagination { @@ -747,11 +758,10 @@ input { .notification { position: fixed; bottom: 0; - left: 25%; - width: 50%; - height: 50px; - padding: 0 50px; - line-height: 50px; + left: 5%; right: 5%; + min-height: 30px; + padding: 10px; + line-height: 30px; text-align: center; border-radius: 5px 5px 0 0; box-shadow: 0 0 5px #666; @@ -770,7 +780,7 @@ input { width: 16px; height: 16px; float: right; - margin: -10px -60px 0 0; + margin: -20px -20px 0 0; padding: 5px; background: #fff; border-radius: 50px; diff --git a/public/theme/fonts/openSans.woff b/public/theme/fonts/openSans.woff new file mode 100644 index 000000000..55b25f867 Binary files /dev/null and b/public/theme/fonts/openSans.woff differ -- cgit v1.2.3