diff options
| author | 2023-01-09 10:40:38 +0100 | |
|---|---|---|
| committer | 2023-01-09 10:40:38 +0100 | |
| commit | b5a418ec1618cb1a058aee3dd47baa63562c9194 (patch) | |
| tree | 4338c14056ffd1df9eb673f9eb97a77ae12267ab /app | |
| parent | bbe3eb8f41ca9c25d1619cda9609392ffc803146 (diff) | |
Added: Dark mode for Origine +Origine compact themes (#4843)
* first draft
* fix: theme slider: properties box
* improved colors
* option to enable/disable dark mode
* fixes
* Update app/i18n/fr/conf.php
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* i18n english improved
* fix dark background color for favorites + hover colors
* select list: no, auto
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app')
| -rwxr-xr-x | app/Controllers/configureController.php | 2 | ||||
| -rw-r--r-- | app/Models/ConfigurationSetter.php | 7 | ||||
| -rw-r--r-- | app/Models/UserConfiguration.php | 1 | ||||
| -rw-r--r-- | app/i18n/cz/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/de/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/el/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/en-us/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/en/conf.php | 1 | ||||
| -rwxr-xr-x | app/i18n/es/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/fr/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/he/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/id/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/it/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/ja/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/ko/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/nl/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/oc/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/pl/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/pt-br/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/ru/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/sk/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/tr/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/zh-cn/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/zh-tw/conf.php | 1 | ||||
| -rw-r--r-- | app/layout/layout.phtml | 2 | ||||
| -rw-r--r-- | app/views/configure/display.phtml | 10 |
26 files changed, 42 insertions, 1 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 926ab2272..710a927d6 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -25,6 +25,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { * The options available on the page are: * - language (default: en) * - theme (default: Origin) + * - darkMode (default: no) * - content width (default: thin) * - display of read action in header * - display of favorite action in header @@ -44,6 +45,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::$user_conf->language = Minz_Request::param('language', 'en'); FreshRSS_Context::$user_conf->timezone = Minz_Request::param('timezone', ''); FreshRSS_Context::$user_conf->theme = Minz_Request::param('theme', FreshRSS_Themes::$defaultTheme); + FreshRSS_Context::$user_conf->darkMode = Minz_Request::param('darkMode', 'no'); FreshRSS_Context::$user_conf->content_width = Minz_Request::param('content_width', 'thin'); FreshRSS_Context::$user_conf->topline_read = Minz_Request::param('topline_read', false); FreshRSS_Context::$user_conf->topline_favorite = Minz_Request::param('topline_favorite', false); diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index c822bcf4d..258c2ad58 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -234,6 +234,13 @@ class FreshRSS_ConfigurationSetter { $data['sticky_post'] = $this->handleBool($value); } + private function _darkMode(&$data, $value) { + if (!in_array($value, [ 'no', 'auto'], true)) { + $value = 'no'; + } + $data['darkMode'] = $value; + } + private function _bottomline_date(&$data, $value) { $data['bottomline_date'] = $this->handleBool($value); } diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php index 157737cb8..53b12cc2e 100644 --- a/app/Models/UserConfiguration.php +++ b/app/Models/UserConfiguration.php @@ -53,6 +53,7 @@ * @property bool $sides_close_article * @property bool $sticky_post * @property string $theme + * @property string $darkMode * @property string $token * @property bool $topline_date * @property bool $topline_display_authors diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php index 7b0b85465..9d646be36 100644 --- a/app/i18n/cz/conf.php +++ b/app/i18n/cz/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Zobrazení', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Spodní řádek', 'display_authors' => 'Autoři', diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index 52826353b..33604b618 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Anzeige', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Fußzeile', 'display_authors' => 'Autoren', diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.php index a068282ea..e2629bd54 100644 --- a/app/i18n/el/conf.php +++ b/app/i18n/el/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Display', // TODO + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Bottom line', // TODO 'display_authors' => 'Authors', // TODO diff --git a/app/i18n/en-us/conf.php b/app/i18n/en-us/conf.php index 8a572def3..760cbf37f 100644 --- a/app/i18n/en-us/conf.php +++ b/app/i18n/en-us/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Display', // IGNORE + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Bottom line', // IGNORE 'display_authors' => 'Authors', // IGNORE diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index d6633f981..02f95b6a8 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Display', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Bottom line', 'display_authors' => 'Authors', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index 8c77dcd7e..74d324c24 100755 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Visualización', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Línea inferior', 'display_authors' => 'Autores/Autoras', diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 71902d96d..88a51eee1 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Affichage', + 'darkMode' => 'Mode sombre automatique (bêta)', 'icon' => array( 'bottom_line' => 'Ligne du bas', 'display_authors' => 'Auteurs', diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index ec322fddf..2d0eea4b9 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'תצוגה', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'שורה תחתונה', 'display_authors' => 'Authors', // TODO diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.php index f46347fe2..10f649823 100644 --- a/app/i18n/id/conf.php +++ b/app/i18n/id/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Display', // TODO + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Bottom line', // TODO 'display_authors' => 'Authors', // TODO diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 8efe6be41..5065fe7ea 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Visualizzazione', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Barra in fondo', 'display_authors' => 'Autori', diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php index f84354c36..1247a0ce9 100644 --- a/app/i18n/ja/conf.php +++ b/app/i18n/ja/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => '表示', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => '行の下部', 'display_authors' => '著者', diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.php index 95fda6969..9ee82802e 100644 --- a/app/i18n/ko/conf.php +++ b/app/i18n/ko/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => '표시', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => '하단', 'display_authors' => '저자', diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index 261c3aa33..8a22f9e27 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Opmaak', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Onderaan', 'display_authors' => 'Auteurs', diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index 9f157a497..4d1e03786 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Afichatge', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Linha enbàs', 'display_authors' => 'Autors', diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php index 3349bbf53..f026fe128 100644 --- a/app/i18n/pl/conf.php +++ b/app/i18n/pl/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Wyświetlanie', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Dolny margines', 'display_authors' => 'Autorzy', diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php index bcf9fbd2f..dc05a0fa0 100644 --- a/app/i18n/pt-br/conf.php +++ b/app/i18n/pt-br/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Exibição', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Linha inferior', 'display_authors' => 'Autores', diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 98e6f5003..4d65a9dcb 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Отображение', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Нижняя линия', 'display_authors' => 'Авторы', diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php index 822de7b09..ab68d07ca 100644 --- a/app/i18n/sk/conf.php +++ b/app/i18n/sk/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Zobrazenie', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Spodný riadok', 'display_authors' => 'Autori', diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index 14eb152c3..cb72d3973 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => 'Görünüm', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => 'Alt çizgi', 'display_authors' => 'Yazarlar', diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index a4d293aeb..d558c025e 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => '显示', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => '底栏', 'display_authors' => '作者', diff --git a/app/i18n/zh-tw/conf.php b/app/i18n/zh-tw/conf.php index 61ba44151..3001f64c5 100644 --- a/app/i18n/zh-tw/conf.php +++ b/app/i18n/zh-tw/conf.php @@ -32,6 +32,7 @@ return array( ), 'display' => array( '_' => '顯示', + 'darkMode' => 'Automatic dark mode (beta)', // TODO 'icon' => array( 'bottom_line' => '底欄', 'display_authors' => '作者', diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 48ada7183..1e9ce6905 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -52,7 +52,7 @@ if (_t('gen.dir') === 'rtl') { <meta name="robots" content="noindex,nofollow" /> <?php } ?> </head> - <body class="<?= Minz_Request::actionName() ?>"> + <body class="<?= Minz_Request::actionName() ?><?= (FreshRSS_Context::$user_conf->darkMode === 'no') ? '' : ' darkMode_' . FreshRSS_Context::$user_conf->darkMode ?>"> <?php if (!Minz_Request::param('ajax')) { flush(); diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 0fde2b50e..2fda0cb19 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -95,6 +95,16 @@ </div> </div> + <div class="form-group"> + <label class="group-name" for="darkMode"><?= _t('conf.display.darkMode') ?></label> + <div class="group-controls"> + <select name="darkMode" id="darkMode" data-leave-validation="<?= FreshRSS_Context::$user_conf->darkMode ?>"> + <option value="no"<?php FreshRSS_Context::$user_conf->darkMode === 'no' ? ' selected' : '' ?>>No</option> + <option value="auto"<?php FreshRSS_Context::$user_conf->darkMode === 'auto' ? ' selected' : '' ?>>Auto</option> + </select> + </div> + </div> + <?php $width = FreshRSS_Context::$user_conf->content_width; ?> <div class="form-group"> <label class="group-name" for="content_width"><?= _t('conf.display.width.content') ?></label> |
