]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
implemented random button
authorThomas Citharel <tcit@tcit.fr>
Sun, 7 Dec 2014 22:36:35 +0000 (23:36 +0100)
committerThomas Citharel <tcit@tcit.fr>
Sun, 7 Dec 2014 22:36:35 +0000 (23:36 +0100)
inc/poche/Poche.class.php
themes/baggy/css/main.css
themes/baggy/home.twig
themes/default/css/style.css
themes/default/home.twig
themes/default/img/default/dice.png [new file with mode: 0644]

index 27d6f4a65e1ca22079a700d8dc2cfcdde851e582..2a8037cc27c142fff3a1424b561fd38517ce02dc 100755 (executable)
@@ -445,6 +445,7 @@ class Poche
                     $tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id);
                     $tpl_vars['page_links'] = $page_links;
                     $tpl_vars['nb_results'] = $count;
+                    $tpl_vars['random'] = rand(1,$count);
                 }
                 Tools::logm('display ' . $view . ' view');
                 break;
@@ -812,4 +813,4 @@ class Poche
     }
 
 
-}
\ No newline at end of file
+}
index 1df82910164098c95b5542d14c3f5e2efbf5ea79..78d56612420af02bdc1b5e2f2e60d466dfd9123a 100755 (executable)
@@ -736,6 +736,9 @@ a.add-to-wallabag-link-after:after {
 .icon-print:before {
   content: "\e80d";
 }
+.icon-random:before {
+ // RANDOM ICON TO ADD
+}
 
 
 /* .icon-image class, for image-based icons
index dec848f23ad75c0211d3f471dbeb2b239fb6f961..eb554b11e14ad093ec9f22e7016b08d3ef556f95 100755 (executable)
@@ -25,7 +25,7 @@
                 {% block pager %}
                     {% if nb_results > 1 %}
                 <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 }}
                 </div>
                     {% elseif nb_results == 1 %}
index b25373d6c98cef6da4e4c85ed9ac64b352d115a9..a122dc546b2d7f8e1fb80772cb750eb8901a704f 100755 (executable)
@@ -151,6 +151,16 @@ a:visited {
     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 ***/
index 6bc549e6c6d3e6e43265647800c377f83418f1eb..aa3326008de5840dbb2f690384fae1b1ceb9ac28 100755 (executable)
@@ -31,7 +31,8 @@
                 {% block pager %}
                     {% if nb_results > 1 %}
                 <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 }}
                 </div>
                     {% elseif nb_results == 1 %}
diff --git a/themes/default/img/default/dice.png b/themes/default/img/default/dice.png
new file mode 100644 (file)
index 0000000..70af6d0
Binary files /dev/null and b/themes/default/img/default/dice.png differ