From 8b735e6f9ee40843bb07740deb53a3c934929031 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Thu, 8 Apr 2021 10:46:08 +1000 Subject: [PATCH] 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. --- .../discourse/app/controllers/tag-show.js | 9 ++++++++ .../discourse/app/templates/tags/show.hbs | 23 ++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/controllers/tag-show.js b/app/assets/javascripts/discourse/app/controllers/tag-show.js index f3544c5c6be..0bf4cec6a96 100644 --- a/app/assets/javascripts/discourse/app/controllers/tag-show.js +++ b/app/assets/javascripts/discourse/app/controllers/tag-show.js @@ -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" }); diff --git a/app/assets/javascripts/discourse/app/templates/tags/show.hbs b/app/assets/javascripts/discourse/app/templates/tags/show.hbs index ebd7b75c1a3..0837c851a6f 100644 --- a/app/assets/javascripts/discourse/app/templates/tags/show.hbs +++ b/app/assets/javascripts/discourse/app/templates/tags/show.hbs @@ -2,7 +2,6 @@
{{discourse-banner user=currentUser banner=site.banner}}
-