diff --git a/app/assets/javascripts/discourse/app/controllers/discovery.js b/app/assets/javascripts/discourse/app/controllers/discovery.js index ae0570b28bf..9a8d58b310d 100644 --- a/app/assets/javascripts/discourse/app/controllers/discovery.js +++ b/app/assets/javascripts/discourse/app/controllers/discovery.js @@ -2,6 +2,7 @@ import Controller, { inject as controller } from "@ember/controller"; import { alias, equal, not } from "@ember/object/computed"; import { action } from "@ember/object"; import Category from "discourse/models/category"; +import discourseComputed from "discourse-common/utils/decorators"; import DiscourseURL from "discourse/lib/url"; import { inject as service } from "@ember/service"; @@ -21,6 +22,24 @@ export default Controller.extend({ loadedAllItems: not("discoveryTopics.model.canLoadMore"), + @discourseComputed( + "router.currentRouteName", + "router.currentRoute.queryParams.f", + "site.show_welcome_topic_banner" + ) + showEditWelcomeTopicBanner( + currentRouteName, + hasParams, + showWelcomeTopicBanner + ) { + return ( + this.currentUser?.staff && + currentRouteName === "discovery.latest" && + showWelcomeTopicBanner && + !hasParams + ); + }, + @action loadingBegan() { this.set("loading", true); diff --git a/app/assets/javascripts/discourse/app/controllers/discovery/topics.js b/app/assets/javascripts/discourse/app/controllers/discovery/topics.js index c1f500a80b0..caa92925ba1 100644 --- a/app/assets/javascripts/discourse/app/controllers/discovery/topics.js +++ b/app/assets/javascripts/discourse/app/controllers/discovery/topics.js @@ -24,20 +24,6 @@ const controllerOpts = { showTopicPostBadges: not("new"), redirectedReason: alias("currentUser.redirected_to_top.reason"), - @discourseComputed( - "model.filter", - "site.show_welcome_topic_banner", - "model.listParams.f" - ) - showEditWelcomeTopicBanner(filter, showWelcomeTopicBanner, hasListParams) { - return ( - this.currentUser?.staff && - filter === "latest" && - showWelcomeTopicBanner && - !hasListParams - ); - }, - expandGloballyPinned: false, expandAllPinned: false, diff --git a/app/assets/javascripts/discourse/app/templates/discovery.hbs b/app/assets/javascripts/discourse/app/templates/discovery.hbs index bcc1ce644ef..5a51b5b4c9c 100644 --- a/app/assets/javascripts/discourse/app/templates/discovery.hbs +++ b/app/assets/javascripts/discourse/app/templates/discovery.hbs @@ -18,6 +18,10 @@ +{{#if this.showEditWelcomeTopicBanner}} + +{{/if}} +
diff --git a/app/assets/javascripts/discourse/app/templates/discovery/topics.hbs b/app/assets/javascripts/discourse/app/templates/discovery/topics.hbs index 3b6018bae95..6d934e9ad0d 100644 --- a/app/assets/javascripts/discourse/app/templates/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/app/templates/discovery/topics.hbs @@ -2,10 +2,6 @@
{{this.redirectedReason}}
{{/if}} -{{#if this.showEditWelcomeTopicBanner}} - -{{/if}} - {{#if this.model.sharedDrafts}} diff --git a/app/assets/stylesheets/desktop/topic-list.scss b/app/assets/stylesheets/desktop/topic-list.scss index e91f1975426..1c274156aec 100644 --- a/app/assets/stylesheets/desktop/topic-list.scss +++ b/app/assets/stylesheets/desktop/topic-list.scss @@ -269,9 +269,6 @@ display: flex; flex-direction: row; justify-content: space-between; - position: absolute; - top: 48px; - width: calc(100% - 40px); z-index: z("usercard"); &__content { width: 70%;