aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/index/normal.phtml31
-rw-r--r--app/views/index/reader.phtml1
-rw-r--r--app/views/stats/idle.phtml2
3 files changed, 13 insertions, 21 deletions
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index cc54d10fd..9f2bbdbcc 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -8,9 +8,7 @@ if (!Minz_Request::paramBoolean('ajax')) {
call_user_func($this->callbackBeforeEntries, $this);
-$display_today = FreshRSS_Context::$sort === 'id';
-$display_yesterday = $display_today;
-$display_others = $display_today;
+$last_transition = '';
$useKeepUnreadImportant = !FreshRSS_Context::isImportant() && !FreshRSS_Context::isFeed();
$today = @strtotime('today');
@@ -59,26 +57,19 @@ $today = @strtotime('today');
// We most likely already have the feed object in cache, otherwise make a request
$this->feed = FreshRSS_Category::findFeed($this->categories, $this->entry->feedId()) ??
$this->entry->feed() ?? FreshRSS_Feed::default();
+ $this->entry->_feed($this->feed);
- if ($display_today && $this->entry->isDay(FreshRSS_Days::TODAY, $today)) {
- ?><div class="day" id="day_today"><?= _t('index.feed.received.today') ?>
- <span class="date"> — <?= timestamptodate(time(), false) ?></span>
+ if ($last_transition !== ($transition = FreshRSS_index_Controller::transition($this->entry, FreshRSS_Context::$sort))) {
+ $last_transition = $transition;
+ ?><div class="transition">
+ <span class="transition-value">
+ <?php if (FreshRSS_Context::$sort === 'f.name' && FreshRSS_Context::userConf()->show_favicons): ?>
+ <img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" />
+ <?php endif;?>
+ <?= $transition ?>
+ </span>
<span class="name"><?= FreshRSS_Context::$name ?></span>
</div><?php
- $display_today = false;
- }
- if ($display_yesterday && $this->entry->isDay(FreshRSS_Days::YESTERDAY, $today)) {
- ?><div class="day" id="day_yesterday"><?= _t('index.feed.received.yesterday') ?>
- <span class="date"> — <?= timestamptodate(time() - 86400, false) ?></span>
- <span class="name"><?= FreshRSS_Context::$name ?></span>
- </div><?php
- $display_yesterday = false;
- }
- if ($display_others && $this->entry->isDay(FreshRSS_Days::BEFORE_YESTERDAY, $today)) {
- ?><div class="day" id="day_before_yesterday"><?= _t('index.feed.received.before_yesterday') ?>
- <span class="name"><?= FreshRSS_Context::$name ?></span>
- </div><?php
- $display_others = false;
}
?><div class="flux<?= !$this->entry->isRead() ? ' not_read' : ''
?><?= $this->entry->isFavorite() ? ' favorite' : ''
diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml
index 49321f9f5..d76af2dc7 100644
--- a/app/views/index/reader.phtml
+++ b/app/views/index/reader.phtml
@@ -31,6 +31,7 @@ $useKeepUnreadImportant = !FreshRSS_Context::isImportant() && !FreshRSS_Context:
//We most likely already have the feed object in cache, otherwise make a request
$this->feed = FreshRSS_Category::findFeed($this->categories, $this->entry->feedId()) ?? $this->entry->feed() ?? FreshRSS_Feed::default();
+ $this->entry->_feed($this->feed);
?><div class="flux<?= !$this->entry->isRead() ? ' not_read' : ''
?><?= $this->entry->isFavorite() ? ' favorite' : ''
?><?= $useKeepUnreadImportant && ($this->feed->priority() >= FreshRSS_Feed::PRIORITY_IMPORTANT) ? ' keep_unread ' : ''
diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml
index b01e246fd..4e2a4eed7 100644
--- a/app/views/stats/idle.phtml
+++ b/app/views/stats/idle.phtml
@@ -41,7 +41,7 @@
<li class="item feed<?= $error_class, $empty_class, $mute_class ?>" title="<?= $error_title, $empty_title ?>">
<a class="configure open-slider" href="<?= _url('stats', 'feed', 'id', $feedInPeriod['id'], 'sub', 'idle') ?>" title="<?= _t('gen.action.manage') ?>"><?= _i('configure') ?></a><?php
if (FreshRSS_Context::userConf()->show_favicons): ?><img class="favicon" src="<?= $feedInPeriod['favicon'] ?>" alt="✇" loading="lazy" /><?php
- endif; ?><span title="<?= timestamptodate((int)($feedInPeriod['last_date']), false) ?>"><?= $feedInPeriod['name'] ?>
+ endif; ?><span title="<?= timestamptodate((int)($feedInPeriod['last_date']), hour: false) ?>"><?= $feedInPeriod['name'] ?>
(<?= _t('admin.stats.number_entries', $feedInPeriod['nb_articles']) ?>)</span>
</li>
<?php } ?>