diff options
Diffstat (limited to 'app/views/index/normal.phtml')
| -rw-r--r-- | app/views/index/normal.phtml | 31 |
1 files changed, 11 insertions, 20 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' : '' |
