]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge branch 'master' of https://github.com/shaarli/Shaarli into links_per_page
authorKeith Carangelo <mail@kcaran.com>
Wed, 2 Sep 2020 15:38:56 +0000 (11:38 -0400)
committerKeith Carangelo <mail@kcaran.com>
Wed, 2 Sep 2020 15:38:56 +0000 (11:38 -0400)
application/render/PageBuilder.php
assets/default/scss/shaarli.scss
tpl/default/linklist.paging.html

index 7a7166732392a5726227bd33d769f0dd8abbc96e..c52e3b76143530343f5da67ce32e9f74a805d236 100644 (file)
@@ -149,6 +149,8 @@ class PageBuilder
 
         $this->tpl->assign('formatter', $this->conf->get('formatter', 'default'));
 
+        $this->tpl->assign('links_per_page', $this->session['LINKS_PER_PAGE']);
+
         // To be removed with a proper theme configuration.
         $this->tpl->assign('conf', $this->conf);
     }
index 759dff29828f9bce824d7f5f9e185a23c6b70458..7ab09d3f2e313657f6682bf211b7d9462c6a88e7 100644 (file)
@@ -616,6 +616,11 @@ body,
     padding: 5px;
     text-decoration: none;
     color: $dark-grey;
+
+    &.selected {
+      background: var(--main-color);
+      color: $white;
+     }
   }
 
   input {
index 20853330749343622c8042a0c8294d2470062cda..aa637868eb94e2a91cb9e8a5af22011cb6bbc77f 100644 (file)
 
     <div class="linksperpage pure-u-1-3">
       <div class="pure-u-0 pure-u-lg-visible">{'Links per page'|t}</div>
-      <a href="{$base_path}/links-per-page?nb=20">20</a>
-      <a href="{$base_path}/links-per-page?nb=50">50</a>
-      <a href="{$base_path}/links-per-page?nb=100">100</a>
+      <a href="{$base_path}/links-per-page?nb=20"
+                       {if="$links_per_page == 20"}class="selected"{/if}>20</a>
+      <a href="{$base_path}/links-per-page?nb=50"
+                       {if="$links_per_page == 50"}class="selected"{/if}>50</a>
+      <a href="{$base_path}/links-per-page?nb=100"
+                       {if="$links_per_page == 100"}class="selected"{/if}>100</a>
       <form method="GET" class="pure-u-0 pure-u-lg-visible" action="{$base_path}/links-per-page">
-        <input type="text" name="nb" placeholder="133">
+        <input type="text" name="nb" placeholder="133"
+                       {if="$links_per_page != 20 && $links_per_page != 50 && $links_per_page != 100"}
+                               value="{$links_per_page}"{/if}>
       </form>
       <a href="#" class="filter-off fold-all pure-u-0 pure-u-lg-visible" aria-label="{'Fold all'|t}" title="{'Fold all'|t}">
         <i class="fa fa-chevron-up" aria-hidden="true"></i>