index.phtml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.main') ?></h1>
  7. <div class="stat-grid">
  8. <div class="stat half">
  9. <h2><?= _t('admin.stats.entry_repartition') ?></h2>
  10. <table>
  11. <thead>
  12. <tr>
  13. <th> </th>
  14. <th><?= _t('admin.stats.main_stream') ?></th>
  15. <th><?= _t('admin.stats.all_feeds') ?></th>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. <tr>
  20. <th><?= _t('admin.stats.status_total') ?></th>
  21. <td class="numeric"><?= format_number($this->repartition['main_stream']['total']) ?></td>
  22. <td class="numeric"><?= format_number($this->repartition['all_feeds']['total']) ?></td>
  23. </tr>
  24. <tr>
  25. <th><?= _t('admin.stats.status_read') ?></th>
  26. <td class="numeric"><?= format_number($this->repartition['main_stream']['count_reads']) ?></td>
  27. <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_reads']) ?></td>
  28. </tr>
  29. <tr>
  30. <th><?= _t('admin.stats.status_unread') ?></th>
  31. <td class="numeric"><?= format_number($this->repartition['main_stream']['count_unreads']) ?></td>
  32. <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_unreads']) ?></td>
  33. </tr>
  34. <tr>
  35. <th><?= _t('admin.stats.status_favorites') ?></th>
  36. <td class="numeric"><?= format_number($this->repartition['main_stream']['count_favorites']) ?></td>
  37. <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_favorites']) ?></td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div><!--
  42. --><div class="stat half">
  43. <h2><?= _t('admin.stats.top_feed') ?></h2>
  44. <table>
  45. <thead>
  46. <tr>
  47. <th><?= _t('admin.stats.feed') ?></th>
  48. <th><?= _t('admin.stats.category') ?></th>
  49. <th><?= _t('admin.stats.entry_count') ?></th>
  50. <th><?= _t('admin.stats.percent_of_total') ?></th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. <?php foreach ($this->topFeed as $feed) { ?>
  55. <tr>
  56. <td><a href="<?= _url('stats', 'repartition', 'id', $feed['id']) ?>"><?= $feed['name'] ?></a></td>
  57. <td><?= $feed['category'] ?></td>
  58. <td class="numeric"><?= format_number($feed['count']) ?></td>
  59. <td class="numeric"><?= format_number($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1) ?></td>
  60. </tr>
  61. <?php } ?>
  62. </tbody>
  63. </table>
  64. </div>
  65. <div class="stat">
  66. <h2><?= _t('admin.stats.entry_per_day') ?></h2>
  67. <div>
  68. <canvas id="statsEntriesPerDay"></canvas>
  69. <script class="jsonData-stats" type="application/json">
  70. <?php
  71. echo json_encode(array(
  72. 'canvasID' => 'statsEntriesPerDay',
  73. 'charttype' => 'barWithAverage',
  74. 'labelBarChart' => _t('admin.stats.entry_count'),
  75. 'dataBarChart' => $this->entryCount,
  76. 'labelAverage' => 'Average ('.$this->average.')',
  77. 'dataAverage' => $this->average,
  78. 'xAxisLabels' => $this->last30DaysLabels,
  79. ), JSON_UNESCAPED_UNICODE);
  80. ?></script>
  81. </div>
  82. </div>
  83. <div class="stat half">
  84. <h2><?= _t('admin.stats.feed_per_category') ?></h2>
  85. <div>
  86. <canvas id="statsFeedsPerCategory"></canvas>
  87. <script class="jsonData-stats" type="application/json">
  88. <?php
  89. echo json_encode(array(
  90. 'canvasID' => 'statsFeedsPerCategory',
  91. 'charttype' => 'doughnut',
  92. 'data' => $this->feedByCategory['data'],
  93. 'labels' => $this->feedByCategory['label'],
  94. ), JSON_UNESCAPED_UNICODE);
  95. ?></script>
  96. </div>
  97. </div>
  98. <div class="stat half">
  99. <h2><?= _t('admin.stats.entry_per_category') ?></h2>
  100. <div>
  101. <canvas id="statsEntriesPerCategory"></canvas>
  102. <script class="jsonData-stats" type="application/json">
  103. <?php
  104. echo json_encode(array(
  105. 'canvasID' => 'statsEntriesPerCategory',
  106. 'charttype' => 'doughnut',
  107. 'data' => $this->entryByCategory['data'],
  108. 'labels' => $this->entryByCategory['label'],
  109. ), JSON_UNESCAPED_UNICODE);
  110. ?></script>
  111. </div>
  112. </div>
  113. </div>
  114. </main>
  115. <script src="../scripts/statsWithChartjs.js?<?= @filemtime(PUBLIC_PATH . '/scripts/statsWithChartjs.js') ?>"></script>