diff options
| author | 2022-07-17 22:54:24 +0200 | |
|---|---|---|
| committer | 2022-07-17 22:54:24 +0200 | |
| commit | b2e46d62154faf28c3c17e2b775c47d11e38ee56 (patch) | |
| tree | 69df7287cdc30cee103cdeed43f5a43bbfb086af | |
| parent | 954fcef9e26ce1d9e4e5ad83749e4ee9c894f716 (diff) | |
Improved: Article header (#4101)
* First draft for normal view
* Revert changes on the entry header
* Update normal.phtml
* Update normal.phtml
* RTL CSS
* CSS fixes
* Better tags style
* fix
* Update swage.scss
* fix
* Update swage.scss
* fixed .content header
* font-size in rem
* improved template
* dropdown menu if more than 7 tags
* configuration: show tags in topline
* Simplify loop logic
* Minor space
* config tags via reading (i18n still missed)
* fixed the whitespaces
* optimizations
* optimize header+footer
* Update normal.phtml
* fix css
* new config: show author+date in footer
* config feed name display
* improve HTML
* fix whitespaces
* i18n
* i18n: German translations
* fix i18n German
* fixed: uncouple from bottomline config
* reverted: tobline_tags
* equalities
* fixed: author in footer
* fixed data-leave-validation
* improved max numbers i18n label
* Config works now also in the reader view
* fix: footer border
* reader view: style article-header-topline
* fixed whitespace
* i18n fr
* Minor i18n fr
* Fix mistake i18n fr
* i18n fr more precise expression
* Fix JavaScript
* removed the link icon in the title
* clean CSS
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
34 files changed, 1053 insertions, 94 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 76df3580b..613bacade 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -110,6 +110,10 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::$user_conf->auto_load_more = Minz_Request::param('auto_load_more', false); FreshRSS_Context::$user_conf->display_posts = Minz_Request::param('display_posts', false); FreshRSS_Context::$user_conf->display_categories = Minz_Request::param('display_categories', 'active'); + FreshRSS_Context::$user_conf->show_tags = Minz_Request::param('show_tags', '0'); + FreshRSS_Context::$user_conf->show_tags_max = Minz_Request::param('show_tags_max', '0'); + FreshRSS_Context::$user_conf->show_author_date = Minz_Request::param('show_author_date', '0'); + FreshRSS_Context::$user_conf->show_feed_name = Minz_Request::param('show_feed_name', 't'); FreshRSS_Context::$user_conf->hide_read_feeds = Minz_Request::param('hide_read_feeds', false); FreshRSS_Context::$user_conf->onread_jump_next = Minz_Request::param('onread_jump_next', false); FreshRSS_Context::$user_conf->lazyload = Minz_Request::param('lazyload', false); diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index 336a93351..c822bcf4d 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -189,6 +189,23 @@ class FreshRSS_ConfigurationSetter { $data['display_categories'] = $value; } + private function show_tags(&$data, $value) { + $data['show_tags'] = $value; + } + + private function show_tags_max(&$data, $value) { + $value = intval($value); + $data['show_tags_max'] = $value >= 0 ? $value : 0; + } + + private function _show_author_date(&$data, $value) { + $data['show_author_date'] = $value; + } + + private function _show_feed_name(&$data, $value) { + $data['show_feed_name'] = $value; + } + private function _display_posts(&$data, $value) { $data['display_posts'] = $this->handleBool($value); } diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php index 45ec12e5a..05c3c08ac 100644 --- a/app/Models/UserConfiguration.php +++ b/app/Models/UserConfiguration.php @@ -15,6 +15,10 @@ * @property-read string $default_state * @property string $default_view * @property string|bool $display_categories + * @property string $show_tags + * @property int $show_tags_max + * @property string $show_author_date + * @property string $show_feed_name * @property bool $display_posts * @property string $email_validation_token * @property-read string $enabled diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php index a381a834c..46c654c09 100644 --- a/app/i18n/cz/conf.php +++ b/app/i18n/cz/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Čtení', 'after_onread' => 'Po „označit vše jako přečtené“', 'always_show_favorites' => 'Vy výchozím nastavení zobrazit všechny články v oblíbených', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Počet článků na stránku', 'auto_load_more' => 'Načítat další články dole na stránce', 'auto_remove_article' => 'Po přečtení články skrýt', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Kategorii, které rozbalovat', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index bf7662feb..c2e99377d 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Lesen', 'after_onread' => 'Nach „Alle als gelesen markieren“,', 'always_show_favorites' => 'Favoriten immer anzeigen', + 'article' => array( + 'authors_date' => array( + '_' => 'Autoren und Datum', + 'both' => 'In Kopf- und Fußzeile', + 'footer' => 'In Fußzeile', + 'header' => 'In Kopfzeile', + 'none' => 'Nicht anzeigen', + ), + 'feed_name' => array( + 'above_title' => 'Oberhalb der Überschrit und Hashtags', + 'none' => 'Nicht anzeigen', + 'with_authors' => 'In der Zeile mit Autoren und Datum', + ), + 'feed_title' => 'Feed Titel', + 'tags' => array( + '_' => 'Hashtags', + 'both' => 'In Kopf- und Fußzeile', + 'footer' => 'In Fußzeile', + 'header' => 'In Kopfzeile', + 'none' => 'Nicht anzeigen', + ), + 'tags_max' => array( + '_' => 'Max Anzahl von Hashtags', + 'help' => '0 bedeutet: Zeige alle Hashtags und fasse sie nicht zusammen', + ), + ), 'articles_per_page' => 'Anzahl der Artikel pro Seite', 'auto_load_more' => 'Die nächsten Artikel am Seitenende laden', 'auto_remove_article' => 'Artikel nach dem Lesen verstecken', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Ausgeklappte Kategorien', 'headline' => array( 'articles' => 'Artikel: Öffnen/Schließen', + 'articles_header_footer' => 'Artikel: Kopf- und Fußzeile', 'categories' => 'Linke Navigation: Kategorien', 'mark_as_read' => 'Artikel als gelesen markieren', 'misc' => 'Sonstiges', diff --git a/app/i18n/en-us/conf.php b/app/i18n/en-us/conf.php index 3f2d21a16..04f7a203b 100644 --- a/app/i18n/en-us/conf.php +++ b/app/i18n/en-us/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Reading', // IGNORE 'after_onread' => 'After “mark all as read”,', // IGNORE 'always_show_favorites' => 'Show all articles in favorites by default', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // IGNORE + 'both' => 'In header and footer', // IGNORE + 'footer' => 'In footer', // IGNORE + 'header' => 'In header', // IGNORE + 'none' => 'None', // IGNORE + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // IGNORE + 'none' => 'None', // IGNORE + 'with_authors' => 'In authors and date row', // IGNORE + ), + 'feed_title' => 'Feed title', // IGNORE + 'tags' => array( + '_' => 'Tags', // IGNORE + 'both' => 'In header and footer', // IGNORE + 'footer' => 'In footer', // IGNORE + 'header' => 'In header', // IGNORE + 'none' => 'None', // IGNORE + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // IGNORE + 'help' => '0 means: show all tags and do not collapse them', // IGNORE + ), + ), 'articles_per_page' => 'Number of articles per page', // IGNORE 'auto_load_more' => 'Load more articles at the bottom of the page', // IGNORE 'auto_remove_article' => 'Hide articles after reading', // IGNORE @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categories to unfold', // IGNORE 'headline' => array( 'articles' => 'Articles: Open/Close', // IGNORE + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // IGNORE 'mark_as_read' => 'Mark article as read', // IGNORE 'misc' => 'Miscellaneous', // IGNORE diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index 4bd229c31..adc35d0c7 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Reading', 'after_onread' => 'After “mark all as read”,', 'always_show_favorites' => 'Show all articles in favourites by default', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Number of articles per page', 'auto_load_more' => 'Load more articles at the bottom of the page', 'auto_remove_article' => 'Hide articles after reading', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categories to unfold', 'headline' => array( 'articles' => 'Articles: Open/Close', + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', 'mark_as_read' => 'Mark article as read', 'misc' => 'Miscellaneous', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index 6e08913d3..502a55182 100755 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Lectura', 'after_onread' => 'Tras “marcar todo como leído”,', 'always_show_favorites' => 'Mostrar todos los artículos en favoritos de forma predeterminada', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Número de artículos por página', 'auto_load_more' => 'Cargar más artículos al final de la página', 'auto_remove_article' => 'Ocultar artículos tras la lectura', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categorías a desarrollar', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index ff07ff91a..8cd03c23f 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Lecture', 'after_onread' => 'Après “marquer tout comme lu”,', 'always_show_favorites' => 'Afficher par défaut tous les articles dans les favoris', + 'article' => array( + 'authors_date' => array( + '_' => 'Auteurs et date', + 'both' => 'En en-tête et en pied d’article', + 'footer' => 'En pied d’article', + 'header' => 'En en-tête', + 'none' => 'Caché', + ), + 'feed_name' => array( + 'above_title' => 'Au-dessus du titre', + 'none' => 'Caché', + 'with_authors' => 'Sur la ligne “Auteurs et date”', + ), + 'feed_title' => 'Titre du flux', + 'tags' => array( + '_' => 'Tags', // IGNORE + 'both' => 'En en-tête et en pied d’article', + 'footer' => 'En pied d’article', + 'header' => 'En en-tête', + 'none' => 'Caché', + ), + 'tags_max' => array( + '_' => 'Nombre maximum de tags affichés', + 'help' => '0 pour afficher tous les tags sans menu déroulant', + ), + ), 'articles_per_page' => 'Nombre d’articles par page', 'auto_load_more' => 'Charger les articles suivants en bas de page', 'auto_remove_article' => 'Cacher les articles après lecture', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Catégories à déplier', 'headline' => array( 'articles' => 'Articles : ouverture/fermeture', + 'articles_header_footer' => 'Articles : en-tête / pied d’article', 'categories' => 'Navigation de gauche : catégories', 'mark_as_read' => 'Marquer les articles comme lus', 'misc' => 'Divers', diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index d0edbb849..627749130 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'קריאה', 'after_onread' => 'לאחר “סימון הכל כנקרא”,', 'always_show_favorites' => 'Show all articles in favourites by default', // TODO + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'מספר המאמרים בעמוד', 'auto_load_more' => 'טעינת המאמר הבא סוף העמוד', 'auto_remove_article' => 'Hide articles after reading', // TODO @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categories to unfold', // TODO 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 08348c625..90b05c056 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Lettura', 'after_onread' => 'Dopo “segna tutto come letto”,', 'always_show_favorites' => 'Show all articles in favourites by default', // TODO + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Numero di articoli per pagina', 'auto_load_more' => 'Carica articoli successivi a fondo pagina', 'auto_remove_article' => 'Nascondi articoli dopo la lettura', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categories to unfold', // TODO 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php index 841a360d5..e4a8c9e2e 100644 --- a/app/i18n/ja/conf.php +++ b/app/i18n/ja/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'リーディング', 'after_onread' => 'あとで “すべてに既読を付ける”,', 'always_show_favorites' => 'デフォルトですべてのお気に入りの記事を表示する', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'ページ当たりの記事の数', 'auto_load_more' => 'ページの下にもっと記事を読み込む', 'auto_remove_article' => '記事を読んだら非表示にする', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => '展開されていない記事', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.php index 971ff1a85..9e4c45bf9 100644 --- a/app/i18n/ko/conf.php +++ b/app/i18n/ko/conf.php @@ -137,6 +137,32 @@ return array( '_' => '읽기', 'after_onread' => '“모두 읽음으로 표시” 후,', 'always_show_favorites' => '기본으로 즐겨찾기에 있는 모든 글을 표시', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => '페이지당 글 수', 'auto_load_more' => '페이지 하단에 다다르면 글 더 불러오기', 'auto_remove_article' => '글을 읽은 후 숨기기', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => '다음 카테고리를 펼치기', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index cb86238be..5539d5569 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Lezen', 'after_onread' => 'Na “markeer alles als gelezen”,', 'always_show_favorites' => 'Toon alle artikelen standaard in favorieten', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Aantal artikelen per pagina', 'auto_load_more' => 'Laad volgende artikel onderaan de pagina', 'auto_remove_article' => 'Verberg artikel na lezen', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categoriën om uit te klappen', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index 284eafc7e..207681bc6 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Lectura', 'after_onread' => 'Aprèp « marcar coma legit »,', 'always_show_favorites' => 'Mostrar totes los articles dels favorits per defaut', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Nombre d’articles per pagina', 'auto_load_more' => 'Cargar los articles seguents enbàs de la pagina', 'auto_remove_article' => 'Rescondre los articles aprèp lectura', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categorias a desplegar', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php index 74f511f96..fc4b233c9 100644 --- a/app/i18n/pl/conf.php +++ b/app/i18n/pl/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Czytanie', 'after_onread' => 'Po oznaczeniu wszystkich jako przeczytane,', 'always_show_favorites' => 'Pokaż wszystkie wiadomości po wejściu do ulubionych', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Liczba wiadomości na stronę', 'auto_load_more' => 'Załaduj więcej wiadomości po dojściu na koniec strony', 'auto_remove_article' => 'Ukryj wiadomości po przeczytaniu', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Kategorie do rozwinięcia', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php index 66dcebed7..af8cafe70 100644 --- a/app/i18n/pt-br/conf.php +++ b/app/i18n/pt-br/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Leitura', 'after_onread' => 'Depois de "marcar todos como lido",', 'always_show_favorites' => 'Mostrar todos os artivos nos favoritos por padrão', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Número de artigos por página', 'auto_load_more' => 'Carregar mais artigos no final da página', 'auto_remove_article' => 'Esconder artigos depois de lidos', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Categorias abertas', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 9a4f25564..04c0ef573 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Чтение', 'after_onread' => 'После «отметить всё прочитанным»', 'always_show_favorites' => 'Показывать все статьи в избранном по умолчанию', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Количество статей на странице', 'auto_load_more' => 'Загружать больше статей при достижении низа страницы', 'auto_remove_article' => 'Скрывать статьи по прочтении', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Какие категории развёртывать', 'headline' => array( 'articles' => 'Статьи: открыть/закрыть', + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Левая панель: категории', 'mark_as_read' => 'Пометить статью прочитанной', 'misc' => 'Разное', diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php index dfd05b2b7..cb14c5bb4 100644 --- a/app/i18n/sk/conf.php +++ b/app/i18n/sk/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Čítanie', 'after_onread' => 'Po “Označiť všetko ako prečítané”,', 'always_show_favorites' => 'Automaticky zobraziť všetky články v obľúbených', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Počet článkov na jednu stranu', 'auto_load_more' => 'Načítať ďalšie články dolu na stránke', 'auto_remove_article' => 'Skryť články po prečítaní', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Kategórie na rozbalenie', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index e9f12de7c..203d3bec4 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -137,6 +137,32 @@ return array( '_' => 'Okuma', 'after_onread' => '"Hepsini okundu say" dedinten sonra,', 'always_show_favorites' => 'Öntanımlı olarak favori tüm makaleleri göster', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => 'Sayfa başına makale sayısı', 'auto_load_more' => 'Sayfa sonunda yeni makaleleri yükle', 'auto_remove_article' => 'Okuduktan sonra makaleleri gizle', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => 'Katlaması açılacak kategoriler', 'headline' => array( 'articles' => 'Articles: Open/Close', // TODO + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => 'Left navigation: Categories', // TODO 'mark_as_read' => 'Mark article as read', // TODO 'misc' => 'Miscellaneous', // TODO diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index 44808c141..2086f4a7e 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -137,6 +137,32 @@ return array( '_' => '阅读', 'after_onread' => '「全部标记为已读」后', 'always_show_favorites' => '默认显示收藏夹中所有的文章', + 'article' => array( + 'authors_date' => array( + '_' => 'Authors and date', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'feed_name' => array( + 'above_title' => 'Above title/tags', // TODO + 'none' => 'None', // TODO + 'with_authors' => 'In authors and date row', // TODO + ), + 'feed_title' => 'Feed title', // TODO + 'tags' => array( + '_' => 'Tags', // TODO + 'both' => 'In header and footer', // TODO + 'footer' => 'In footer', // TODO + 'header' => 'In header', // TODO + 'none' => 'None', // TODO + ), + 'tags_max' => array( + '_' => 'Max number of tags shown', // TODO + 'help' => '0 means: show all tags and do not collapse them', // TODO + ), + ), 'articles_per_page' => '每页文章数', 'auto_load_more' => '在页面底部载入下一篇文章', 'auto_remove_article' => '阅读后隐藏文章', @@ -145,6 +171,7 @@ return array( 'display_categories_unfolded' => '展开的分类', 'headline' => array( 'articles' => '文章:打开/关闭', + 'articles_header_footer' => 'Articles: header/footer', // TODO 'categories' => '左侧导航:分类', 'mark_as_read' => '标为已读选项', 'misc' => '其它', diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 251981397..38219e7b2 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -113,6 +113,50 @@ </fieldset> <fieldset> + <legend><?= _t('conf.reading.headline.articles_header_footer') ?></legend> + <div class="form-group"> + <label class="group-name" for="show_feed_name"><?= _t('conf.reading.article.feed_title') ?></label> + <div class="group-controls"> + <select name="show_feed_name" id="show_feed_name" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_feed_name ?>"> + <option value="0"<?= FreshRSS_Context::$user_conf->show_feed_name === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.none') ?></option> + <option value="t"<?= FreshRSS_Context::$user_conf->show_feed_name === 't' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.above_title') ?></option> + <option value="a"<?= FreshRSS_Context::$user_conf->show_feed_name === 'a' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.with_authors') ?></option> + </select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="show_author_date"><?= _t('conf.reading.article.authors_date') ?></label> + <div class="group-controls"> + <select name="show_author_date" id="show_author_date" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_author_date ?>"> + <option value="0" <?= FreshRSS_Context::$user_conf->show_author_date === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.none') ?></option> + <option value="h" <?= FreshRSS_Context::$user_conf->show_author_date === 'h' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.header') ?></option> + <option value="f" <?= FreshRSS_Context::$user_conf->show_author_date === 'f' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.footer') ?></option> + <option value="b" <?= FreshRSS_Context::$user_conf->show_author_date === 'b' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.both') ?></option> + </select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="show_tags"><?= _t('conf.reading.article.tags') ?></label> + <div class="group-controls"> + <select class="select-input-changer" name="show_tags" id="show_tags" data-name="show_tags_max" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_tags ?>"> + <option value="0" <?= FreshRSS_Context::$user_conf->show_tags === '0' ? ' selected="selected"' : '' ?> data-input-visible="false"><?= _t('conf.reading.article.tags.none') ?></option> + <option value="h" <?= FreshRSS_Context::$user_conf->show_tags === 'h' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.header') ?></option> + <option value="f" <?= FreshRSS_Context::$user_conf->show_tags === 'f' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.footer') ?></option> + <option value="b" <?= FreshRSS_Context::$user_conf->show_tags === 'b' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.both') ?></option> + </select> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> + </div> + </div> + <div class="form-group" id="show_tags_max-block"> + <label class="group-name" for="show_tags_max"><?= _t('conf.reading.article.tags_max') ?></label> + <div class="group-controls"> + <input type="number" id="show_tags_max" name="show_tags_max" value="<?= FreshRSS_Context::$user_conf->show_tags_max ?>" min="0" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_tags_max ?>" data-number="2" /> + <p class="help"><?= _i('help') ?> <?= _t('conf.reading.article.tags_max.help') ?></p> + </div> + </div> + </fieldset> + + <fieldset> <legend><?= _t('conf.reading.headline.articles') ?></legend> <div class="form-group"> <div class="group-controls"> @@ -313,3 +357,5 @@ </form> </main> + +<script src="../scripts/config.js?<?= @filemtime(PUBLIC_PATH . '/scripts/config.js') ?>"></script> diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index aa1df5450..94fe34b94 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -68,7 +68,7 @@ </div> <div class="form-group" id="max-registrations-block"> - <label class="group-name" for="max-registrations"><?= _t('admin.system.registration.number') ?></label> + <label class="group-name" for="max-registrations-input"><?= _t('admin.system.registration.number') ?></label> <div class="group-controls"> <?php $number = count(listUsers()); ?> <input type="number" id="max-registrations-input" name="" value="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] > 1 ? FreshRSS_Context::$system_conf->limits['max_registrations'] : $number + 1; ?>" min="2" diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index da2388e8f..179c0f86d 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -13,6 +13,7 @@ $display_others = true; $hidePosts = !FreshRSS_Context::$user_conf->display_posts; $lazyload = FreshRSS_Context::$user_conf->lazyload; $content_width = FreshRSS_Context::$user_conf->content_width; +$MAX_TAGS_DISPLAYED = FreshRSS_Context::$user_conf->show_tags_max; $today = @strtotime('today'); ?> @@ -72,44 +73,168 @@ $today = @strtotime('today'); ?>" id="flux_<?= $this->entry->id() ?>" data-feed="<?= $this->feed->id() ?>"><?php - $this->renderHelper('index/normal/entry_header'); - ?><div class="flux_content" dir="auto"> + $tags = null; + $firstTags = array(); + $remainingTags = array(); + + if (FreshRSS_Context::$user_conf->show_tags === 'h' || FreshRSS_Context::$user_conf->show_tags === 'f' || FreshRSS_Context::$user_conf->show_tags === 'b') { + $tags = $this->entry->tags(); + if (!empty($tags)) { + if ($MAX_TAGS_DISPLAYED > 0) { + $firstTags = array_slice($tags, 0, $MAX_TAGS_DISPLAYED); + $remainingTags = array_slice($tags, $MAX_TAGS_DISPLAYED); + } else { + $firstTags = $tags; + } + } + } + ?><article class="flux_content" dir="auto"> <div class="content <?= $content_width ?>"> - <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?></a></h1> - <div class="subtitle"> - <div class="website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" 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></a> - </div> - <div class="date"><?= $this->entry->date() ?></div> - <?php + <header> + <?php if (FreshRSS_Context::$user_conf->show_feed_name === 't') { ?> + <div class="website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>"> + <?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></a> + </div> + <?php } ?> + <?php if (FreshRSS_Context::$user_conf->show_tags === 'h' || FreshRSS_Context::$user_conf->show_tags === 'b') { ?> + <div class="tags"> + <?php + if (!empty($tags)) { + ?><?= _i('tag') ?><ul class="list-tags"><?php + foreach ($firstTags as $tag) { + ?><li class="item tag"><a class="link-tag" href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>">#<?= $tag ?></a></li><?php + } + + if (!empty($remainingTags)) { // more than 7 tags: show dropdown menu ?> + <li class="item tag"> + <div class="dropdown"> + <div id="dropdown-tags2-<?= $this->entry->id() ?>" class="dropdown-target"></div> + <a class="dropdown-toggle" href="#dropdown-tags2-<?= $this->entry->id() ?>"><?= _i('down') ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-header"><?= _t('index.tag.related') ?></li> + <?php + foreach ($remainingTags as $tag) { + ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>"><?= $tag ?></a></li><?php + } ?> + </ul> + <a class="dropdown-close" href="#close">❌</a> + </div> + </li> + <?php + } ?> + </ul><?php + } ?> + </div> + <?php + } ?> + <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $this->entry->link() ?>" title="<?= _t('conf.shortcut.see_on_website')?>"><?= $this->entry->title() ?></a></h1> + <?php if (FreshRSS_Context::$user_conf->show_author_date === 'h' || FreshRSS_Context::$user_conf->show_author_date === 'b') { ?> + <div class="subtitle"> + <?php if (FreshRSS_Context::$user_conf->show_feed_name === 'a') { ?> + <div class="website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>"> + <?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></a> + </div> + <?php + } + $authors = $this->entry->authors(); - if (!empty($authors) && is_array($authors)): - $first = true; - ?> - <div class="author"><?php - foreach ($authors as $author): - echo $first ? _t('gen.short.by_author') . ' ' : '· '; - $first = false; - ?> - <em><a href="<?= Minz_Url::display(Minz_Request::modifiedCurrentRequest( - ['search' => 'author:"' . htmlspecialchars_decode($author, ENT_QUOTES) . '"']) - ) ?>"><?= $author ?></a></em> - <?php endforeach; ?> - </div><?php endif; ?> - </div> + if (!empty($authors) && is_array($authors)) { + ?> + <div class="author"> + <?= _t('gen.short.by_author') ?> + <?php + foreach ($authors as $author) { + $href = Minz_Url::display(Minz_Request::modifiedCurrentRequest(['search' => 'author:"' . htmlspecialchars_decode($author, ENT_QUOTES) . '"'])); + ?> + <a href="<?= $href ?>" title="<?= _t('gen.action.filter') ?>"><?= $author ?></a> + <?php } ?> + </div> + <?php } ?> + <div class="date"><?= $this->entry->date() ?></div> + </div> + <?php } ?> + </header> <div class="text"><?php echo $lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content(); ?></div> - </div><?php + <?php + $display_authors_date = FreshRSS_Context::$user_conf->show_author_date === 'f' || FreshRSS_Context::$user_conf->show_author_date === 'b'; + $display_tags = FreshRSS_Context::$user_conf->show_tags === 'f' || FreshRSS_Context::$user_conf->show_tags === 'b'; - $this->renderHelper('index/normal/entry_bottom'); - - ?></div> + if ($display_authors_date || $display_tags) { + ?> + <footer> + <?php + if ($display_authors_date) { ?> + <div class="subtitle"> + <?php if (FreshRSS_Context::$user_conf->show_feed_name === 'a') { ?> + <div class="website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>"> + <?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></a> + </div> + <?php + } + $authors = $this->entry->authors(); + if (!empty($authors) && is_array($authors)) { + ?> + <div class="author"> + <?= _t('gen.short.by_author') ?> + <?php + foreach ($authors as $author) { + $href = Minz_Url::display(Minz_Request::modifiedCurrentRequest(['search' => 'author:"' . htmlspecialchars_decode($author, ENT_QUOTES) . '"'])); + ?> + <a href="<?= $href ?>" title="<?= _t('gen.action.filter') ?>"><?= $author ?></a> + <?php } ?> + </div> + <?php } ?> + <div class="date"><?= $this->entry->date() ?></div> + </div> + <?php + } + if ($display_tags) { ?> + <div class="tags"> + <?php + if (!empty($tags)) { + ?><?= _i('tag') ?><ul class="list-tags"><?php + foreach ($firstTags as $tag) { + ?><li class="item tag"><a class="link-tag" href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>">#<?= $tag ?></a></li><?php + } + if (!empty($remainingTags)) { ?> + <li class="item tag"> + <div class="dropdown"> + <div id="dropdown-tags3-<?= $this->entry->id() ?>" class="dropdown-target"></div> + <a class="dropdown-toggle" href="#dropdown-tags3-<?= $this->entry->id() ?>"><?= _i('down') ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-header"><?= _t('index.tag.related') ?></li> + <?php + foreach ($remainingTags as $tag) { + ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>"><?= $tag ?></a></li><?php + } ?> + </ul> + <a class="dropdown-close" href="#close">❌</a> + </div> + </li> + <?php + } ?> + </ul><?php + } ?> + </div> + <?php + } ?> + </footer> + <?php + } ?> + </div><footer><?php + $this->renderHelper('index/normal/entry_bottom'); + ?> + </footer></article> </div><?php endforeach; diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml index 3bd644367..c9ef7fbd9 100644 --- a/app/views/index/reader.phtml +++ b/app/views/index/reader.phtml @@ -9,6 +9,7 @@ call_user_func($this->callbackBeforeEntries, $this); $lazyload = FreshRSS_Context::$user_conf->lazyload; $content_width = FreshRSS_Context::$user_conf->content_width; +$MAX_TAGS_DISPLAYED = FreshRSS_Context::$user_conf->show_tags_max; ?> <main id="stream" class="reader"> @@ -27,52 +28,186 @@ $content_width = FreshRSS_Context::$user_conf->content_width; if ($item == null) { continue; } + $this->entry = $item; + + $tags = null; + $firstTags = array(); + $remainingTags = array(); + + if (FreshRSS_Context::$user_conf->show_tags == 'h' || FreshRSS_Context::$user_conf->show_tags == 'f' || FreshRSS_Context::$user_conf->show_tags == 'b') { + $tags = $this->entry->tags(); + if (!empty($tags)) { + if ($MAX_TAGS_DISPLAYED > 0) { + $firstTags = array_slice($tags, 0, $MAX_TAGS_DISPLAYED); + $remainingTags = array_slice($tags, $MAX_TAGS_DISPLAYED); + } else { + $firstTags = $tags; + } + } + } ?><div class="flux<?= !$item->isRead() ? ' not_read' : '' ?><?= $item->isFavorite() ? ' favorite' : '' ?>" id="flux_<?= $item->id() ?>"> - <div class="flux_content" dir="auto"> + <article class="flux_content" dir="auto"> + <div class="content <?= $content_width ?>"> - <?php - $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed(true); - $favoriteUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); - if ($item->isFavorite()) { - $favoriteUrl['params']['is_favorite'] = 0; - } - $readUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id())); - if ($item->isRead()) { - $readUrl['params']['is_read'] = 0; - } - ?> - <?php if (FreshRSS_Auth::hasAccess()) { ?> - <a class="read" href="<?= Minz_Url::display($readUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?= _i($item->isRead() ? 'read' : 'unread') ?></a> - <a class="bookmark" href="<?= Minz_Url::display($favoriteUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i($item->isFavorite() ? 'starred' : 'non-starred') ?></a> - <?php } ?> - <a class="website" href="<?= _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>"><?php - if (FreshRSS_Context::$user_conf->show_favicons): - ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php - endif; - ?><span><?= $feed->name() ?></span> - </a> - <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $item->link() ?>"><?= $item->title() ?></a></h1> + <header> + <?php + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache + if (empty($feed)) $feed = $item->feed(true); + $favoriteUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); + if ($item->isFavorite()) { + $favoriteUrl['params']['is_favorite'] = 0; + } + $readUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id())); + if ($item->isRead()) { + $readUrl['params']['is_read'] = 0; + } + ?> + <div class="article-header-topline"> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <a class="read" href="<?= Minz_Url::display($readUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?= _i($item->isRead() ? 'read' : 'unread') ?></a> + <a class="bookmark" href="<?= Minz_Url::display($favoriteUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i($item->isFavorite() ? 'starred' : 'non-starred') ?></a> + <?php } ?> + <?php if (FreshRSS_Context::$user_conf->show_feed_name === 't') { ?> + <a class="website" href="<?= _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>"> + <?php if (FreshRSS_Context::$user_conf->show_favicons): ?> + <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php + endif; ?><span><?= $feed->name() ?></span></a> + <?php } ?> + </div> + + <?php if (FreshRSS_Context::$user_conf->show_tags === 'h' || FreshRSS_Context::$user_conf->show_tags === 'b') { ?> + <div class="tags"> + <?php + if (!empty($tags)) { + ?><?= _i('tag') ?><ul class="list-tags"><?php + foreach ($firstTags as $tag) { + ?><li class="item tag"><a class="link-tag" href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>">#<?= $tag ?></a></li><?php + } - <div class="author"><?php - $authors = $item->authors(); - if (is_array($authors)): - $first = true; - foreach ($authors as $author): - echo $first ? _t('gen.short.by_author') . ' ' : '· '; - $first = false; - ?> -<em><a href="<?= Minz_Url::display(Minz_Request::modifiedCurrentRequest( - ['search' => 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))]) - ) ?>"><?= $author ?></a></em> + if (!empty($remainingTags)) { // more than 7 tags: show dropdown menu ?> + <li class="item tag"> + <div class="dropdown"> + <div id="dropdown-tags2-<?= $this->entry->id() ?>" class="dropdown-target"></div> + <a class="dropdown-toggle" href="#dropdown-tags2-<?= $this->entry->id() ?>"><?= _i('down') ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-header"><?= _t('index.tag.related') ?></li> + <?php + foreach ($remainingTags as $tag) { + ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>"><?= $tag ?></a></li><?php + } ?> + </ul> + <a class="dropdown-close" href="#close">❌</a> + </div> + </li> + <?php + } ?> + </ul><?php + } ?> + </div> + <?php } ?> + + <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $item->link() ?>"><?= $item->title() ?></a></h1> + <?php if (FreshRSS_Context::$user_conf->show_author_date === 'h' || FreshRSS_Context::$user_conf->show_author_date === 'b') { ?> + <div class="subtitle"> + <?php if (FreshRSS_Context::$user_conf->show_feed_name === 'a') { ?> + <div class="website"><a href="<?= _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>"> + <?php if (FreshRSS_Context::$user_conf->show_favicons): ?> + <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php + endif; ?><span><?= $feed->name() ?></span></a></div> + <?php } ?> + <div class="author"><?php + $authors = $item->authors(); + if (is_array($authors)) { + foreach ($authors as $author) { + ?> + <a href="<?= Minz_Url::display(Minz_Request::modifiedCurrentRequest(['search' => 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))])) ?>"> + <?= $author ?> + </a> + <?php + } + } + ?> + </div> + <div class="date"> + <time datetime="<?= $item->machineReadableDate() ?>"><?= $item->date() ?></time> + </div> + </div> + <?php } ?> + </header> + + <div class="text"> + <?= $item->content() ?> + </div> <?php - endforeach; - echo ' — '; - endif; - ?><time datetime="<?= $item->machineReadableDate() ?>"><?= $item->date() ?></time></div><div class="text"> - <?= $item->content() ?> - </div></div> - </div> + $display_authors_date = FreshRSS_Context::$user_conf->show_author_date === 'f' || FreshRSS_Context::$user_conf->show_author_date === 'b'; + $display_tags = FreshRSS_Context::$user_conf->show_tags === 'f' || FreshRSS_Context::$user_conf->show_tags === 'b'; + + if ($display_authors_date || $display_tags) { + ?> + <footer> + <?php if ($display_authors_date) { ?> + <div class="subtitle"> + <?php if (FreshRSS_Context::$user_conf->show_feed_name === 'a') { ?> + <div class="website"><a href="<?= _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>"> + <?php if (FreshRSS_Context::$user_conf->show_favicons): ?> + <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php + endif; ?><span><?= $feed->name() ?></span></a></div> + <?php } ?> + <div class="author"><?php + $authors = $item->authors(); + if (is_array($authors)) { + foreach ($authors as $author) { + ?> + <a href="<?= Minz_Url::display(Minz_Request::modifiedCurrentRequest(['search' => 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))])) ?>"> + <?= $author ?> + </a> + <?php + } + } + ?> + </div> + <div class="date"> + <time datetime="<?= $item->machineReadableDate() ?>"><?= $item->date() ?></time> + </div> + </div> + <?php + } + + if ($display_tags) { ?> + <div class="tags"> + <?php + if (!empty($tags)) { + ?><?= _i('tag') ?><ul class="list-tags"><?php + foreach ($firstTags as $tag) { + ?><li class="item tag"><a class="link-tag" href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>">#<?= $tag ?></a></li><?php + } + + if (!empty($remainingTags)) { // more than 7 tags: show dropdown menu ?> + <li class="item tag"> + <div class="dropdown"> + <div id="dropdown-tags2-<?= $this->entry->id() ?>" class="dropdown-target"></div> + <a class="dropdown-toggle" href="#dropdown-tags2-<?= $this->entry->id() ?>"><?= _i('down') ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-header"><?= _t('index.tag.related') ?></li> + <?php + foreach ($remainingTags as $tag) { + ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>" title="<?= _t('gen.action.filter') ?>"><?= $tag ?></a></li><?php + } ?> + </ul> + <a class="dropdown-close" href="#close">❌</a> + </div> + </li> + <?php + } ?> + </ul><?php + } ?> + </div> + <?php } ?> + </footer> + <?php + } ?> + </div> + </article> </div><?php endforeach; diff --git a/config-user.default.php b/config-user.default.php index 110b3466f..86f2ddf77 100644 --- a/config-user.default.php +++ b/config-user.default.php @@ -34,6 +34,10 @@ return array ( 'auto_load_more' => true, 'display_posts' => false, 'display_categories' => 'active', //{ active, remember, all, none } + 'show_tags' => '0', + 'show_tags_max' => '7', + 'show_author_date' => 'h', + 'show_feed_name' => 'a', 'hide_read_feeds' => true, 'onread_jump_next' => true, 'lazyload' => true, diff --git a/p/scripts/config.js b/p/scripts/config.js index e3a85df15..01cd15a26 100644 --- a/p/scripts/config.js +++ b/p/scripts/config.js @@ -19,12 +19,20 @@ function updateSelectInput(ev) { const input = document.getElementById(elem.dataset.name + '-input'); if (elem.selectedOptions[0].dataset.inputVisible == 'false') { formGroup.style.display = 'none'; - input.name = ''; - elem.name = elem.dataset.name; + if (input) { + input.name = ''; + } + if (elem.name == '') { + elem.name = elem.dataset.name; + } } else { formGroup.style.display = ''; - input.name = elem.dataset.name; - elem.name = ''; + if (input) { + input.name = elem.dataset.name; + } + if (elem.name === elem.dataset.name) { + elem.name = ''; + } } } diff --git a/p/scripts/main.js b/p/scripts/main.js index 461dc1b10..17c292b9f 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1043,7 +1043,7 @@ function init_stream(stream) { return ev.ctrlKey; } - el = ev.target.closest('.flux .content a'); + el = ev.target.closest('.flux .content .text a'); if (el) { if (!el.closest('div').classList.contains('author')) { el.target = '_blank'; diff --git a/p/themes/Ansum/_layout.scss b/p/themes/Ansum/_layout.scss index b94097f16..727ebecd4 100644 --- a/p/themes/Ansum/_layout.scss +++ b/p/themes/Ansum/_layout.scss @@ -143,10 +143,6 @@ text-align: center; } -#new-article:hover { - background: variables.$main-first-alt; -} - #new-article > a { line-height: 3em; font-weight: bold; @@ -155,6 +151,7 @@ #new-article > a:hover { text-decoration: none; + background: variables.$main-first-alt; } /*=== Day indication */ diff --git a/p/themes/Mapco/_layout.scss b/p/themes/Mapco/_layout.scss index 8e7c7aa98..0b37153a8 100644 --- a/p/themes/Mapco/_layout.scss +++ b/p/themes/Mapco/_layout.scss @@ -146,10 +146,6 @@ text-align: center; } -#new-article:hover { - background: variables.$main-first-alt; -} - #new-article > a { line-height: 3em; font-weight: bold; @@ -158,6 +154,7 @@ #new-article > a:hover { text-decoration: none; + background: variables.$main-first-alt; } /*=== Day indication */ diff --git a/p/themes/Origine/origine.css b/p/themes/Origine/origine.css index 636789c3f..4752159fc 100644 --- a/p/themes/Origine/origine.css +++ b/p/themes/Origine/origine.css @@ -844,7 +844,7 @@ a.btn { padding: 20px 10px; } -.content > h1.title > a { +.content h1.title > a { color: #000; } diff --git a/p/themes/Origine/origine.rtl.css b/p/themes/Origine/origine.rtl.css index f3905b069..0961a2e24 100644 --- a/p/themes/Origine/origine.rtl.css +++ b/p/themes/Origine/origine.rtl.css @@ -844,7 +844,7 @@ a.btn { padding: 20px 10px; } -.content > h1.title > a { +.content h1.title > a { color: #000; } diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css index 6ed321114..a51735dd8 100644 --- a/p/themes/base-theme/template.css +++ b/p/themes/base-theme/template.css @@ -1149,9 +1149,77 @@ a.website:hover .favicon { max-width: 550px; } -.content ul, -.content ol, -.content dd { +.content .article-header-topline { + margin-bottom: 0.75rem; +} + +.content > header, +.content > footer { + color: #666; + font-size: .9rem; +} + +.content > footer { + margin: 2rem 0 2rem; + padding-top: 1rem; + border-top: 2px solid #ccc; + clear: both; +} + +.content > footer .subtitle { + padding-bottom: 1rem; +} + +.content > header a, +.content > footer a { + color: #666; + text-decoration: none; +} + +.content > header a:hover, +.content > footer a:hover { + color: #0062be; + text-decoration: underline; +} + +.content > header .tags, +.content > footer .tags { + display: flex; + line-height: 1; +} + +.content > header .tags .icon, +.content > footer .tags .icon { + padding: 2px 10px 0 0; +} + +.content > header .tags .list-tags, +.content > footer .tags .list-tags { + margin: 0; + padding: 0; + display: inline-block; + list-style: none; +} + +.content > header .tags .list-tags .item.tag, +.content > footer .tags .list-tags .item.tag { + display: inline-block; + padding-right: 0.75em; + line-height: normal; +} + +.content > header .tags .list-tags .item.tag a.link-tag, +.content > footer .tags .list-tags .item.tag a.link-tag { + display: inline; +} + +.content > header h1 { + margin: 0.5em 0; +} + +.content .text ul, +.content .text ol, +.content .text dd { margin: 0 0 0 15px; padding: 0 0 5px 15px; } diff --git a/p/themes/base-theme/template.rtl.css b/p/themes/base-theme/template.rtl.css index df46eff21..9d52dac07 100644 --- a/p/themes/base-theme/template.rtl.css +++ b/p/themes/base-theme/template.rtl.css @@ -1149,9 +1149,77 @@ a.website:hover .favicon { max-width: 550px; } -.content ul, -.content ol, -.content dd { +.content .article-header-topline { + margin-bottom: 0.75rem; +} + +.content > header, +.content > footer { + color: #666; + font-size: .9rem; +} + +.content > footer { + margin: 2rem 0 2rem; + padding-top: 1rem; + border-top: 2px solid #ccc; + clear: both; +} + +.content > footer .subtitle { + padding-bottom: 1rem; +} + +.content > header a, +.content > footer a { + color: #666; + text-decoration: none; +} + +.content > header a:hover, +.content > footer a:hover { + color: #0062be; + text-decoration: underline; +} + +.content > header .tags, +.content > footer .tags { + display: flex; + line-height: 1; +} + +.content > header .tags .icon, +.content > footer .tags .icon { + padding: 2px 0 0 10px; +} + +.content > header .tags .list-tags, +.content > footer .tags .list-tags { + margin: 0; + padding: 0; + display: inline-block; + list-style: none; +} + +.content > header .tags .list-tags .item.tag, +.content > footer .tags .list-tags .item.tag { + display: inline-block; + padding-left: 0.75em; + line-height: normal; +} + +.content > header .tags .list-tags .item.tag a.link-tag, +.content > footer .tags .list-tags .item.tag a.link-tag { + display: inline; +} + +.content > header h1 { + margin: 0.5em 0; +} + +.content .text ul, +.content .text ol, +.content .text dd { margin: 0 15px 0 0; padding: 0 15px 5px 0; } |
