diff options
-rwxr-xr-x | inc/poche/Poche.class.php | 8 | ||||
-rwxr-xr-x | themes/baggy/css/main.css | 3 | ||||
-rwxr-xr-x | themes/baggy/home.twig | 2 | ||||
-rwxr-xr-x | themes/default/css/style.css | 10 | ||||
-rwxr-xr-x | themes/default/home.twig | 3 | ||||
-rw-r--r-- | themes/default/img/default/dice.png | bin | 0 -> 243 bytes |
6 files changed, 24 insertions, 2 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 81a18c86..5b8e235f 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -337,6 +337,14 @@ class Poche | |||
337 | $this->messages->add('s', _('The tag has been successfully deleted')); | 337 | $this->messages->add('s', _('The tag has been successfully deleted')); |
338 | Tools::redirect(); | 338 | Tools::redirect(); |
339 | break; | 339 | break; |
340 | /* For some unknown reason I can't get displayView() to work here (it redirects to home view afterwards). So here's a dirty fix which redirects directly to URL */ | ||
341 | case 'random': | ||
342 | $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); | ||
343 | $id = rand(1,$count); | ||
344 | Tools::logm('get a random article'); | ||
345 | Tools::redirect('?view=view&id=' . $id); | ||
346 | //$this->displayView('view', $id); | ||
347 | break; | ||
340 | default: | 348 | default: |
341 | break; | 349 | break; |
342 | } | 350 | } |
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 1df82910..78d56612 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css | |||
@@ -736,6 +736,9 @@ a.add-to-wallabag-link-after:after { | |||
736 | .icon-print:before { | 736 | .icon-print:before { |
737 | content: "\e80d"; | 737 | content: "\e80d"; |
738 | } | 738 | } |
739 | .icon-random:before { | ||
740 | // RANDOM ICON TO ADD | ||
741 | } | ||
739 | 742 | ||
740 | 743 | ||
741 | /* .icon-image class, for image-based icons | 744 | /* .icon-image class, for image-based icons |
diff --git a/themes/baggy/home.twig b/themes/baggy/home.twig index 93515080..d84c3f35 100755 --- a/themes/baggy/home.twig +++ b/themes/baggy/home.twig | |||
@@ -25,7 +25,7 @@ | |||
25 | {% block pager %} | 25 | {% block pager %} |
26 | {% if nb_results > 1 %} | 26 | {% if nb_results > 1 %} |
27 | <div class="results"> | 27 | <div class="results"> |
28 | <div class="nb-results">{{ nb_results }} {% trans "results" %}{% if search_term is defined %} {% trans %}found for « {{ search_term }} »{% endtrans %}{% endif %}</div> | 28 | <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="?action=random"> {% trans "random" %}</span></div> |
29 | {{ page_links | raw }} | 29 | {{ page_links | raw }} |
30 | </div> | 30 | </div> |
31 | {% elseif nb_results == 1 %} | 31 | {% elseif nb_results == 1 %} |
diff --git a/themes/default/css/style.css b/themes/default/css/style.css index b25373d6..a122dc54 100755 --- a/themes/default/css/style.css +++ b/themes/default/css/style.css | |||
@@ -151,6 +151,16 @@ a:visited { | |||
151 | text-indent: -9999px; | 151 | text-indent: -9999px; |
152 | } | 152 | } |
153 | 153 | ||
154 | .random { | ||
155 | display: inline-block; | ||
156 | width: 16px; | ||
157 | height: 16px; | ||
158 | overflow: hidden; | ||
159 | text-align: left; | ||
160 | text-indent: -9999px; | ||
161 | background-image: url('../img/default/dice.png'); | ||
162 | } | ||
163 | |||
154 | /*** ***/ | 164 | /*** ***/ |
155 | 165 | ||
156 | /*** ARTICLE PAGE ***/ | 166 | /*** ARTICLE PAGE ***/ |
diff --git a/themes/default/home.twig b/themes/default/home.twig index b9000559..abc96af8 100755 --- a/themes/default/home.twig +++ b/themes/default/home.twig | |||
@@ -31,7 +31,8 @@ | |||
31 | {% block pager %} | 31 | {% block pager %} |
32 | {% if nb_results > 1 %} | 32 | {% if nb_results > 1 %} |
33 | <div class="results"> | 33 | <div class="results"> |
34 | <div class="nb-results">{{ nb_results }} {% trans "results" %}{% if searchterm is defined %}{% trans " found for « " %} {{ searchterm }} »{% endif %}</div> | 34 | <div class="nb-results">{{ nb_results }} {% trans "results" %}{% if searchterm is defined %}{% trans " found for « " %} {{ searchterm }} »{% endif %} |
35 | <a class="random" href="?view=view&id={{ random }}"><span>{% trans "random" %}</span></a></div> | ||
35 | {{ page_links | raw }} | 36 | {{ page_links | raw }} |
36 | </div> | 37 | </div> |
37 | {% elseif nb_results == 1 %} | 38 | {% elseif nb_results == 1 %} |
diff --git a/themes/default/img/default/dice.png b/themes/default/img/default/dice.png new file mode 100644 index 00000000..70af6d0b --- /dev/null +++ b/themes/default/img/default/dice.png | |||
Binary files differ | |||