aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-03-14 23:04:17 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-14 23:04:17 +0100
commit6650d1d29ea5e6f895124afce9ed4a6e920a1ed8 (patch)
treee81fc72e0a31d9ceaa1d3a9afeb2f4bc4ad46040 /app/views
parent7b962e246bb9f273dda534b340851db799577dfe (diff)
Improved: log page (#4204)
* first draft * wip * Theme Ansum * Update logs_pagination.phtml * Theme Mapco * Update adark.css * Update BlueLagoon.css * Update dark.css * Update screwdriver.css * Theme Swage * Update app/views/helpers/logs_pagination.phtml Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> * Update app/views/helpers/logs_pagination.phtml Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> * Update template.css * Update logs_pagination.phtml * Update logs_pagination.phtml * Update logs_pagination.phtml * RTL CSS * Update dark.rtl.css * Update swage.css * fix CLI findings * Indentation fixed * icons improved * CSS: centered icons * i18n * pipline test fixes * Update conf.php * Update gen.php * Update app/i18n/fr/conf.php Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views')
-rwxr-xr-xapp/views/helpers/logs_pagination.phtml81
-rw-r--r--app/views/index/logs.phtml54
2 files changed, 85 insertions, 50 deletions
diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml
index fe6a71a3a..d12b3f9d1 100755
--- a/app/views/helpers/logs_pagination.phtml
+++ b/app/views/helpers/logs_pagination.phtml
@@ -6,46 +6,53 @@
?>
<?php if ($this->nbPage > 1) { ?>
-<ul class="pagination">
- <?php
- /** @var int $getteur */
- $params[$getteur] = 1;
- ?>
- <li class="item pager-first">
- <?php if ($this->currentPage > 1) { ?>
- <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _t('gen.pagination.first') ?></a>
- <?php } ?>
- </li>
+<nav class="nav-pagination nav-list">
+ <ul class="pagination">
+ <?php
+ /** @var int $getteur */
+ $params[$getteur] = 1;
+ ?>
+ <li class="item pager-first">
+ <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _t('conf.logs.pagination.first') ?></a>
+ </li>
- <?php $params[$getteur] = $this->currentPage - 1; ?>
- <li class="item pager-previous">
- <?php if ($this->currentPage > 1) { ?>
- <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">‹ <?= _t('gen.pagination.previous') ?></a>
- <?php } ?>
- </li>
+ <?php $params[$getteur] = $this->currentPage - 1; ?>
+ <li class="item pager-previous">
+ <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">‹ <?= _t('conf.logs.pagination.previous') ?></a>
+ </li>
- <?php for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) { ?>
- <?php if($i > 0 && $i <= $this->nbPage) { ?>
- <?php if ($i != $this->currentPage) { ?>
- <?php $params[$getteur] = $i; ?>
- <li class="item pager-item"><a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= $i ?></a></li>
- <?php } else { ?>
- <li class="item pager-current"><?= $i ?></li>
- <?php } ?>
+ <?php if ($this->currentPage - 2 > 1) { ?>
+ <li class="item">…</a></li>
<?php } ?>
- <?php } ?>
- <?php $params[$getteur] = $this->currentPage + 1; ?>
- <li class="item pager-next">
- <?php if ($this->currentPage < $this->nbPage) { ?>
- <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('gen.pagination.next') ?> ›</a>
- <?php } ?>
- </li>
- <?php $params[$getteur] = $this->nbPage; ?>
- <li class="item pager-last">
- <?php if ($this->currentPage < $this->nbPage) { ?>
- <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('gen.pagination.last') ?> »</a>
+ <?php
+ for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) {
+ if($i > 0 && $i <= $this->nbPage) {
+ if ($i != $this->currentPage) {
+ $params[$getteur] = $i;
+ $class = '';
+ $aria = 'false';
+ } else {
+ $class = ' active';
+ $aria = 'true';
+ } ?>
+ <li class="item<?= $class ?>"><a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>" aria-current="<?= $aria ?>"><?= $i ?></a></li>
+ <?php
+ }
+ } ?>
+
+ <?php if ($this->nbPage > $i - 1) { ?>
+ <li class="item">…</a></li>
<?php } ?>
- </li>
-</ul>
+
+ <?php $params[$getteur] = $this->currentPage + 1; ?>
+ <li class="item pager-next">
+ <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.next') ?> ›</a>
+ </li>
+ <?php $params[$getteur] = $this->nbPage; ?>
+ <li class="item pager-last">
+ <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.last') ?> »</a>
+ </li>
+ </ul>
+</nav>
<?php } ?>
diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml
index bb11f9f69..8221d2d4b 100644
--- a/app/views/index/logs.phtml
+++ b/app/views/index/logs.phtml
@@ -1,15 +1,12 @@
<?php /** @var FreshRSS_View $this */ ?>
-<main class="post content">
+<?php $this->partial('aside_configure'); ?>
+<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
</div>
<h1><?= _t('index.log') ?></h1>
- <form method="post" action="<?= _url('index', 'logs') ?>"><p>
- <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
- <input type="hidden" name="clearLogs" />
- <button type="submit" class="btn"><?= _t('index.log.clear') ?></button>
- </p></form>
+
<?php
/** @var array<FreshRSS_Log> $items */
@@ -17,18 +14,49 @@
?>
<?php if (!empty($items)) { ?>
- <div class="loglist">
- <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
-
+ <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
+ <div id="loglist-wrapper">
+ <table id="loglist">
+ <thead>
+ <th><?= _t('conf.logs.loglist.level') ?></th>
+ <th><?= _t('conf.logs.loglist.timestamp') ?></th>
+ <th><?= _t('conf.logs.loglist.message') ?></th>
+ </thead>
+ <tbody>
<?php foreach ($items as $log) { ?>
- <div class="log <?= $log->level() ?>"><span class="date">
- <?= @date('Y-m-d H:i:s', @strtotime($log->date())) ?>
- </span><?= htmlspecialchars($log->info(), ENT_NOQUOTES, 'UTF-8') ?></div>
+ <tr class="log-item">
+ <td class="log-<?= $log->level() ?>">
+ <?= _i($log->level()) ?>
+ </td>
+ <td class="log-date">
+ <time datetime="<?= @date('Y-m-d H:i:s', @strtotime($log->date())) ?>">
+ <?= @date('Y-m-d H:i:s', @strtotime($log->date())) ?>
+ </time>
+ </td>
+ <td class="log-message">
+ <?= htmlspecialchars($log->info(), ENT_NOQUOTES, 'UTF-8') ?>
+ </td>
+ </tr>
<?php } ?>
+ </tbody>
+ </table>
+ </div>
+ <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
+
- <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
+
+ <form method="post" action="<?= _url('index', 'logs') ?>">
+ <div class="form-group form-actions">
+ <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
+ <input type="hidden" name="clearLogs" />
+ <div class="group-controls">
+ <button type="submit" class="btn btn-attention"><?= _t('index.log.clear') ?></button>
+ </div>
</div>
+ </form>
+
<?php } else { ?>
<p class="alert alert-warn"><?= _t('index.log.empty') ?></p>
<?php } ?>
+
</main>