diff options
| author | 2023-11-08 20:23:54 +0100 | |
|---|---|---|
| committer | 2023-11-08 20:23:54 +0100 | |
| commit | 348028a29043b7d1d0f80544c44f0454b2c375c3 (patch) | |
| tree | 8f01badaa6983341f27e8afb05e2e9d42992b9b0 /app/views | |
| parent | 7d26dcc8475e4c7c3f68358405e9074ed61e018c (diff) | |
New feature important feeds (#5782)
* New feature important feeds
* Fix PHPStan
* Initial style for important feeds + keep unread
* Change UI order
* Count important unread
* Never mark as read important feeds during scroll
* Fix i18n conf.iew.normal regression
* Fix reader view
* More fix reader view
* Create important.svg
* Fix title
* Fix counter
* Account for important during mark-all-as-read
* Fix underline colour
* 📌
* Changelog
---------
Co-authored-by: math-gh <>
Co-authored-by: maTh <1645099+math-GH@users.noreply.github.com>
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/helpers/feed/update.phtml | 7 | ||||
| -rw-r--r-- | app/views/index/normal.phtml | 13 | ||||
| -rw-r--r-- | app/views/index/reader.phtml | 8 | ||||
| -rw-r--r-- | app/views/subscription/index.phtml | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index a02634e32..680bc2399 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -80,13 +80,16 @@ <label class="group-name" for="priority"><?= _t('sub.feed.priority') ?></label> <div class="group-controls"> <select name="priority" id="priority" class="w50"> + <option value='<?= FreshRSS_Feed::PRIORITY_IMPORTANT ?>' <?php + if (FreshRSS_Feed::PRIORITY_IMPORTANT === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.important') ?></option> <option value='<?= FreshRSS_Feed::PRIORITY_MAIN_STREAM ?>' <?php if (FreshRSS_Feed::PRIORITY_MAIN_STREAM === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.main_stream') ?></option> - <option value='<?= FreshRSS_Feed::PRIORITY_NORMAL ?>' <?php - if (FreshRSS_Feed::PRIORITY_NORMAL === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.normal') ?></option> + <option value='<?= FreshRSS_Feed::PRIORITY_CATEGORY ?>' <?php + if (FreshRSS_Feed::PRIORITY_CATEGORY === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.category') ?></option> <option value='<?= FreshRSS_Feed::PRIORITY_ARCHIVED ?>' <?php if (FreshRSS_Feed::PRIORITY_ARCHIVED === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.archived') ?></option> </select> + <?= _i('important') ?> </div> </div> diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index c99cf07e7..aee2ea2a2 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -37,14 +37,9 @@ $today = @strtotime('today'); } $this->entry = $item; - // We most likely already have the feed object in cache - $this->feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feedId()); - if ($this->feed == null) { - $this->feed = $this->entry->feed() ?: null; - if ($this->feed == null) { - $this->feed = FreshRSS_Feed::example(); - } - } + // We most likely already have the feed object in cache, otherwise make a request + $this->feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feedId()) ?? + $this->entry->feed() ?? FreshRSS_Feed::example(); if ($display_today && $this->entry->isDay(FreshRSS_Days::TODAY, $today)) { ?><div class="day" id="day_today"><?php @@ -71,8 +66,10 @@ $today = @strtotime('today'); } ?><div class="flux<?= !$this->entry->isRead() ? ' not_read' : '' ?><?= $this->entry->isFavorite() ? ' favorite' : '' + ?><?= $this->feed->priority() >= FreshRSS_Feed::PRIORITY_IMPORTANT ? ' keep_unread ' : '' ?>" id="flux_<?= $this->entry->id() ?>" data-feed="<?= $this->feed->id() + ?>" data-priority="<?= $this->feed->priority() ?>"><?php $this->renderHelper('index/normal/entry_header'); diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml index af5caccdc..014b1ab42 100644 --- a/app/views/index/reader.phtml +++ b/app/views/index/reader.phtml @@ -45,15 +45,15 @@ $MAX_TAGS_DISPLAYED = FreshRSS_Context::$user_conf->show_tags_max; } } } - ?><div class="flux<?= !$item->isRead() ? ' not_read' : '' ?><?= $item->isFavorite() ? ' favorite' : '' ?>" id="flux_<?= $item->id() ?>"> + + //We most likely already have the feed object in cache, otherwise make a request + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feedId()) ?? $item->feed() ?? FreshRSS_Feed::example(); + ?><div class="flux<?= !$item->isRead() ? ' not_read' : '' ?><?= $item->isFavorite() ? ' favorite' : '' ?>" id="flux_<?= $item->id() ?>" data-priority="<?= $feed->priority() ?>"> <article class="flux_content" dir="auto"> <div class="content <?= $content_width ?>"> <header> <?php - $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feedId()); //We most likely already have the feed object in cache - if ($feed == null) $feed = $item->feed(); - if ($feed == null) continue; $favoriteUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); if ($item->isFavorite()) { $favoriteUrl['params']['is_favorite'] = 0; diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 7ee7a3188..6881d0a8d 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -61,7 +61,7 @@ $mute_class = $feed->mute() ? ' mute' : ''; ?> <li class="item feed<?= $error_class, $empty_class, $mute_class ?>" title="<?= $error_title, $empty_title ?>" - draggable="true" data-feed-id="<?= $feed->id() ?>"> + draggable="true" data-feed-id="<?= $feed->id() ?>" data-priority="<?= $feed->priority() ?>"> <a class="configure open-slider" href="<?= _url('subscription', 'feed', 'id', $feed->id()) ?>" title="<?= _t('gen.action.manage') ?>"><?= _i('configure') ?></a> <?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?> <span class="item-title"><?= $feed->name() ?></span> |
