repartition.phtml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php $this->partial('aside_subscription'); ?>
  2. <main 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-grid">
  32. <div class="stat">
  33. <table>
  34. <tr>
  35. <th><?= _t('admin.stats.status_total') ?></th>
  36. <th><?= _t('admin.stats.status_read') ?></th>
  37. <th><?= _t('admin.stats.status_unread') ?></th>
  38. <th><?= _t('admin.stats.status_favorites') ?></th>
  39. </tr>
  40. <tr>
  41. <td class="numeric"><?= $this->repartition['total'] ?></td>
  42. <td class="numeric"><?= $this->repartition['count_reads'] ?></td>
  43. <td class="numeric"><?= $this->repartition['count_unreads'] ?></td>
  44. <td class="numeric"><?= $this->repartition['count_favorites'] ?></td>
  45. </tr>
  46. </table>
  47. </div>
  48. <div class="stat">
  49. <h2><?= _t('admin.stats.entry_per_hour', $this->averageHour) ?></h2>
  50. <div>
  51. <canvas id="statsEntriesPerHour"></canvas>
  52. <script class="jsonData-stats" type="application/json">
  53. <?php
  54. echo json_encode(array(
  55. 'canvasID' => 'statsEntriesPerHour',
  56. 'charttype' => 'bar',
  57. 'data' => $this->repartitionHour,
  58. 'label' => _t('admin.stats.entry_count'),
  59. 'xAxisLabels' => $this->hours24Labels
  60. ), JSON_UNESCAPED_UNICODE);
  61. ?></script>
  62. </div>
  63. </div>
  64. <div class="stat half">
  65. <h2><?= _t('admin.stats.entry_per_day_of_week', $this->averageDayOfWeek) ?></h2>
  66. <div>
  67. <canvas id="statsEntriesPerDayOfWeek"></canvas>
  68. <script class="jsonData-stats" type="application/json">
  69. <?php
  70. echo json_encode(array(
  71. 'canvasID' => 'statsEntriesPerDayOfWeek',
  72. 'charttype' => 'bar',
  73. 'data' => $this->repartitionDayOfWeek,
  74. 'label' => _t('admin.stats.entry_count'),
  75. 'xAxisLabels' => $this->days,
  76. ), JSON_UNESCAPED_UNICODE);
  77. ?></script>
  78. </div>
  79. </div>
  80. <div class="stat half">
  81. <h2><?= _t('admin.stats.entry_per_month', $this->averageMonth) ?></h2>
  82. <div>
  83. <canvas id="statsEntriesPerMonth"></canvas>
  84. <script class="jsonData-stats" type="application/json">
  85. <?php
  86. echo json_encode(array(
  87. 'canvasID' => 'statsEntriesPerMonth',
  88. 'charttype' => 'bar',
  89. 'data' => $this->repartitionMonth,
  90. 'label' => _t('admin.stats.entry_count'),
  91. 'xAxisLabels' => $this->months,
  92. ), JSON_UNESCAPED_UNICODE);
  93. ?></script>
  94. </div>
  95. </div>
  96. </div>
  97. </main>
  98. <script src="../scripts/statsWithChartjs.js?<?= @filemtime(PUBLIC_PATH . '/scripts/statsWithChartjs.js') ?>"></script>