Merge pull request #1526 from kcaran/links_per_page

This commit is contained in:
ArthurHoaro 2020-09-03 08:45:48 +02:00 committed by GitHub
commit 0a286f6946
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View file

@ -149,6 +149,8 @@ private function initialize()
$this->tpl->assign('formatter', $this->conf->get('formatter', 'default')); $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. // To be removed with a proper theme configuration.
$this->tpl->assign('conf', $this->conf); $this->tpl->assign('conf', $this->conf);
} }

View file

@ -616,6 +616,11 @@ body,
padding: 5px; padding: 5px;
text-decoration: none; text-decoration: none;
color: $dark-grey; color: $dark-grey;
&.selected {
background: var(--main-color);
color: $white;
}
} }
input { input {

View file

@ -55,11 +55,16 @@
<div class="linksperpage pure-u-1-3"> <div class="linksperpage pure-u-1-3">
<div class="pure-u-0 pure-u-lg-visible">{'Links per page'|t}</div> <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=20"
<a href="{$base_path}/links-per-page?nb=50">50</a> {if="$links_per_page == 20"}class="selected"{/if}>20</a>
<a href="{$base_path}/links-per-page?nb=100">100</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"> <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> </form>
<a href="#" class="filter-off fold-all pure-u-0 pure-u-lg-visible" aria-label="{'Fold all'|t}" title="{'Fold all'|t}"> <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> <i class="fa fa-chevron-up" aria-hidden="true"></i>