aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-10 14:44:59 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-10 14:44:59 +0200
commiteaf2c769be6f1a052994ac6f9f5b5a5221596b12 (patch)
tree608403633579a094c90a92cb1dd1beafe4f2fcb9
parentce4a1dcc193d3124fc51c4942137621d3d806a19 (diff)
parent2230a38cd678259947ccaffecee579604822d1cf (diff)
downloadwallabag-eaf2c769be6f1a052994ac6f9f5b5a5221596b12.tar.gz
wallabag-eaf2c769be6f1a052994ac6f9f5b5a5221596b12.tar.zst
wallabag-eaf2c769be6f1a052994ac6f9f5b5a5221596b12.zip
Merge branch 'dev' of https://github.com/inthepoche/poche into dev
-rw-r--r--inc/poche/Poche.class.php2
-rw-r--r--tpl/_top.twig6
-rw-r--r--tpl/css/style.css30
-rw-r--r--tpl/home.twig13
4 files changed, 38 insertions, 13 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 5030c9aa..534e660a 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/_top.twig b/tpl/_top.twig
index ae01cc3f..dc20081e 100644
--- a/tpl/_top.twig
+++ b/tpl/_top.twig
@@ -1,3 +1,7 @@
1 <header class="w600p center mbm"> 1 <header class="w600p center mbm">
2 <h1><a href="./" title="{% trans "back to home" %}" ><img src="./tpl/img/logo.png" alt="logo poche" /></a></h1> 2 <h1>
3 {% if view == 'home' %}{% block logo %}<img src="./tpl/img/logo.png" alt="logo poche" />{% endblock %}
4 {% else %}<a href="./" title="{% trans "back to home" %}" >{{ block('logo') }}</a>
5 {% endif %}
6 </h1>
3 </header> \ No newline at end of file 7 </header> \ No newline at end of file
diff --git a/tpl/css/style.css b/tpl/css/style.css
index d644814d..c056429d 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 {
@@ -221,12 +236,7 @@ a, a:hover, a:visited {
221 margin: 2px; 236 margin: 2px;
222} 237}
223.pagination .disabled { 238.pagination .disabled {
224 border: 1px solid #eee; 239 display: none;
225 color: #ddd;
226 margin: 2px;
227 padding: 4px 8px;
228 font-size: 11px;
229 font-weight: bold;
230} 240}
231 241
232#bookmarklet { 242#bookmarklet {
@@ -270,4 +280,4 @@ footer {
270 opacity:0.8; 280 opacity:0.8;
271 color:white; 281 color:white;
272 border-radius: 3px; 282 border-radius: 3px;
273} \ No newline at end of file 283}
diff --git a/tpl/home.twig b/tpl/home.twig
index f51c34f2..771c36c5 100644
--- a/tpl/home.twig
+++ b/tpl/home.twig
@@ -12,16 +12,25 @@
12{% include '_menu.twig' %} 12{% include '_menu.twig' %}
13{% endblock %} 13{% endblock %}
14{% block precontent %} 14{% block precontent %}
15 {% if entries|length > 1 %}
15 <ul id="sort"> 16 <ul id="sort">
16 <li><a href="./?sort=ia&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li> 17 <li><a href="./?sort=ia&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li>
17 <li><a href="./?sort=ta&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li> 18 <li><a href="./?sort=ta&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li>
18 </ul> 19 </ul>
20 {% endif %}
19{% endblock %} 21{% endblock %}
20{% block content %} 22{% block content %}
21 {{ page_links | raw }}
22 {% if entries is empty %} 23 {% if entries is empty %}
23 <div class="messages warning"><p>{% trans "No link available here!" %}</p></div> 24 <div class="messages warning"><p>{% trans "No link available here!" %}</p></div>
24 {% else %} 25 {% else %}
26 {% block pager %}
27 {% if nb_results > 1 %}
28 <div class="results">
29 <div class="nb-results">{{ nb_results }} {% trans "results" %}</div>
30 {{ page_links | raw }}
31 </div>
32 {% endif %}
33 {% endblock %}
25 {% for entry in entries %} 34 {% for entry in entries %}
26 <div id="entry-{{ entry.id|e }}" class="entrie"> 35 <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> 36 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
@@ -36,5 +45,5 @@
36 </div> 45 </div>
37 {% endfor %} 46 {% endfor %}
38 {% endif %} 47 {% endif %}
39 {{ page_links | raw }} 48 {{ block('pager') }}
40{% endblock %} \ No newline at end of file 49{% endblock %} \ No newline at end of file