Explorar o código

Fix important articles on reader view (#7602)

fix https://github.com/FreshRSS/FreshRSS/issues/7601
Alexandre Alapetite hai 10 meses
pai
achega
648eddaf13
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      app/views/index/reader.phtml

+ 10 - 3
app/views/index/reader.phtml

@@ -9,6 +9,7 @@ if (!Minz_Request::paramBoolean('ajax')) {
 call_user_func($this->callbackBeforeEntries, $this);
 
 $lazyload = FreshRSS_Context::userConf()->lazyload;
+$useKeepUnreadImportant = !FreshRSS_Context::isImportant() && !FreshRSS_Context::isFeed();
 ?>
 <main id="stream" class="reader">
 	<h1 class="title_hidden"><?= _t('conf.reading.view.reader') ?></h1>
@@ -29,9 +30,15 @@ $lazyload = FreshRSS_Context::userConf()->lazyload;
 		$nbEntries++;
 
 		//We most likely already have the feed object in cache, otherwise make a request
-		$this->feed = FreshRSS_Category::findFeed($this->categories, $entry->feedId()) ?? $entry->feed() ?? FreshRSS_Feed::default();
-	?><div class="flux<?= !$entry->isRead() ? ' not_read' : '' ?><?= $entry->isFavorite() ? ' favorite' : '' ?>" id="flux_<?= $entry->id() ?>" data-priority="<?= $this->feed->priority() ?>">
-		<?php $this->renderHelper('index/article'); ?>
+		$this->feed = FreshRSS_Category::findFeed($this->categories, $this->entry->feedId()) ?? $this->entry->feed() ?? FreshRSS_Feed::default();
+	?><div class="flux<?= !$this->entry->isRead() ? ' not_read' : ''
+		?><?= $this->entry->isFavorite() ? ' favorite' : ''
+		?><?= $useKeepUnreadImportant && ($this->feed->priority() >= FreshRSS_Feed::PRIORITY_IMPORTANT) ? ' keep_unread ' : ''
+		?>" id="flux_<?= $this->entry->id()
+		?>" data-entry="<?= $this->entry->id()
+		?>" data-feed="<?= $this->feed->id()
+		?>" data-priority="<?= $this->feed->priority()
+		?>"><?php $this->renderHelper('index/article'); ?>
 	</div><?php
 	endforeach;