]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add number of results next to pager 199/head
authorNumEricR <eric.github@gmail.com>
Wed, 28 Aug 2013 17:12:11 +0000 (19:12 +0200)
committerNumEricR <eric.github@gmail.com>
Wed, 28 Aug 2013 19:23:26 +0000 (21:23 +0200)
inc/poche/Poche.class.php
tpl/css/style.css
tpl/home.twig

index a8f64151d59aecaa67922fdd6dc00ff6776ca9d6..89e94a3a1b38f94fb8d9927defa8913351487e27 100644 (file)
@@ -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;
index 7633534c3a428b307bae56880cdafa45164c8dbc..f07072a755d310c6d14470a536331194f6f06e8a 100644 (file)
@@ -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 {
index f51c34f235d5ab91e80f250d2b44fc899e8fe3d1..db4e0888e29966b53ee2d321b35f46df2ab49c07 100644 (file)
             </ul>
 {% endblock %}
 {% block content %}
-            {{ page_links | raw }}
             {% if entries is empty %}
             <div class="messages warning"><p>{% trans "No link available here!" %}</p></div>
             {% else %}
+                {% block pager %}
+                    {% if nb_results > 1 %}
+                <div class="results">
+                    <div class="nb-results">{{ nb_results }} {% trans "results" %}</div>
+                        {{ page_links | raw }}
+                </div>
+                    {% endif %}
+                {% endblock %}
                 {% for entry in entries %}
             <div id="entry-{{ entry.id|e }}" class="entrie">
                 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
@@ -36,5 +43,5 @@
             </div>
                 {% endfor %}
             {% endif %}
-            {{ page_links | raw }}
+            {{ block('pager') }}
 {% endblock %}
\ No newline at end of file