unreadDates.phtml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_ViewStats $this */
  4. $this->partial('aside_subscription');
  5. ?>
  6. <main class="post">
  7. <h1><?= _t('admin.stats.unread_dates') ?></h1>
  8. <form>
  9. <input type="hidden" name="c" value="stats" />
  10. <input type="hidden" name="a" value="unreadDates" />
  11. <select name="field" id="field">
  12. <option value="id" <?= Minz_Request::paramString('field') === 'id' ? 'selected="selected"' : '' ?>><?= _t('admin.stats.date_received') ?></option>
  13. <option value="date" <?= Minz_Request::paramString('field') === 'date' ? 'selected="selected"' : '' ?>><?= _t('admin.stats.date_published') ?></option>
  14. </select>
  15. <input type="number" name="max" id="max" value="<?= Minz_Request::paramInt('max') ?: 100 ?>" min="1" />
  16. <select name="granularity" id="granularity">
  17. <option value="day" <?= Minz_Request::paramString('granularity') === 'day' ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option>
  18. <option value="month" <?= Minz_Request::paramString('granularity') === 'month' ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option>
  19. <option value="year" <?= Minz_Request::paramString('granularity') === 'year' ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option>
  20. </select>
  21. <select name="min_priority" id="min_priority">
  22. <?php $currentPriority = Minz_Request::paramIntNull('min_priority'); ?>
  23. <option value=""><?= _t('sub.feed.priority._') ?></option>
  24. <option value="<?= FreshRSS_Feed::PRIORITY_IMPORTANT ?>" <?= $currentPriority === FreshRSS_Feed::PRIORITY_IMPORTANT ? 'selected="selected"' : '' ?>><?= _t('sub.feed.priority.important') ?></option>
  25. <option value="<?= FreshRSS_Feed::PRIORITY_MAIN_STREAM ?>" <?= $currentPriority === FreshRSS_Feed::PRIORITY_MAIN_STREAM ? 'selected="selected"' : '' ?>><?= _t('sub.feed.priority.main_stream') ?></option>
  26. <option value="<?= FreshRSS_Feed::PRIORITY_CATEGORY ?>" <?= $currentPriority === FreshRSS_Feed::PRIORITY_CATEGORY ? 'selected="selected"' : '' ?>><?= _t('sub.feed.priority.category') ?></option>
  27. <option value="<?= FreshRSS_Feed::PRIORITY_FEED ?>" <?= $currentPriority === FreshRSS_Feed::PRIORITY_FEED ? 'selected="selected"' : '' ?>><?= _t('sub.feed.priority.feed') ?></option>
  28. </select>
  29. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  30. </form>
  31. <table>
  32. <thead>
  33. <tr>
  34. <th>
  35. <?php if (Minz_Request::paramString('field') === 'date'): ?>
  36. <?= _t('admin.stats.date_published') ?>
  37. <?php else: ?>
  38. <?= _t('admin.stats.date_received') ?>
  39. <?php endif; ?>
  40. </th>
  41. <th><?= _t('admin.stats.nb_unreads') ?></th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <?php foreach ($this->unreadDates as $row): ?>
  46. <tr><?php /* TODO: Make that URL show all articles, including those with PRIORITY_ARCHIVED */ ?>
  47. <td><a href="<?= _url('index', 'index', 'search',
  48. (Minz_Request::paramString('field') === 'date' ? 'pubdate:' : 'date:') . $row['granularity']) ?>">
  49. <?= htmlspecialchars($row['granularity'], ENT_NOQUOTES, 'UTF-8') ?>
  50. </a></td>
  51. <td><?= format_number($row['unread_count']) ?></td>
  52. </tr>
  53. <?php endforeach; ?>
  54. </tbody>
  55. </table>
  56. </main>