1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-27 11:22:17 -05:00

implemented random button

This commit is contained in:
Thomas Citharel 2014-12-07 23:36:35 +01:00
parent 9c55ed0923
commit 311baf86be
6 changed files with 18 additions and 3 deletions

View File

@ -445,6 +445,7 @@ class Poche
$tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id); $tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id);
$tpl_vars['page_links'] = $page_links; $tpl_vars['page_links'] = $page_links;
$tpl_vars['nb_results'] = $count; $tpl_vars['nb_results'] = $count;
$tpl_vars['random'] = rand(1,$count);
} }
Tools::logm('display ' . $view . ' view'); Tools::logm('display ' . $view . ' view');
break; break;

View File

@ -736,6 +736,9 @@ a.add-to-wallabag-link-after:after {
.icon-print:before { .icon-print:before {
content: "\e80d"; content: "\e80d";
} }
.icon-random:before {
// RANDOM ICON TO ADD
}
/* .icon-image class, for image-based icons /* .icon-image class, for image-based icons

View File

@ -25,7 +25,7 @@
{% block pager %} {% block pager %}
{% if nb_results > 1 %} {% if nb_results > 1 %}
<div class="results"> <div class="results">
<div class="nb-results">{{ nb_results }} {% trans "results" %}{% if search_term is defined %} {% trans %}found for « {{ search_term }} »{% endtrans %}{% endif %}</div> <div class="nb-results">{{ nb_results }} {% trans "results" %}{% if search_term is defined %} {% trans %}found for « {{ search_term }} »{% endtrans %}{% endif %} <span class="icon icon-random"><a href="?view=view&id={{ random }}"> {% trans "random" %}</span></div>
{{ page_links | raw }} {{ page_links | raw }}
</div> </div>
{% elseif nb_results == 1 %} {% elseif nb_results == 1 %}

View File

@ -151,6 +151,16 @@ a:visited {
text-indent: -9999px; text-indent: -9999px;
} }
.random {
display: inline-block;
width: 16px;
height: 16px;
overflow: hidden;
text-align: left;
text-indent: -9999px;
background-image: url('../img/default/dice.png');
}
/*** ***/ /*** ***/
/*** ARTICLE PAGE ***/ /*** ARTICLE PAGE ***/

View File

@ -31,7 +31,8 @@
{% block pager %} {% block pager %}
{% if nb_results > 1 %} {% if nb_results > 1 %}
<div class="results"> <div class="results">
<div class="nb-results">{{ nb_results }} {% trans "results" %}{% if searchterm is defined %}{% trans " found for « " %} {{ searchterm }} »{% endif %}</div> <div class="nb-results">{{ nb_results }} {% trans "results" %}{% if searchterm is defined %}{% trans " found for « " %} {{ searchterm }} »{% endif %}
<a class="random" href="?view=view&id={{ random }}"><span>{% trans "random" %}</span></a></div>
{{ page_links | raw }} {{ page_links | raw }}
</div> </div>
{% elseif nb_results == 1 %} {% elseif nb_results == 1 %}

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B