From b8f53b052592d3729bdc88936bad5f4e2da78dfe Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 5 Jun 2014 22:26:18 +0200 Subject: Add an option to choose content width - 4 options: thin, medium, large and no limit - Thin is by default --- app/Controllers/configureController.php | 1 + app/Models/Configuration.php | 10 ++++++++++ app/i18n/en.php | 5 +++++ app/i18n/fr.php | 5 +++++ app/views/configure/display.phtml | 21 +++++++++++++++++++++ app/views/helpers/view/normal_view.phtml | 4 +++- app/views/helpers/view/reader_view.phtml | 3 ++- 7 files changed, 47 insertions(+), 2 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index df5212041..a117e0f9c 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -145,6 +145,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $themeId = FreshRSS_Themes::defaultTheme; } $this->view->conf->_theme($themeId); + $this->view->conf->_content_width(Minz_Request::param('content_width', 'thin')); $this->view->conf->_topline_read(Minz_Request::param('topline_read', false)); $this->view->conf->_topline_favorite(Minz_Request::param('topline_favorite', false)); $this->view->conf->_topline_date(Minz_Request::param('topline_date', false)); diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 8d3e69a1c..0d6666297 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -28,6 +28,7 @@ class FreshRSS_Configuration { 'reception' => false, ), 'theme' => 'Origine', + 'content_width' => 'thin', 'shortcuts' => array( 'mark_read' => 'r', 'mark_favorite' => 'f', @@ -221,6 +222,15 @@ class FreshRSS_Configuration { public function _theme($value) { $this->data['theme'] = $value; } + public function _content_width($value) { + if ($value === 'medium' || + $value === 'large' || + $value === 'no_limit') { + $this->data['content_width'] = $value; + } else { + $this->data['content_width'] = 'thin'; + } + } public function _token($value) { $this->data['token'] = $value; } diff --git a/app/i18n/en.php b/app/i18n/en.php index 21d37f475..a3c1dfeb7 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -240,6 +240,11 @@ return array ( 'optimize_bdd' => 'Optimize database', 'optimize_todo_sometimes' => 'To do occasionally to reduce the size of the database', 'theme' => 'Theme', + 'content_width' => 'Content width', + 'width_thin' => 'Thin', + 'width_medium' => 'Medium', + 'width_large' => 'Large', + 'width_no_limit' => 'No limit', 'more_information' => 'More information', 'activate_sharing' => 'Activate sharing', 'shaarli' => 'Shaarli', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index f42115fcd..4acf5b397 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -240,6 +240,11 @@ return array ( 'optimize_bdd' => 'Optimiser la base de données', 'optimize_todo_sometimes' => 'À faire de temps en temps pour réduire la taille de la BDD', 'theme' => 'Thème', + 'content_width' => 'Largeur du contenu', + 'width_thin' => 'Fine', + 'width_medium' => 'Moyenne', + 'width_large' => 'Large', + 'width_no_limit' => 'Pas de limite', 'more_information' => 'Plus d’informations', 'activate_sharing' => 'Activer le partage', 'shaarli' => 'Shaarli', diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 5a94376ad..955fc6747 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -35,6 +35,27 @@ + conf->content_width; ?> +
+ +
+ +
+
+
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index b5cdd3039..6f172d579 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -24,6 +24,8 @@ if (!empty($this->entries)) { $bottomline_tags = $this->conf->bottomline_tags; $bottomline_date = $this->conf->bottomline_date; $bottomline_link = $this->conf->bottomline_link; + + $content_width = $this->conf->content_width; ?>
entries)) {
-
+

title (); ?>

author (); diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index bda96e86d..e37c78cb4 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -3,6 +3,7 @@ $this->partial ('nav_menu'); if (!empty($this->entries)) { $lazyload = $this->conf->lazyload; + $content_width = $this->conf->content_width; ?>
@@ -10,7 +11,7 @@ if (!empty($this->entries)) {
-
+
cat_aside, $item->feed ()); //We most likely already have the feed object in cache if (empty($feed)) $feed = $item->feed (true); -- cgit v1.2.3