A free, self-hostable news aggregator…
feat: create config to display website icon only / name only / icon and name / none on feeds (#4969)
Sadetdin EYILId3966befafab
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.phpindex 791d58d6d..95d897dbb 100644--- a/app/Controllers/configureController.php+++ b/app/Controllers/configureController.php@@ -51,6 +51,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {FreshRSS_Context::$user_conf->topline_favorite = Minz_Request::param('topline_favorite', false);FreshRSS_Context::$user_conf->topline_date = Minz_Request::param('topline_date', false);FreshRSS_Context::$user_conf->topline_link = Minz_Request::param('topline_link', false);+ FreshRSS_Context::$user_conf->topline_website = Minz_Request::param('topline_website', false);FreshRSS_Context::$user_conf->topline_thumbnail = Minz_Request::param('topline_thumbnail', false);FreshRSS_Context::$user_conf->topline_summary = Minz_Request::param('topline_summary', false);FreshRSS_Context::$user_conf->topline_display_authors = Minz_Request::param('topline_display_authors', false);diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.phpindex 258c2ad58..2f33ab925 100644--- a/app/Models/ConfigurationSetter.php+++ b/app/Models/ConfigurationSetter.php@@ -272,6 +272,13 @@ class FreshRSS_ConfigurationSetter {private function _topline_read(&$data, $value) {$data['topline_read'] = $this->handleBool($value);}+ private function _topline_website(&$data, $value) {+ $value = strtolower($value);+ if (!in_array($value, array('none', 'icon', 'name', 'full'))) {+ $value = 'full';+ }+ $data['topline_website'] = $value;+ }private function _topline_thumbnail(&$data, $value) {$value = strtolower($value);if (!in_array($value, array('none', 'portrait', 'square', 'landscape'))) {diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.phpindex 53b12cc2e..f539268ae 100644--- a/app/Models/UserConfiguration.php+++ b/app/Models/UserConfiguration.php@@ -61,6 +61,7 @@* @property bool $topline_link* @property bool $topline_read* @property bool $topline_summary+ * @property string $topline_website* @property string $topline_thumbnail* @property int $ttl_default* @property int $dynamic_opml_ttl_defaultdiff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.phpindex 4411b5047..55655a44d 100644--- a/app/i18n/cz/conf.php+++ b/app/i18n/cz/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Zobrazení',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Šířka obsahu','large' => 'Široká',diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.phpindex 8962123f4..9d990d924 100644--- a/app/i18n/de/conf.php+++ b/app/i18n/de/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Anzeige',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Inhaltsbreite','large' => 'Groß',diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.phpindex daacfe684..88f12cdba 100644--- a/app/i18n/el/conf.php+++ b/app/i18n/el/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Display', // TODO+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Content width', // TODO'large' => 'Wide', // TODOdiff --git a/app/i18n/en-us/conf.php b/app/i18n/en-us/conf.phpindex afea0299a..414534c38 100644--- a/app/i18n/en-us/conf.php+++ b/app/i18n/en-us/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // IGNORE'title' => 'Display', // IGNORE+ 'website' => array(+ 'full' => 'Icon and name', // IGNORE+ 'icon' => 'Icon only', // IGNORE+ 'label' => 'Website', // IGNORE+ 'name' => 'Name only', // IGNORE+ 'none' => 'None', // IGNORE+ ),'width' => array('content' => 'Content width', // IGNORE'large' => 'Wide', // IGNOREdiff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.phpindex 9899cf897..6b4e1c99f 100644--- a/app/i18n/en/conf.php+++ b/app/i18n/en/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone','title' => 'Display',+ 'website' => array(+ 'full' => 'Icon and name',+ 'icon' => 'Icon only',+ 'label' => 'Website',+ 'name' => 'Name only',+ 'none' => 'None',+ ),'width' => array('content' => 'Content width','large' => 'Wide',diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.phpindex 5137ff987..ffb70749f 100644--- a/app/i18n/es/conf.php+++ b/app/i18n/es/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Visualización',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Ancho de contenido','large' => 'Grande',diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.phpindex 3122e3be5..24011e5eb 100644--- a/app/i18n/fr/conf.php+++ b/app/i18n/fr/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Fuseau horaire','title' => 'Affichage',+ 'website' => array(+ 'full' => 'Icône et nom',+ 'icon' => 'Icône seulement',+ 'label' => 'Site Web',+ 'name' => 'Nom seulement',+ 'none' => 'Aucun',+ ),'width' => array('content' => 'Largeur du contenu','large' => 'Large', // IGNOREdiff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.phpindex c4a490a2d..75ea82798 100644--- a/app/i18n/he/conf.php+++ b/app/i18n/he/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'תצוגה',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'רוחב התוכן','large' => 'גדול',diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.phpindex 8b1fa8dc6..d4fa630cd 100644--- a/app/i18n/id/conf.php+++ b/app/i18n/id/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Display', // TODO+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Content width', // TODO'large' => 'Wide', // TODOdiff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.phpindex 6f3540322..2c6dcdd4f 100644--- a/app/i18n/it/conf.php+++ b/app/i18n/it/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Visualizzazione',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Larghezza contenuto','large' => 'Largo',diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.phpindex 4dd939760..f4e6f2ced 100644--- a/app/i18n/ja/conf.php+++ b/app/i18n/ja/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'ディスプレイ',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'コンテンツ幅','large' => '広い',diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.phpindex a88fcf9e0..4bd293af2 100644--- a/app/i18n/ko/conf.php+++ b/app/i18n/ko/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => '표시',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => '내용 표시 너비','large' => '넓게',diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.phpindex e02ca81cc..964afe7e0 100644--- a/app/i18n/nl/conf.php+++ b/app/i18n/nl/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Tijdzone','title' => 'Opmaak',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Inhoud breedte','large' => 'Breed',diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.phpindex 4a3b483e7..926e15b63 100644--- a/app/i18n/oc/conf.php+++ b/app/i18n/oc/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Afichatge',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Largor del contengut','large' => 'Larga',diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.phpindex 8700a1c13..49e55ea13 100644--- a/app/i18n/pl/conf.php+++ b/app/i18n/pl/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Wyświetlanie',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Rozmiar treści','large' => 'Szeroka',diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.phpindex f8ad55f14..380687600 100644--- a/app/i18n/pt-br/conf.php+++ b/app/i18n/pt-br/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Exibição',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Largura do conteúdo','large' => 'Largo',diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.phpindex 2c5dda544..44cc3fbd0 100644--- a/app/i18n/ru/conf.php+++ b/app/i18n/ru/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Отображение',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Ширина содержимого','large' => 'Широкое',diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.phpindex d4714b506..5c5f64d3f 100644--- a/app/i18n/sk/conf.php+++ b/app/i18n/sk/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Zobraziť',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => 'Šírka obsahu','large' => 'Veľká',diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.phpindex 41f658879..33aa340e5 100644--- a/app/i18n/tr/conf.php+++ b/app/i18n/tr/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => 'Görünüm',+ 'website' => array(+ 'full' => 'simgesi and adı',+ 'icon' => 'Sadece simgesi',+ 'label' => 'Site',+ 'name' => 'Sadece adı',+ 'none' => 'Hiçbiri',+ ),'width' => array('content' => 'İçerik genişliği','large' => 'Geniş',diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.phpindex 0be182cfb..61ae08ade 100644--- a/app/i18n/zh-cn/conf.php+++ b/app/i18n/zh-cn/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => '显示',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => '内容宽度','large' => '宽',diff --git a/app/i18n/zh-tw/conf.php b/app/i18n/zh-tw/conf.phpindex 34439c01b..6f535347c 100644--- a/app/i18n/zh-tw/conf.php+++ b/app/i18n/zh-tw/conf.php@@ -66,6 +66,13 @@ return array(),'timezone' => 'Time zone', // TODO'title' => '顯示',+ 'website' => array(+ 'full' => 'Icon and name', // TODO+ 'icon' => 'Icon only', // TODO+ 'label' => 'Website', // TODO+ 'name' => 'Name only', // TODO+ 'none' => 'None', // TODO+ ),'width' => array('content' => '內容寬度','large' => '寬',diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtmlindex 44ca242ad..dc410a00a 100644--- a/app/views/configure/display.phtml+++ b/app/views/configure/display.phtml@@ -136,6 +136,27 @@</div></div>+ <?php $topline_website = FreshRSS_Context::$user_conf->topline_website; ?>+ <div class="form-group">+ <label class="group-name" for="topline_website"><?= _t('conf.display.website.label') ?></label>+ <div class="group-controls">+ <select name="topline_website" id="topline_website" required="" data-leave-validation="<?= $topline_website ?>">+ <option value="none" <?= $topline_website === 'none' ? 'selected="selected"' : '' ?>>+ <?= _t('conf.display.website.none') ?>+ </option>+ <option value="icon" <?= $topline_website === 'icon' ? 'selected="selected"' : '' ?>>+ <?= _t('conf.display.website.icon') ?>+ </option>+ <option value="name" <?= $topline_website === 'name' ? 'selected="selected"' : '' ?>>+ <?= _t('conf.display.website.name') ?>+ </option>+ <option value="full" <?= $topline_website === 'full' ? 'selected="selected"' : '' ?>>+ <?= _t('conf.display.website.full') ?>+ </option>+ </select>+ </div>+ </div>+<?php $topline_thumbnail = FreshRSS_Context::$user_conf->topline_thumbnail; ?><div class="form-group"><label class="group-name" for="topline_thumbnail"><?= _t('conf.display.thumbnail.label') ?></label>diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtmlindex 92eacf617..4cfb5beda 100644--- a/app/views/helpers/index/normal/entry_header.phtml+++ b/app/views/helpers/index/normal/entry_header.phtml@@ -2,13 +2,14 @@/** @var FreshRSS_View $this */$topline_read = FreshRSS_Context::$user_conf->topline_read;$topline_favorite = FreshRSS_Context::$user_conf->topline_favorite;+ $topline_website = FreshRSS_Context::$user_conf->topline_website;$topline_thumbnail = FreshRSS_Context::$user_conf->topline_thumbnail;$topline_summary = FreshRSS_Context::$user_conf->topline_summary;$topline_display_authors = FreshRSS_Context::$user_conf->topline_display_authors;$topline_date = FreshRSS_Context::$user_conf->topline_date;$topline_link = FreshRSS_Context::$user_conf->topline_link;$lazyload = FreshRSS_Context::$user_conf->lazyload;-?><ul class="horizontal-list flux_header"><?php+?><ul class="horizontal-list flux_header website<?= $topline_website ?>"><?phpif (FreshRSS_Auth::hasAccess()) {if ($topline_read) {?><li class="item manage"><?php@@ -31,11 +32,14 @@?></li><?php}}- ?><li class="item website">++ if ($topline_website !== 'none'):+ ?><li class="item website <?= $topline_website ?>"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" class="item-element" title="<?= _t('gen.action.filter') ?>: <?= $this->feed->name() ?>">- <?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?><span><?= $this->feed->name() ?></span>+ <?php if (FreshRSS_Context::$user_conf->show_favicons && 'name' !== $topline_website): ?><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?><?php if ('icon' !== $topline_website): ?><span class="websiteName"><?= $this->feed->name() ?></span><?php endif; ?></a>- </li>+ </li><?php+ endif; ?><?phpif ($topline_thumbnail !== 'none'):diff --git a/config-user.default.php b/config-user.default.phpindex 5a26841ac..c45fb60f5 100644--- a/config-user.default.php+++ b/config-user.default.php@@ -100,6 +100,7 @@ return array ('topline_read' => true,'topline_favorite' => true,+ 'topline_website' => 'full','topline_thumbnail' => 'none','topline_summary' => false,'topline_display_authors' => false,diff --git a/p/themes/base-theme/frss.css b/p/themes/base-theme/frss.cssindex 43c6b7d4d..bafc26a89 100644--- a/p/themes/base-theme/frss.css+++ b/p/themes/base-theme/frss.css@@ -1199,6 +1199,26 @@ input[type="search"] {width: 200px;}+.flux:not(.current):hover .websitenone .item.title {+ max-width: calc(100% - 3 * (2 * var(--frss-padding-flux-items) + 16px));+}++.flux .websiteicon .item.website {+ width: calc(2 * var(--frss-padding-flux-items) + 16px);+}++.flux:not(.current):hover .websiteicon .item.title {+ max-width: calc(100% - 4 * (2 * var(--frss-padding-flux-items) + 16px));+}++.flux .websitename .item.website {+ width: 150px;+}++.flux:not(.current):hover .websitename .item.title {+ max-width: calc(100% - 3 * (2 * var(--frss-padding-flux-items) + 16px) - 150px);+}+.website a:hover .favicon,a.website:hover .favicon {filter: grayscale(100%);diff --git a/p/themes/base-theme/frss.rtl.css b/p/themes/base-theme/frss.rtl.cssindex 62afd6ff0..40b6c4119 100644--- a/p/themes/base-theme/frss.rtl.css+++ b/p/themes/base-theme/frss.rtl.css@@ -1199,6 +1199,26 @@ input[type="search"] {width: 200px;}+.flux:not(.current):hover .websitenone .item.title {+ max-width: calc(100% - 3 * (2 * var(--frss-padding-flux-items) + 16px));+}++.flux .websiteicon .item.website {+ width: calc(2 * var(--frss-padding-flux-items) + 16px);+}++.flux:not(.current):hover .websiteicon .item.title {+ max-width: calc(100% - 4 * (2 * var(--frss-padding-flux-items) + 16px));+}++.flux .websitename .item.website {+ width: 150px;+}++.flux:not(.current):hover .websitename .item.title {+ max-width: calc(100% - 3 * (2 * var(--frss-padding-flux-items) + 16px) - 150px);+}+.website a:hover .favicon,a.website:hover .favicon {filter: grayscale(100%);