Skip to content

Commit

Permalink
feat: create config to display website icon only / name only / icon a…
Browse files Browse the repository at this point in the history
…nd name / none on feeds
  • Loading branch information
sad270 committed Jan 8, 2023
1 parent e683d2f commit 162ab6d
Show file tree
Hide file tree
Showing 29 changed files with 193 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/Controllers/configureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function displayAction() {
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);
Expand Down
7 changes: 7 additions & 0 deletions app/Models/ConfigurationSetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ private function _topline_link(&$data, $value) {
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'))) {
Expand Down
1 change: 1 addition & 0 deletions app/Models/UserConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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_default
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/cz/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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á',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/de/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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ß',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/el/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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', // TODO
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/en-us/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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', // IGNORE
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/en/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/es/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/fr/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'timezone' => 'Fuseau horaire',
'title' => 'Affichage',
'website' => array(
'full' => 'Icon and name', // TODO
'icon' => 'Icon only', // TODO
'label' => 'Website', // TODO
'name' => 'Name only', // TODO
'none' => 'None', // TODO
),
'width' => array(
'content' => 'Largeur du contenu',
'large' => 'Large', // IGNORE
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/he/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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' => 'גדול',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/id/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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', // TODO
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/it/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/ja/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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' => '広い',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/ko/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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' => '넓게',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/nl/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/oc/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/pl/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/pt-br/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/ru/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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' => 'Широкое',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/sk/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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á',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/tr/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'timezone' => 'Time zone', // TODO
'title' => 'Görünüm',
'website' => array(
'full' => 'Icon and name', // TODO
'icon' => 'Icon only', // TODO
'label' => 'Website', // TODO
'name' => 'Name only', // TODO
'none' => 'None', // TODO
),
'width' => array(
'content' => 'İçerik genişliği',
'large' => 'Geniş',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/zh-cn/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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' => '宽',
Expand Down
7 changes: 7 additions & 0 deletions app/i18n/zh-tw/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
),
'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' => '寬',
Expand Down
21 changes: 21 additions & 0 deletions app/views/configure/display.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,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>
Expand Down
10 changes: 7 additions & 3 deletions app/views/helpers/index/normal/entry_header.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/** @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;
Expand Down Expand Up @@ -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><?= $this->feed->name() ?></span><?php endif; ?>
</a>
</li>
</li><?php
endif; ?>

<?php
if ($topline_thumbnail !== 'none'):
Expand Down
1 change: 1 addition & 0 deletions config-user.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@

'topline_read' => true,
'topline_favorite' => true,
'topline_website' => 'full',
'topline_thumbnail' => 'none',
'topline_summary' => false,
'topline_display_authors' => false,
Expand Down
4 changes: 4 additions & 0 deletions p/themes/base-theme/frss.css
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,10 @@ input[type="search"] {
width: 200px;
}

.flux .item.website.icon {
width: 2.5rem;
}

.website a:hover .favicon,
a.website:hover .favicon {
filter: grayscale(100%);
Expand Down

0 comments on commit 162ab6d

Please sign in to comment.