This commit is contained in:
Nicolas Lœuillet 2013-09-10 14:44:59 +02:00
commit eaf2c769be
4 changed files with 38 additions and 13 deletions

View 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;

View file

@ -1,3 +1,7 @@
<header class="w600p center mbm">
<h1><a href="./" title="{% trans "back to home" %}" ><img src="./tpl/img/logo.png" alt="logo poche" /></a></h1>
<h1>
{% if view == 'home' %}{% block logo %}<img src="./tpl/img/logo.png" alt="logo poche" />{% endblock %}
{% else %}<a href="./" title="{% trans "back to home" %}" >{{ block('logo') }}</a>
{% endif %}
</h1>
</header>

View 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 {
@ -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;
}
}

View file

@ -12,16 +12,25 @@
{% include '_menu.twig' %}
{% endblock %}
{% block precontent %}
{% if entries|length > 1 %}
<ul id="sort">
<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>
<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>
</ul>
{% endif %}
{% 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 +45,5 @@
</div>
{% endfor %}
{% endif %}
{{ page_links | raw }}
{{ block('pager') }}
{% endblock %}