UX: Hide all header and footer content on chat routes
This commit is contained in:
parent
9b691853e0
commit
1dc4d6c9d5
|
@ -2,6 +2,7 @@ import Controller from "@ember/controller";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import { service } from "@ember/service";
|
import { service } from "@ember/service";
|
||||||
import runAfterFramePaint from "discourse/lib/after-frame-paint";
|
import runAfterFramePaint from "discourse/lib/after-frame-paint";
|
||||||
|
import { applyValueTransformer } from "discourse/lib/transformer";
|
||||||
import { isTesting } from "discourse-common/config/environment";
|
import { isTesting } from "discourse-common/config/environment";
|
||||||
import discourseDebounce from "discourse-common/lib/debounce";
|
import discourseDebounce from "discourse-common/lib/debounce";
|
||||||
import deprecated from "discourse-common/lib/deprecated";
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
@ -39,6 +40,10 @@ export default class ApplicationController extends Controller {
|
||||||
return this.showFooter && this.siteSettings.enable_powered_by_discourse;
|
return this.showFooter && this.siteSettings.enable_powered_by_discourse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get showBannerContent() {
|
||||||
|
return applyValueTransformer("show-application-banner-content", true);
|
||||||
|
}
|
||||||
|
|
||||||
@discourseComputed
|
@discourseComputed
|
||||||
canSignUp() {
|
canSignUp() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -13,4 +13,5 @@ export const VALUE_TRANSFORMERS = Object.freeze([
|
||||||
"mentions-class",
|
"mentions-class",
|
||||||
"more-topics-tabs",
|
"more-topics-tabs",
|
||||||
"post-menu-buttons",
|
"post-menu-buttons",
|
||||||
|
"show-application-banner-content",
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -47,34 +47,44 @@
|
||||||
|
|
||||||
<LoadingSliderFallbackSpinner />
|
<LoadingSliderFallbackSpinner />
|
||||||
|
|
||||||
<PluginOutlet @name="before-main-outlet" />
|
{{#if this.showBannerContent}}
|
||||||
|
<PluginOutlet @name="before-main-outlet" />
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div id="main-outlet">
|
<div id="main-outlet">
|
||||||
<PluginOutlet @name="above-main-container" @connectorTagName="div" />
|
{{#if this.showBannerContent}}
|
||||||
|
<PluginOutlet @name="above-main-container" @connectorTagName="div" />
|
||||||
|
{{/if}}
|
||||||
<div class="container" id="main-container">
|
<div class="container" id="main-container">
|
||||||
{{#if this.showTop}}
|
{{#if this.showBannerContent}}
|
||||||
<CustomHtml @name="top" />
|
{{#if this.showTop}}
|
||||||
|
<CustomHtml @name="top" />
|
||||||
|
{{/if}}
|
||||||
|
<NotificationConsentBanner />
|
||||||
|
<PwaInstallBanner />
|
||||||
|
<GlobalNotice />
|
||||||
|
<PluginOutlet
|
||||||
|
@name="top-notices"
|
||||||
|
@connectorTagName="div"
|
||||||
|
@outletArgs={{hash currentPath=this.router._router.currentPath}}
|
||||||
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<NotificationConsentBanner />
|
|
||||||
<PwaInstallBanner />
|
|
||||||
<GlobalNotice />
|
|
||||||
<PluginOutlet
|
|
||||||
@name="top-notices"
|
|
||||||
@connectorTagName="div"
|
|
||||||
@outletArgs={{hash currentPath=this.router._router.currentPath}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
|
|
||||||
<CardContainer />
|
<CardContainer />
|
||||||
<PluginOutlet
|
{{#if this.showBannerContent}}
|
||||||
@name="main-outlet-bottom"
|
<PluginOutlet
|
||||||
@outletArgs={{hash showFooter=this.showFooter}}
|
@name="main-outlet-bottom"
|
||||||
/>
|
@outletArgs={{hash showFooter=this.showFooter}}
|
||||||
|
/>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<PluginOutlet @name="after-main-outlet" />
|
{{#if this.showBannerContent}}
|
||||||
|
<PluginOutlet @name="after-main-outlet" />
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if this.showPoweredBy}}
|
{{#if this.showPoweredBy}}
|
||||||
<PoweredByDiscourse />
|
<PoweredByDiscourse />
|
||||||
|
|
|
@ -172,6 +172,16 @@ class ChatSetupInit {
|
||||||
category: "organisms",
|
category: "organisms",
|
||||||
id: "chat",
|
id: "chat",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
api.registerValueTransformer(
|
||||||
|
"show-application-banner-content",
|
||||||
|
({ value }) => {
|
||||||
|
if (this.router.currentRouteName.startsWith("chat.")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
.has-full-page-chat {
|
|
||||||
.global-notice,
|
|
||||||
.bootstrap-mode-notice {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-plugins {
|
.admin-plugins {
|
||||||
[data-plugin-name="chat"] {
|
[data-plugin-name="chat"] {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
Loading…
Reference in New Issue