diff options
| author | 2022-07-17 22:54:24 +0200 | |
|---|---|---|
| committer | 2022-07-17 22:54:24 +0200 | |
| commit | b2e46d62154faf28c3c17e2b775c47d11e38ee56 (patch) | |
| tree | 69df7287cdc30cee103cdeed43f5a43bbfb086af /app/views | |
| 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>
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/reading.phtml | 46 | ||||
| -rw-r--r-- | app/views/configure/system.phtml | 2 | ||||
| -rw-r--r-- | app/views/index/normal.phtml | 185 | ||||
| -rw-r--r-- | app/views/index/reader.phtml | 219 |
4 files changed, 379 insertions, 73 deletions
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; |
