diff options
| author | 2025-01-21 23:45:22 +0100 | |
|---|---|---|
| committer | 2025-01-21 23:45:22 +0100 | |
| commit | afb6f788fa9c90817c9bd21e91993f4ddb462621 (patch) | |
| tree | 0408f1f354c15aa13e09b94c2f924c43c3afbfc8 /app/views/stats/index.phtml | |
| parent | f2c820dccd18eea9213a27d0401569b0f6e9a402 (diff) | |
Improve stats page layout (#7243)
* New stats box layout
* repartition: table overview improved with links and icons
* Show selected feed name in title
* i18n string: overview
* fix
* fix
* fix
* delete unused stat in frss
* Update app/i18n/fr/admin.php
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views/stats/index.phtml')
| -rw-r--r-- | app/views/stats/index.phtml | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml index f3fc3e986..88c4f0a3c 100644 --- a/app/views/stats/index.phtml +++ b/app/views/stats/index.phtml @@ -6,77 +6,77 @@ <main class="post"> <h1><?= _t('admin.stats.main') ?></h1> - <div class="stat-grid"> - <div class="stat half"> - <h2><?= _t('admin.stats.entry_repartition') ?></h2> - <div class="table-wrapper scrollbar-thin"> - <table> - <thead> - <tr> - <th> </th> - <th><?= _t('admin.stats.main_stream') ?></th> - <th><?= _t('admin.stats.all_feeds') ?></th> - </tr> - </thead> - <tbody> - <tr> - <th><?= _t('admin.stats.status_total') ?></th> - <td class="numeric"><?= format_number($this->repartitions['main_stream']['total'] ?? -1) ?></td> - <td class="numeric"><?= format_number($this->repartitions['all_feeds']['total'] ?? -1) ?></td> - </tr> - <tr> - <th><?= _t('admin.stats.status_read') ?></th> - <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_reads'] ?? -1) ?></td> - <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_reads'] ?? -1) ?></td> - </tr> - <tr> - <th><?= _t('admin.stats.status_unread') ?></th> - <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_unreads'] ?? -1) ?></td> - <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_unreads'] ?? -1) ?></td> - </tr> - <tr> - <th><?= _t('admin.stats.status_favorites') ?></th> - <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_favorites'] ?? -1) ?></td> - <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_favorites'] ?? -1) ?></td> - </tr> - </tbody> - </table> - </div> + <div class="box"> + <div class="box-title"><h2><?= _t('admin.stats.entry_repartition') ?></h2></div> + <div class="box-content scrollbar-thin"> + <table> + <thead> + <tr> + <th> </th> + <th><?= _t('admin.stats.main_stream') ?></th> + <th><?= _t('admin.stats.all_feeds') ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?= _t('admin.stats.status_total') ?></th> + <td class="numeric"><?= format_number($this->repartitions['main_stream']['total'] ?? -1) ?></td> + <td class="numeric"><?= format_number($this->repartitions['all_feeds']['total'] ?? -1) ?></td> + </tr> + <tr> + <th><?= _t('admin.stats.status_read') ?></th> + <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_reads'] ?? -1) ?></td> + <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_reads'] ?? -1) ?></td> + </tr> + <tr> + <th><?= _t('admin.stats.status_unread') ?></th> + <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_unreads'] ?? -1) ?></td> + <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_unreads'] ?? -1) ?></td> + </tr> + <tr> + <th><?= _t('admin.stats.status_favorites') ?></th> + <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_favorites'] ?? -1) ?></td> + <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_favorites'] ?? -1) ?></td> + </tr> + </tbody> + </table> </div> + </div> + - <div class="stat half"> - <h2><?= _t('admin.stats.top_feed') ?></h2> - <div class="table-wrapper scrollbar-thin"> - <table> - <thead> + <div class="box double-height"> + <div class="box-title"><h2><?= _t('admin.stats.top_feed') ?></h2></div> + <div class="box-content scrollbar-thin"> + <table> + <thead> + <tr> + <th><?= _t('admin.stats.feed') ?></th> + <th><?= _t('admin.stats.category') ?></th> + <th><?= _t('admin.stats.entry_count') ?></th> + <th><?= _t('admin.stats.percent_of_total') ?></th> + </tr> + </thead> + <tbody> + <?php foreach ($this->topFeed as $feed): ?> <tr> - <th><?= _t('admin.stats.feed') ?></th> - <th><?= _t('admin.stats.category') ?></th> - <th><?= _t('admin.stats.entry_count') ?></th> - <th><?= _t('admin.stats.percent_of_total') ?></th> + <td><a href="<?= _url('stats', 'repartition', 'id', $feed['id']) ?>"><?= $feed['name'] ?></a></td> + <td><?= $feed['category'] ?></td> + <td class="numeric"><?= format_number($feed['count']) ?></td> + <td class="numeric"><?php + if (!empty($this->repartitions['all_feeds']['total'])) { + echo format_number($feed['count'] / $this->repartitions['all_feeds']['total'] * 100, 1); + } + ?></td> </tr> - </thead> - <tbody> - <?php foreach ($this->topFeed as $feed): ?> - <tr> - <td><a href="<?= _url('stats', 'repartition', 'id', $feed['id']) ?>"><?= $feed['name'] ?></a></td> - <td><?= $feed['category'] ?></td> - <td class="numeric"><?= format_number($feed['count']) ?></td> - <td class="numeric"><?php - if (!empty($this->repartitions['all_feeds']['total'])) { - echo format_number($feed['count'] / $this->repartitions['all_feeds']['total'] * 100, 1); - } - ?></td> - </tr> - <?php endforeach; ?> - </tbody> - </table> - </div> + <?php endforeach; ?> + </tbody> + </table> </div> - - <div class="stat"> - <h2><?= _t('admin.stats.entry_per_day') ?></h2> - <div> + </div> + <br /> + <div class="box double-width double-height"> + <div class="box-title"><h2><?= _t('admin.stats.entry_per_day') ?></h2></div> + <div class="box-content scrollbar-thin"> <canvas id="statsEntriesPerDay"></canvas> <script class="jsonData-stats" type="application/json"> <?= json_encode([ @@ -140,10 +140,10 @@ $entryLabels = array_keys($entryData); $entryColors = array_map(fn($label) => $colorMap[$label], $entryLabels); $entryValues = array_values($entryData); ?> - - <div class="stat half"> - <h2><?= _t('admin.stats.feed_per_category') ?></h2> - <div> +<br id="stats_per_category" /> + <div class="box double-height" id="feed_per_category"> + <div class="box-title"><h2><?= _t('admin.stats.feed_per_category') ?></h2><a href="#feed_per_category" class="btn target-hidden">+</a><a href="#stats_per_category" class="btn target-visible">-</a></div> + <div class="box-content scrollbar-thin"> <canvas id="statsFeedsPerCategory"></canvas> <script class="jsonData-stats" type="application/json"> <?= json_encode([ @@ -157,9 +157,9 @@ $entryValues = array_values($entryData); </div> </div> - <div class="stat half"> - <h2><?= _t('admin.stats.entry_per_category') ?></h2> - <div> + <div class="box double-height" id="entry_per_category"> + <div class="box-title"><h2><?= _t('admin.stats.entry_per_category') ?></h2><a href="#entry_per_category" class="btn target-hidden">+</a><a href="#stats_per_category" class="btn target-visible">-</a></div> + <div class="box-content scrollbar-thin"> <canvas id="statsEntriesPerCategory"></canvas> <script class="jsonData-stats" type="application/json"> <?= json_encode([ |
