repartition.phtml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php $this->partial('aside_stats'); ?>
  2. <div class="post ">
  3. <div class="link-back-wrapper">
  4. <a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
  5. </div>
  6. <h1><?= _t('admin.stats.repartition') ?></h1>
  7. <select id="feed_select" class="select-change">
  8. <option data-url="<?= _url('stats', 'repartition') ?>"><?= _t('admin.stats.all_feeds') ?></option>
  9. <?php foreach ($this->categories as $category) {
  10. $feeds = $category->feeds();
  11. if (!empty($feeds)) {
  12. echo '<optgroup label="', $category->name(), '">';
  13. foreach ($feeds as $feed) {
  14. if ($this->feed && $feed->id() == $this->feed->id()) {
  15. echo '<option value="', $feed->id(), '" selected="selected" data-url="',
  16. _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>';
  17. } else {
  18. echo '<option value="', $feed->id(), '" data-url="',
  19. _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>';
  20. }
  21. }
  22. echo '</optgroup>';
  23. }
  24. }?>
  25. </select>
  26. <?php if ($this->feed) {?>
  27. <a class="btn" href="<?= _url('subscription', 'index', 'id', $this->feed->id()) ?>">
  28. <?= _i('configure') ?> <?= _t('gen.action.manage') ?>
  29. </a>
  30. <?php }?>
  31. <div class="stat">
  32. <table>
  33. <tr>
  34. <th><?= _t('admin.stats.status_total') ?></th>
  35. <th><?= _t('admin.stats.status_read') ?></th>
  36. <th><?= _t('admin.stats.status_unread') ?></th>
  37. <th><?= _t('admin.stats.status_favorites') ?></th>
  38. </tr>
  39. <tr>
  40. <td class="numeric"><?= $this->repartition['total'] ?></td>
  41. <td class="numeric"><?= $this->repartition['count_reads'] ?></td>
  42. <td class="numeric"><?= $this->repartition['count_unreads'] ?></td>
  43. <td class="numeric"><?= $this->repartition['count_favorites'] ?></td>
  44. </tr>
  45. </table>
  46. </div>
  47. <div class="stat">
  48. <h2><?= _t('admin.stats.entry_per_hour', $this->averageHour) ?></h2>
  49. <div id="statsEntryPerHour" class="statGraph"></div>
  50. </div>
  51. <div class="stat half">
  52. <h2><?= _t('admin.stats.entry_per_day_of_week', $this->averageDayOfWeek) ?></h2>
  53. <div id="statsEntryPerDayOfWeek" class="statGraph"></div>
  54. </div>
  55. <div class="stat half">
  56. <h2><?= _t('admin.stats.entry_per_month', $this->averageMonth) ?></h2>
  57. <div id="statsEntryPerMonth" class="statGraph"></div>
  58. </div>
  59. </div>
  60. <script id="jsonRepartition" type="application/json"><?php
  61. echo htmlspecialchars(json_encode(array(
  62. 'repartitionHour' => $this->repartitionHour,
  63. 'repartitionDayOfWeek' => $this->repartitionDayOfWeek,
  64. 'days' => $this->days,
  65. 'repartitionMonth' => $this->repartitionMonth,
  66. 'months' => $this->months,
  67. ), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES, 'UTF-8');
  68. ?></script>
  69. <script src="../scripts/repartition.js?<?= @filemtime(PUBLIC_PATH . '/scripts/repartition.js') ?>"></script>