unreadDates.phtml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  22. </form>
  23. <table>
  24. <thead>
  25. <tr>
  26. <th>
  27. <?php if (Minz_Request::paramString('field') === 'date'): ?>
  28. <?= _t('admin.stats.date_published') ?>
  29. <?php else: ?>
  30. <?= _t('admin.stats.date_received') ?>
  31. <?php endif; ?>
  32. </th>
  33. <th><?= _t('admin.stats.nb_unreads') ?></th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. <?php foreach ($this->unreadDates as $row): ?>
  38. <tr><?php /* TODO: Make that URL show all articles, including those with PRIORITY_ARCHIVED */ ?>
  39. <td><a href="<?= _url('index', 'index', 'search',
  40. (Minz_Request::paramString('field') === 'date' ? 'pubdate:' : 'date:') . $row['granularity']) ?>">
  41. <?= htmlspecialchars($row['granularity'], ENT_NOQUOTES, 'UTF-8') ?>
  42. </a></td>
  43. <td><?= format_number($row['unread_count']) ?></td>
  44. </tr>
  45. <?php endforeach; ?>
  46. </tbody>
  47. </table>
  48. </main>