diff options
author | Keith Carangelo <mail@kcaran.com> | 2020-08-29 11:02:59 -0400 |
---|---|---|
committer | Keith Carangelo <mail@kcaran.com> | 2020-08-29 11:02:59 -0400 |
commit | 816ffba74b8bebffc620af50994833d783207a50 (patch) | |
tree | 65faa0496b7089bf4edb45ae20c8ea471f81c5ae | |
parent | bea062149ebcb4663861edb1cc0a32faf85b273f (diff) | |
download | Shaarli-816ffba74b8bebffc620af50994833d783207a50.tar.gz Shaarli-816ffba74b8bebffc620af50994833d783207a50.tar.zst Shaarli-816ffba74b8bebffc620af50994833d783207a50.zip |
Added $links_per_page variable to template and display on default
-rw-r--r-- | application/render/PageBuilder.php | 2 | ||||
-rw-r--r-- | assets/default/scss/shaarli.scss | 5 | ||||
-rw-r--r-- | tpl/default/linklist.paging.html | 13 |
3 files changed, 16 insertions, 4 deletions
diff --git a/application/render/PageBuilder.php b/application/render/PageBuilder.php index 7a716673..21703639 100644 --- a/application/render/PageBuilder.php +++ b/application/render/PageBuilder.php | |||
@@ -149,6 +149,8 @@ class PageBuilder | |||
149 | 149 | ||
150 | $this->tpl->assign('formatter', $this->conf->get('formatter', 'default')); | 150 | $this->tpl->assign('formatter', $this->conf->get('formatter', 'default')); |
151 | 151 | ||
152 | $this->tpl->assign('links_per_page', $_SESSION['LINKS_PER_PAGE']); | ||
153 | |||
152 | // To be removed with a proper theme configuration. | 154 | // To be removed with a proper theme configuration. |
153 | $this->tpl->assign('conf', $this->conf); | 155 | $this->tpl->assign('conf', $this->conf); |
154 | } | 156 | } |
diff --git a/assets/default/scss/shaarli.scss b/assets/default/scss/shaarli.scss index 759dff29..3d25d231 100644 --- a/assets/default/scss/shaarli.scss +++ b/assets/default/scss/shaarli.scss | |||
@@ -618,6 +618,11 @@ body, | |||
618 | color: $dark-grey; | 618 | color: $dark-grey; |
619 | } | 619 | } |
620 | 620 | ||
621 | a.selected { | ||
622 | background: var(--main-color); | ||
623 | color: $white; | ||
624 | } | ||
625 | |||
621 | input { | 626 | input { |
622 | &[type='text'] { | 627 | &[type='text'] { |
623 | @extend %linksperpage-button; | 628 | @extend %linksperpage-button; |
diff --git a/tpl/default/linklist.paging.html b/tpl/default/linklist.paging.html index 7b320eaf..009692b9 100644 --- a/tpl/default/linklist.paging.html +++ b/tpl/default/linklist.paging.html | |||
@@ -53,11 +53,16 @@ | |||
53 | 53 | ||
54 | <div class="linksperpage pure-u-1-3"> | 54 | <div class="linksperpage pure-u-1-3"> |
55 | <div class="pure-u-0 pure-u-lg-visible">{'Links per page'|t}</div> | 55 | <div class="pure-u-0 pure-u-lg-visible">{'Links per page'|t}</div> |
56 | <a href="{$base_path}/links-per-page?nb=20">20</a> | 56 | <a href="{$base_path}/links-per-page?nb=20" |
57 | <a href="{$base_path}/links-per-page?nb=50">50</a> | 57 | {if="$links_per_page == 20"}class="selected"{/if}>20</a> |
58 | <a href="{$base_path}/links-per-page?nb=100">100</a> | 58 | <a href="{$base_path}/links-per-page?nb=50" |
59 | {if="$links_per_page == 50"}class="selected"{/if}>50</a> | ||
60 | <a href="{$base_path}/links-per-page?nb=100" | ||
61 | {if="$links_per_page == 100"}class="selected"{/if}>100</a> | ||
59 | <form method="GET" class="pure-u-0 pure-u-lg-visible" action="{$base_path}/links-per-page"> | 62 | <form method="GET" class="pure-u-0 pure-u-lg-visible" action="{$base_path}/links-per-page"> |
60 | <input type="text" name="nb" placeholder="133"> | 63 | <input type="text" name="nb" placeholder="133" |
64 | {if="$links_per_page != 20 && $links_per_page != 50 && $links_per_page != 100"} | ||
65 | value="{$links_per_page}"{/if}> | ||
61 | </form> | 66 | </form> |
62 | <a href="#" class="filter-off fold-all pure-u-0 pure-u-lg-visible" aria-label="{'Fold all'|t}" title="{'Fold all'|t}"> | 67 | <a href="#" class="filter-off fold-all pure-u-0 pure-u-lg-visible" aria-label="{'Fold all'|t}" title="{'Fold all'|t}"> |
63 | <i class="fa fa-chevron-up" aria-hidden="true"></i> | 68 | <i class="fa fa-chevron-up" aria-hidden="true"></i> |