repartition.phtml 2.8 KB

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