Fix broken route to filter not tagged bookmarks
Also display the filter for visitors. Fixes #1529
This commit is contained in:
parent
bea062149e
commit
63b0059ed5
4 changed files with 31 additions and 29 deletions
|
@ -183,7 +183,6 @@ public function logout()
|
||||||
unset($this->session['expires_on']);
|
unset($this->session['expires_on']);
|
||||||
unset($this->session['username']);
|
unset($this->session['username']);
|
||||||
unset($this->session['visibility']);
|
unset($this->session['visibility']);
|
||||||
unset($this->session['untaggedonly']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
$this->get('/add-tag/{newTag}', '\Shaarli\Front\Controller\Visitor\TagController:addTag');
|
$this->get('/add-tag/{newTag}', '\Shaarli\Front\Controller\Visitor\TagController:addTag');
|
||||||
$this->get('/remove-tag/{tag}', '\Shaarli\Front\Controller\Visitor\TagController:removeTag');
|
$this->get('/remove-tag/{tag}', '\Shaarli\Front\Controller\Visitor\TagController:removeTag');
|
||||||
$this->get('/links-per-page', '\Shaarli\Front\Controller\Visitor\PublicSessionFilterController:linksPerPage');
|
$this->get('/links-per-page', '\Shaarli\Front\Controller\Visitor\PublicSessionFilterController:linksPerPage');
|
||||||
$this->get('/untagged-only', '\Shaarli\Front\Controller\Admin\PublicSessionFilterController:untaggedOnly');
|
$this->get('/untagged-only', '\Shaarli\Front\Controller\Visitor\PublicSessionFilterController:untaggedOnly');
|
||||||
})->add('\Shaarli\Front\ShaarliMiddleware');
|
})->add('\Shaarli\Front\ShaarliMiddleware');
|
||||||
|
|
||||||
$app->group('/admin', function () {
|
$app->group('/admin', function () {
|
||||||
|
|
|
@ -207,15 +207,16 @@ public function testLogout()
|
||||||
'expires_on' => time() + 1000,
|
'expires_on' => time() + 1000,
|
||||||
'username' => 'johndoe',
|
'username' => 'johndoe',
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
'untaggedonly' => false,
|
'untaggedonly' => true,
|
||||||
];
|
];
|
||||||
$this->sessionManager->logout();
|
$this->sessionManager->logout();
|
||||||
|
|
||||||
$this->assertFalse(isset($this->session['ip']));
|
$this->assertArrayNotHasKey('ip', $this->session);
|
||||||
$this->assertFalse(isset($this->session['expires_on']));
|
$this->assertArrayNotHasKey('expires_on', $this->session);
|
||||||
$this->assertFalse(isset($this->session['username']));
|
$this->assertArrayNotHasKey('username', $this->session);
|
||||||
$this->assertFalse(isset($this->session['visibility']));
|
$this->assertArrayNotHasKey('visibility', $this->session);
|
||||||
$this->assertFalse(isset($this->session['untaggedonly']));
|
$this->assertArrayHasKey('untaggedonly', $this->session);
|
||||||
|
$this->assertTrue($this->session['untaggedonly']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<div class="linklist-paging">
|
<div class="linklist-paging">
|
||||||
<div class="paging pure-g">
|
<div class="paging pure-g">
|
||||||
<div class="linklist-filters pure-u-1-3">
|
<div class="linklist-filters pure-u-1-3">
|
||||||
{if="$is_logged_in or !empty($action_plugin)"}
|
|
||||||
<span class="linklist-filters-text pure-u-0 pure-u-lg-visible">
|
<span class="linklist-filters-text pure-u-0 pure-u-lg-visible">
|
||||||
{'Filters'|t}
|
{'Filters'|t}
|
||||||
</span>
|
</span>
|
||||||
|
@ -16,12 +15,15 @@
|
||||||
<a href="{$base_path}/untagged-only" aria-label="{'Filter untagged links'|t}" title="{'Filter untagged links'|t}"
|
<a href="{$base_path}/untagged-only" aria-label="{'Filter untagged links'|t}" title="{'Filter untagged links'|t}"
|
||||||
class={if="$untaggedonly"}"filter-on"{else}"filter-off"{/if}
|
class={if="$untaggedonly"}"filter-on"{else}"filter-off"{/if}
|
||||||
><i class="fa fa-tag" aria-hidden="true"></i></a>
|
><i class="fa fa-tag" aria-hidden="true"></i></a>
|
||||||
|
{if="$is_logged_in"}
|
||||||
<a href="#" aria-label="{'Select all'|t}" title="{'Select all'|t}"
|
<a href="#" aria-label="{'Select all'|t}" title="{'Select all'|t}"
|
||||||
class="filter-off select-all-button pure-u-0 pure-u-lg-visible"
|
class="filter-off select-all-button pure-u-0 pure-u-lg-visible"
|
||||||
><i class="fa fa-check-square-o" aria-hidden="true"></i></a>
|
><i class="fa fa-check-square-o" aria-hidden="true"></i></a>
|
||||||
|
{/if}
|
||||||
<a href="#" class="filter-off fold-all pure-u-lg-0" aria-label="{'Fold all'|t}" title="{'Fold all'|t}">
|
<a href="#" class="filter-off fold-all pure-u-lg-0" 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>
|
||||||
</a>
|
</a>
|
||||||
|
{if="!empty($action_plugin)"}
|
||||||
{loop="$action_plugin"}
|
{loop="$action_plugin"}
|
||||||
{$value.attr.class=isset($value.attr.class) ? $value.attr.class : ''}
|
{$value.attr.class=isset($value.attr.class) ? $value.attr.class : ''}
|
||||||
{$value.attr.class=!empty($value.on) ? $value.attr.class .' filter-on' : $value.attr.class .' filter-off'}
|
{$value.attr.class=!empty($value.on) ? $value.attr.class .' filter-on' : $value.attr.class .' filter-off'}
|
||||||
|
|
Loading…
Reference in a new issue