diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5030c9a..534e660 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -262,6 +262,7 @@ class Poche $tpl_vars = array( 'entries' => '', 'page_links' => '', + 'nb_results' => '', ); if (count($entries) > 0) { $this->pagination->set_total(count($entries)); @@ -269,6 +270,7 @@ class Poche $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit()); $tpl_vars['entries'] = $datas; $tpl_vars['page_links'] = $page_links; + $tpl_vars['nb_results'] = count($entries); } Tools::logm('display ' . $view . ' view'); break; diff --git a/tpl/_top.twig b/tpl/_top.twig index ae01cc3..dc20081 100644 --- a/tpl/_top.twig +++ b/tpl/_top.twig @@ -1,3 +1,7 @@
-

logo poche

+

+ {% if view == 'home' %}{% block logo %}logo poche{% endblock %} + {% else %}{{ block('logo') }} + {% endif %} +

\ No newline at end of file diff --git a/tpl/css/style.css b/tpl/css/style.css index d644814..c056429 100644 --- a/tpl/css/style.css +++ b/tpl/css/style.css @@ -98,6 +98,10 @@ a, a:hover, a:visited { #main #content .entrie { border-bottom: 1px dashed #222; } +/* First entry */ +#main #content .results + .entrie { + clear: both; +} #main .entrie .tools { list-style-type: none; @@ -189,11 +193,22 @@ a, a:hover, a:visited { } -/* Pagination */ -.pagination { - clear: both; +.results { + overflow: hidden; padding-bottom: 20px; padding-top: 10px; +} + +.nb-results { + float: left; + font-size: 0.9em; + line-height: 24px; + vertical-align: middle; +} + +/* Pagination */ +.pagination { + float: right; text-align: right; } .pagination a { @@ -221,12 +236,7 @@ a, a:hover, a:visited { margin: 2px; } .pagination .disabled { - border: 1px solid #eee; - color: #ddd; - margin: 2px; - padding: 4px 8px; - font-size: 11px; - font-weight: bold; + display: none; } #bookmarklet { @@ -270,4 +280,4 @@ footer { opacity:0.8; color:white; border-radius: 3px; -} \ No newline at end of file +} diff --git a/tpl/home.twig b/tpl/home.twig index f51c34f..771c36c 100644 --- a/tpl/home.twig +++ b/tpl/home.twig @@ -12,16 +12,25 @@ {% include '_menu.twig' %} {% endblock %} {% block precontent %} + {% if entries|length > 1 %} + {% endif %} {% endblock %} {% block content %} - {{ page_links | raw }} {% if entries is empty %}

{% trans "No link available here!" %}

{% else %} + {% block pager %} + {% if nb_results > 1 %} +
+
{{ nb_results }} {% trans "results" %}
+ {{ page_links | raw }} +
+ {% endif %} + {% endblock %} {% for entry in entries %}

{{ entry.title|raw }}

@@ -36,5 +45,5 @@
{% endfor %} {% endif %} - {{ page_links | raw }} + {{ block('pager') }} {% endblock %} \ No newline at end of file