]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
added reload icon and fixed a bug where random could redirect to deleted articles 968/head
authorThomas Citharel <tcit@tcit.fr>
Sun, 1 Feb 2015 11:22:14 +0000 (12:22 +0100)
committerThomas Citharel <tcit@tcit.fr>
Sun, 1 Feb 2015 11:22:14 +0000 (12:22 +0100)
inc/poche/Poche.class.php
themes/baggy/css/main.css

index fb74ab9a0aaa23ec1e0ba0eb7b89e4de8cda384a..f992814583ba7f7fb56f9805c1219b59910177c6 100755 (executable)
@@ -349,8 +349,11 @@ class Poche
                 
             /* 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 */
             case 'random':
-                $count = $this->store->getEntriesByViewCount($view, $this->user->getId());
-                $id = rand(1,$count);
+                $id = 0;
+                while ($this->store->retrieveOneById($id,$this->user->getId()) == null) {
+                    $count = $this->store->getEntriesByViewCount($view, $this->user->getId());
+                    $id = rand(1,$count);
+                }
                 Tools::logm('get a random article');
                 Tools::redirect('?view=view&id=' . $id);
                 //$this->displayView('view', $id);
index 9356deda9daf5bf6aa65da878bd319a02fae1362..90d546fcdf5cb3593773f2bed00ae9f1f8d7b906 100755 (executable)
@@ -737,7 +737,10 @@ a.add-to-wallabag-link-after:after {
   content: "\e80d";
 }
 .icon-random:before {
- content: "\e915";
+  content: "\e915";
+}
+.icon-reload:before {
+  content: "\ea2e";
 }