aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-09 04:55:56 -0700
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-09 04:55:56 -0700
commitef6051b95e2e289bb32107b75594406db2801653 (patch)
tree1210fefbff6604e6039191a0f7ba7334ddf5a49f
parent3eb049036e601c1978cf5f7f0d5be8c577933b72 (diff)
parent7f9f5281e5fe6dd92c810f7945c7761ca17fd2e6 (diff)
downloadwallabag-ef6051b95e2e289bb32107b75594406db2801653.tar.gz
wallabag-ef6051b95e2e289bb32107b75594406db2801653.tar.zst
wallabag-ef6051b95e2e289bb32107b75594406db2801653.zip
Merge pull request #199 from NumEricR/nb-results
Add the number of results next to pager
-rw-r--r--inc/poche/Poche.class.php2
-rw-r--r--tpl/css/style.css21
-rw-r--r--tpl/home.twig11
3 files changed, 29 insertions, 5 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index a8f64151..89e94a3a 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -262,6 +262,7 @@ class Poche
262 $tpl_vars = array( 262 $tpl_vars = array(
263 'entries' => '', 263 'entries' => '',
264 'page_links' => '', 264 'page_links' => '',
265 'nb_results' => '',
265 ); 266 );
266 if (count($entries) > 0) { 267 if (count($entries) > 0) {
267 $this->pagination->set_total(count($entries)); 268 $this->pagination->set_total(count($entries));
@@ -269,6 +270,7 @@ class Poche
269 $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit()); 270 $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit());
270 $tpl_vars['entries'] = $datas; 271 $tpl_vars['entries'] = $datas;
271 $tpl_vars['page_links'] = $page_links; 272 $tpl_vars['page_links'] = $page_links;
273 $tpl_vars['nb_results'] = count($entries);
272 } 274 }
273 Tools::logm('display ' . $view . ' view'); 275 Tools::logm('display ' . $view . ' view');
274 break; 276 break;
diff --git a/tpl/css/style.css b/tpl/css/style.css
index 7633534c..f07072a7 100644
--- a/tpl/css/style.css
+++ b/tpl/css/style.css
@@ -98,6 +98,10 @@ a, a:hover, a:visited {
98#main #content .entrie { 98#main #content .entrie {
99 border-bottom: 1px dashed #222; 99 border-bottom: 1px dashed #222;
100} 100}
101/* First entry */
102#main #content .results + .entrie {
103 clear: both;
104}
101 105
102#main .entrie .tools { 106#main .entrie .tools {
103 list-style-type: none; 107 list-style-type: none;
@@ -189,11 +193,22 @@ a, a:hover, a:visited {
189} 193}
190 194
191 195
192/* Pagination */ 196.results {
193.pagination { 197 overflow: hidden;
194 clear: both;
195 padding-bottom: 20px; 198 padding-bottom: 20px;
196 padding-top: 10px; 199 padding-top: 10px;
200}
201
202.nb-results {
203 float: left;
204 font-size: 0.9em;
205 line-height: 24px;
206 vertical-align: middle;
207}
208
209/* Pagination */
210.pagination {
211 float: right;
197 text-align: right; 212 text-align: right;
198} 213}
199.pagination a { 214.pagination a {
diff --git a/tpl/home.twig b/tpl/home.twig
index f51c34f2..db4e0888 100644
--- a/tpl/home.twig
+++ b/tpl/home.twig
@@ -18,10 +18,17 @@
18 </ul> 18 </ul>
19{% endblock %} 19{% endblock %}
20{% block content %} 20{% block content %}
21 {{ page_links | raw }}
22 {% if entries is empty %} 21 {% if entries is empty %}
23 <div class="messages warning"><p>{% trans "No link available here!" %}</p></div> 22 <div class="messages warning"><p>{% trans "No link available here!" %}</p></div>
24 {% else %} 23 {% else %}
24 {% block pager %}
25 {% if nb_results > 1 %}
26 <div class="results">
27 <div class="nb-results">{{ nb_results }} {% trans "results" %}</div>
28 {{ page_links | raw }}
29 </div>
30 {% endif %}
31 {% endblock %}
25 {% for entry in entries %} 32 {% for entry in entries %}
26 <div id="entry-{{ entry.id|e }}" class="entrie"> 33 <div id="entry-{{ entry.id|e }}" class="entrie">
27 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> 34 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
@@ -36,5 +43,5 @@
36 </div> 43 </div>
37 {% endfor %} 44 {% endfor %}
38 {% endif %} 45 {% endif %}
39 {{ page_links | raw }} 46 {{ block('pager') }}
40{% endblock %} \ No newline at end of file 47{% endblock %} \ No newline at end of file