Commit 0accb60b authored by Curtis Adam's avatar Curtis Adam

Merge branch...

Merge branch '284-link-the-author-editor-name-to-the-filter-criterion-and-show-the-filter-drop-down-with-the-selected-name' into 'staging'

Resolve "Link the author/editor name to the filter criterion and show the filter drop-down with the selected name."

Closes #284

See merge request arsnova/cards!644
parents 58b4bae0 ff70dad7
......@@ -1258,6 +1258,12 @@
"all": "Alle",
"bonus": "Mit Lern-Bonus",
"transcriptBonus": "Mit Mitschreib-Bonus"
},
"author": {
"tooltip": {
"cardset": "Nach Autor/in \"__name__\" filtern",
"rep": "Nach Editor/in \"__name__\" filtern"
}
}
},
"infinite-scroll": {
......
......@@ -1260,6 +1260,12 @@
"all": "Alle",
"bonus": "Mit Lern-Bonus",
"transcriptBonus": "Mit Mitschreib-Bonus"
},
"author": {
"tooltip": {
"cardset": "Nach Autor/in \"__name__\" filtern",
"rep": "Nach Editor/in \"__name__\" filtern"
}
}
},
"infinite-scroll": {
......
......@@ -108,6 +108,11 @@ export let Filter = class Filter {
break;
case "author":
filter.owner = content;
if (content !== undefined) {
filter.name = undefined;
filter.date = undefined;
filter.dateUpdated = -1;
}
break;
case "noDifficulty":
filter.noDifficulty = content;
......
......@@ -86,6 +86,10 @@ Template.filterIndex.events({
'click .resultItemHeaderBottomAreaLabels .label-transcript-bonus': function () {
Filter.setActiveFilter(true, "transcriptBonus");
FilterNavigation.showDropdown();
},
'click .resultItemHeaderAuthor a': function (event) {
Filter.setActiveFilter($(event.target).data('id'), "author");
FilterNavigation.showDropdown();
}
});
......
......@@ -2,6 +2,9 @@
<div class="resultItemHeader authorProfile resultItemHeaderAuthor {{this.gridSize}} collapseButton {{getCardsetBackground
this.difficulty this.cardType}}"
data-id="{{this.owner}}">
{{getAuthorName this.owner}}
<a href="" data-id="{{this.owner}}"
title="{{#if this.shuffled}}{{_ "filter-pool.author.tooltip.rep" name = (getAuthorName this.owner)}}{{else}}{{_
"filter-pool.author.tooltip.cardset" name = (getAuthorName this.owner)}}{{/if}}">{{getAuthorName
this.owner}}</a>
</div>
</template>
......@@ -152,7 +152,7 @@ Template.main.onRendered(function () {
MainNavigation.clearSearch();
$('.navbar-cards-search-dropdown').removeClass('active');
}
if (!$(event.target).is('.cards-filter-element') && !$(event.target).parents('.resultItemHeaderBottomAreaLabels').length) {
if (!$(event.target).is('.resultItemHeaderAuthor a') && !$(event.target).is('.cards-filter-element') && !$(event.target).parents('.resultItemHeaderBottomAreaLabels').length) {
MainNavigation.clearSearch();
$('.navbar-cards-filter-dropdown').removeClass('active');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment