summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rwxr-xr-xapp/views/helpers/logs_pagination.phtml47
-rw-r--r--app/views/index/logs.phtml21
2 files changed, 68 insertions, 0 deletions
diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml
new file mode 100755
index 000000000..0088dabc6
--- /dev/null
+++ b/app/views/helpers/logs_pagination.phtml
@@ -0,0 +1,47 @@
+<?php
+ $c = Request::controllerName ();
+ $a = Request::actionName ();
+ $params = Request::params ();
+?>
+
+<?php if ($this->nbPage > 1) { ?>
+<ul class="pagination">
+ <?php $params[$getteur] = 1; ?>
+ <li class="item pager-first">
+ <?php if ($this->currentPage > 1) { ?>
+ <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« Début</a>
+ <?php } ?>
+ </li>
+
+ <?php $params[$getteur] = $this->currentPage - 1; ?>
+ <li class="item pager-previous">
+ <?php if ($this->currentPage > 1) { ?>
+ <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ Précédent</a>
+ <?php } ?>
+ </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="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li>
+ <?php } else { ?>
+ <li class="item pager-current"><?php echo $i; ?></li>
+ <?php } ?>
+ <?php } ?>
+ <?php } ?>
+
+ <?php $params[$getteur] = $this->currentPage + 1; ?>
+ <li class="item pager-next">
+ <?php if ($this->currentPage < $this->nbPage) { ?>
+ <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Suivant ›</a>
+ <?php } ?>
+ </li>
+ <?php $params[$getteur] = $this->nbPage; ?>
+ <li class="item pager-last">
+ <?php if ($this->currentPage < $this->nbPage) { ?>
+ <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Fin »</a>
+ <?php } ?>
+ </li>
+</ul>
+<?php } ?>
diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml
new file mode 100644
index 000000000..c72a84c86
--- /dev/null
+++ b/app/views/index/logs.phtml
@@ -0,0 +1,21 @@
+<div class="post content">
+ <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+
+ <h1><?php echo Translate::t ('logs'); ?></h1>
+
+ <?php $items = $this->logsPaginator->items (); ?>
+
+ <?php if (!empty ($items)) { ?>
+ <div class="logs">
+ <?php $this->logsPaginator->render ('logs_pagination.phtml', 'page'); ?>
+
+ <?php foreach ($items as $log) { ?>
+ <div class="log <?php echo $log->level (); ?>"><span class="date"><?php echo date ('d/m/Y - H:i:s', strtotime ($log->date ())); ?></span><?php echo $log->info (); ?></div>
+ <?php } ?>
+
+ <?php $this->logsPaginator->render ('logs_pagination.phtml','page'); ?>
+ </div>
+ <?php } else { ?>
+ <p class="alert alert-warn"><?php echo Translate::t ('logs_empty'); ?></p>
+ <?php } ?>
+</div> \ No newline at end of file