Skip to content

Commit

Permalink
pkp/pkp-lib#2612 Move catalog filter params into filter items
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr committed Aug 14, 2017
1 parent 98ef5f4 commit 99f1ab4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function getConfig() {
list($categorySortBy, $categorySortDir) = explode('-', $category->getSortOption());
$categorySortDir = empty($categorySortDir) ? $catalogSortDir : $categorySortDir == SORT_DIRECTION_ASC ? 'ASC' : 'DESC';
$categories[] = array(
'param' => 'categoryIds',
'val' => (int) $category->getId(),
'title' => $category->getLocalizedTitle(),
'sortBy' => $categorySortBy,
Expand All @@ -113,6 +114,7 @@ public function getConfig() {
list($seriesSortBy, $seriesSortDir) = explode('-', $seriesObj->getSortOption());
$seriesSortDir = empty($seriesSortDir) ? $catalogSortDir : $seriesSortDir == SORT_DIRECTION_ASC ? 'ASC' : 'DESC';
$series[] = array(
'param' => 'seriesIds',
'val' => (int) $seriesObj->getId(),
'title' => $seriesObj->getLocalizedTitle(),
);
Expand Down
10 changes: 5 additions & 5 deletions js/controllers/list/submissions/CatalogSubmissionsListFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
{{ i18n.filter }}
</div>
<div class="pkpListPanel__filterOptions pkpListPanel__filterOptions--catalogSubmissions">
<div v-for="(filter, param) in filters" class="pkpListPanel__filterSet">
<div v-for="filter in filters" class="pkpListPanel__filterSet">
<div v-if="filter.heading" class="pkpListPanel__filterSetLabel">
{{ filter.heading }}
</div>
<ul>
<li v-for="filterItem in filter.filters">
<a href="#"
@click.prevent.stop="filterBy(param, filterItem.val)"
@click.prevent.stop="filterBy(filterItem.param, filterItem.val)"
class="pkpListPanel__filterLabel"
:class="{'--isActive': isFilterActive(param, filterItem.val)}"
:class="{'--isActive': isFilterActive(filterItem.param, filterItem.val)}"
:tabindex="tabIndex"
>{{ filterItem.title }}</a>
<button
v-if="isFilterActive(param, filterItem.val)"
v-if="isFilterActive(filterItem.param, filterItem.val)"
href="#"
class="pkpListPanel__filterRemove"
@click.prevent.stop="clearFilter(param, filterItem.val)"
@click.prevent.stop="clearFilter(filterItem.param, filterItem.val)"
>
<span class="fa fa-times-circle-o"></span>
<span class="pkpListPanel__filterRemoveLabel">{{ __('filterRemove', {filterTitle: filterItem.title}) }}</span>
Expand Down

0 comments on commit 99f1ab4

Please sign in to comment.