FIX: dismiss new button for tags on top (#12628)
Currently, new topics for specific tags can be dismissed with the button at the bottom of the page. When there is more than 15 new topics, we should display the same button at the top as well. It already works in the same manner for categories.
This commit is contained in:
parent
5da7e0c8e5
commit
8b735e6f9e
|
@ -110,6 +110,15 @@ export default Controller.extend(BulkTopicSelection, FilterModeMixin, {
|
|||
return this.isFilterPage(filter, "new") && topicsLength > 0;
|
||||
},
|
||||
|
||||
@discourseComputed("list.filter", "list.topics.length")
|
||||
showDismissAtTop(filter, topicsLength) {
|
||||
return (
|
||||
(this.isFilterPage(filter, "new") ||
|
||||
this.isFilterPage(filter, "unread")) &&
|
||||
topicsLength >= 15
|
||||
);
|
||||
},
|
||||
|
||||
actions: {
|
||||
dismissReadPosts() {
|
||||
showModal("dismiss-read", { title: "topics.bulk.dismiss_read" });
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<div class="container">
|
||||
{{discourse-banner user=currentUser banner=site.banner}}
|
||||
</div>
|
||||
|
||||
<div class="list-controls">
|
||||
<div class="container">
|
||||
<section class="navigation-container tag-navigation">
|
||||
|
@ -32,6 +31,28 @@
|
|||
|
||||
{{plugin-outlet name="discovery-list-container-top" args=(hash category=category)}}
|
||||
|
||||
{{#if showDismissAtTop}}
|
||||
<div class="row dismiss-container-top">
|
||||
{{#if showDismissRead}}
|
||||
{{d-button
|
||||
class="btn-default dismiss-read"
|
||||
id="dismiss-topics"
|
||||
action=(action "dismissReadPosts")
|
||||
title="topics.bulk.dismiss_tooltip"
|
||||
label="topics.bulk.dismiss_button"}}
|
||||
{{/if}}
|
||||
|
||||
{{#if showResetNew}}
|
||||
{{d-button
|
||||
class="btn-default dismiss-read"
|
||||
action=(action "resetNew")
|
||||
id="dismiss-new"
|
||||
icon="check"
|
||||
label="topics.bulk.dismiss_new"}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="container list-container">
|
||||
<div class="row">
|
||||
<div class="full-width">
|
||||
|
|
Loading…
Reference in New Issue