aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar maTh <1645099+math-GH@users.noreply.github.com> 2024-06-13 16:40:54 +0200
committerGravatar GitHub <noreply@github.com> 2024-06-13 16:40:54 +0200
commit20f13312d15a1408365b859b14621364009990cd (patch)
tree7519ad4014f7000e24c0c95862d5adafc2b31317 /app/views
parent35ee123dda654facadf82037675c21ca215d7fec (diff)
Reading view: action icons position (#6297)
* add configs in reading * implementation into the reading view * CSS * i18n * Credits to joshka * Update article.phtml * fix * fix * <br /> * Update app/i18n/fr/conf.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update app/i18n/en/conf.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * fix French * show_articleicons => show_article_icons * Update app/i18n/en/conf.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update app/i18n/en-us/conf.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/reading.phtml9
-rw-r--r--app/views/helpers/index/article.phtml83
2 files changed, 66 insertions, 26 deletions
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index e475b220c..8df461ef8 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -137,6 +137,15 @@
</div>
</div>
<div class="form-group">
+ <label class="group-name" for="show_article_icons"><?= _t('conf.reading.article.icons') ?></label>
+ <div class="group-controls">
+ <select name="show_article_icons" id="show_article_icons" data-leave-validation="<?= FreshRSS_Context::userConf()->show_article_icons ?>">
+ <option value="t" <?= FreshRSS_Context::userConf()->show_article_icons === 't' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.icons.above_title') ?></option>
+ <option value="a" <?= FreshRSS_Context::userConf()->show_article_icons === 'a' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.icons.with_authors') ?></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::userConf()->show_tags ?>">
diff --git a/app/views/helpers/index/article.phtml b/app/views/helpers/index/article.phtml
index bfdfdb8d1..bdc108f1e 100644
--- a/app/views/helpers/index/article.phtml
+++ b/app/views/helpers/index/article.phtml
@@ -1,4 +1,5 @@
<?php
+ // used only in Reading view and html.phtml
declare(strict_types=1);
/** @var FreshRSS_View $this */
$entry = $this->entry;
@@ -17,16 +18,32 @@
$readUrl['params']['is_read'] = '0';
}
?>
- <div class="article-header-topline">
+ <div class="article-header-topline horizontal-list">
<?php if (FreshRSS_Auth::hasAccess()) { ?>
- <a class="read" href="<?= Minz_Url::display($readUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?= _i($entry->isRead() ? 'read' : 'unread') ?></a>
- <a class="bookmark" href="<?= Minz_Url::display($favoriteUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i($entry->isFavorite() ? 'starred' : 'non-starred') ?></a>
+ <?php if (FreshRSS_Context::userConf()->topline_read && FreshRSS_Context::userConf()->show_article_icons == 't') { ?>
+ <div class="item manage">
+ <a class="read" href="<?= Minz_Url::display($readUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?= _i($entry->isRead() ? 'read' : 'unread') ?></a>
+ </div>
+ <?php } ?>
+ <?php if (FreshRSS_Context::userConf()->topline_favorite && FreshRSS_Context::userConf()->show_article_icons == 't') { ?>
+ <div class="item manage">
+ <a class="bookmark" href="<?= Minz_Url::display($favoriteUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i($entry->isFavorite() ? 'starred' : 'non-starred') ?></a>
+ </div>
+ <?php } ?>
<?php } ?>
- <?php if (FreshRSS_Context::userConf()->show_feed_name === 't') { ?>
- <a class="website" href="<?= _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
- <?php if (FreshRSS_Context::userConf()->show_favicons): ?>
- <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php
- endif; ?><span><?= $feed->name() ?></span></a>
+ <div class="item">
+ <?php if (FreshRSS_Context::userConf()->show_feed_name === 't') { ?>
+ <a class="website" href="<?= _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
+ <?php if (FreshRSS_Context::userConf()->show_favicons): ?>
+ <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php
+ endif; ?><span><?= $feed->name() ?></span></a>
+ <?php } ?>
+ </div>
+ <?php
+ if (FreshRSS_Context::userConf()->topline_link && FreshRSS_Context::userConf()->show_article_icons == 't') { ?>
+ <div class="item link">
+ <a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a>
+ </div>
<?php } ?>
</div>
@@ -35,24 +52,31 @@
$this->renderHelper('index/tags');
}
?>
-
<h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $entry->link() ?>"><?= $entry->title() ?></a></h1>
- <?php if (FreshRSS_Context::userConf()->show_author_date === 'h' || FreshRSS_Context::userConf()->show_author_date === 'b') { ?>
- <div class="subtitle">
- <?php if (FreshRSS_Context::userConf()->show_feed_name === 'a') { ?>
- <div class="website">
- <a href="<?= $this->internal_rendering ? $feed->website() : _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
+ <?php if (in_array(FreshRSS_Context::userConf()->show_author_date, ['h','b'], true)) { ?>
+ <div class="subtitle horizontal-list">
+ <?php if (FreshRSS_Auth::hasAccess()) { ?>
+ <?php if (FreshRSS_Context::userConf()->topline_read && FreshRSS_Context::userConf()->show_article_icons == 'a') { ?>
+ <div class="item manage">
+ <a class="read" href="<?= Minz_Url::display($readUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?= _i($entry->isRead() ? 'read' : 'unread') ?></a>
+ </div>
+ <?php } ?>
+ <?php if (FreshRSS_Context::userConf()->topline_favorite && FreshRSS_Context::userConf()->show_article_icons == 'a') { ?>
+ <div class="item manage">
+ <a class="bookmark" href="<?= Minz_Url::display($favoriteUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i($entry->isFavorite() ? 'starred' : 'non-starred') ?></a>
+ </div>
+ <?php } ?>
+ <?php } ?>
+ <div class="item">
+ <?php if (FreshRSS_Context::userConf()->show_feed_name === 'a') { ?>
+ <span class="website"><a href="<?= $this->internal_rendering ? $feed->website() : _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
<?php if (FreshRSS_Context::userConf()->show_favicons): ?>
<img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php
- endif; ?><span><?= $feed->name() ?></span>
- </a>
- </div>
- <?php }
-
- $authors = $entry->authors();
- if (!empty($authors) && is_array($authors)) {
- ?>
- <div class="author">
+ endif; ?><span><?= $feed->name() ?></span></a></span>
+ <?php }
+ $authors = $entry->authors();
+ if (!empty($authors) && is_array($authors)) { ?>
+ <div class="author">
<?= _t('gen.short.by_author') ?>
<?php
foreach ($authors as $author) {
@@ -60,11 +84,18 @@
?>
<a href="<?= $href ?>" title="<?= _t('gen.action.filter') ?>"><?= $author ?></a>
<?php } ?>
- </div>
- <?php } ?>
- <div class="date">
+ </div>
+ <?php } ?>
+ </div>
+ <div class="item date">
<time datetime="<?= $entry->machineReadableDate() ?>"><?= $entry->date() ?></time>
</div>
+ <?php
+ if (FreshRSS_Context::userConf()->topline_link && FreshRSS_Context::userConf()->show_article_icons == 'a') { ?>
+ <div class="item link">
+ <a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a>
+ </div>
+ <?php } ?>
</div>
<?php } ?>
</header>