aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-03-21 12:51:26 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-21 12:51:26 +0100
commit6f018cc674fe049ba49ebf4d89ab386bc29a9327 (patch)
tree959cef5b5ee00c6f073b61d2b613b8e7ffcde8c6
parent4d153eeaf85905e8402cc8d175f202967d909020 (diff)
Show errored, empty, muted feeds in statistics (#4276)
-rw-r--r--app/Controllers/statsController.php2
-rw-r--r--app/views/stats/idle.phtml21
2 files changed, 15 insertions, 8 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index 170d35d6f..a50a35343 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -131,6 +131,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
* - last week
*/
public function idleAction() {
+ $feed_dao = FreshRSS_Factory::createFeedDao();
$statsDAO = FreshRSS_Factory::createStatsDAO();
$feeds = $statsDAO->calculateFeedLastDate();
$idleFeeds = array(
@@ -190,6 +191,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
}
$this->view->idleFeeds = $idleFeeds;
+ $this->view->feeds = $feed_dao->listFeeds();
$id = Minz_Request::param('id');
$this->view->displaySlider = false;
diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml
index 6b2141ba2..36ea32a17 100644
--- a/app/views/stats/idle.phtml
+++ b/app/views/stats/idle.phtml
@@ -16,19 +16,24 @@
'php', true
);
$nothing = true;
- foreach ($this->idleFeeds as $period => $feeds) {
- if (!empty($feeds)) {
+ foreach ($this->idleFeeds as $period => $feedsInPeriod) {
+ if (!empty($feedsInPeriod)) {
$nothing = false;
?>
<div class="box">
<div class="box-title"><?= _t('gen.date.' . $period) ?></div>
<ul class="box-content">
- <?php foreach ($feeds as $feed) { ?>
- <li class="item feed">
- <a class="configure open-slider" href="<?= _url('stats', 'feed', 'id', $feed['id'], 'sub', 'idle') ?>" 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 title="<?= timestamptodate($feed['last_date'], false) ?>"><?= $feed['name'] ?>
- (<?= _t('admin.stats.number_entries', $feed['nb_articles']) ?>)</span>
+ <?php
+ foreach ($feedsInPeriod as $feedInPeriod) {
+ $feed = $this->feeds[$feedInPeriod['id']] ?? null;
+ $error = $feed == null || $feed->inError() ? ' error' : '';
+ $empty = $feed != null && $feed->nbEntries() == 0 ? ' empty' : '';
+ ?>
+ <li class="item feed<?= $error, $empty, $feed->mute() ? ' mute' : '' ?>">
+ <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::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feedInPeriod['favicon'] ?>" alt="✇" loading="lazy" /><?php endif; ?>
+ <span title="<?= timestamptodate($feedInPeriod['last_date'], false) ?>"><?= $feedInPeriod['name'] ?>
+ (<?= _t('admin.stats.number_entries', $feedInPeriod['nb_articles']) ?>)</span>
</li>
<?php } ?>
</ul>