front/BaseTemplate: allow disabling header, h1 and footer via boolean attributes

This commit is contained in:
Alice Gaudon 2021-11-24 18:14:59 +01:00
parent f801f6a43b
commit aa1484749e

View File

@ -8,6 +8,9 @@
export let h1: string = title; export let h1: string = title;
export let description: string; export let description: string;
export let refresh_after: number | undefined = undefined; export let refresh_after: number | undefined = undefined;
export let noHeader: boolean = false;
export let noH1: boolean = false;
export let noFooter: boolean = false;
</script> </script>
<CommonScripts/> <CommonScripts/>
@ -46,14 +49,16 @@
<link rel="stylesheet" href="/css/layout.css"> <link rel="stylesheet" href="/css/layout.css">
</svelte:head> </svelte:head>
<BaseHeader/> {#if !noHeader}
<BaseHeader/>
{/if}
<div class="flash-messages"> <div class="flash-messages">
<FlashMessages/> <FlashMessages/>
</div> </div>
<main> <main>
{#if h1} {#if h1 && !noH1}
<h1>{h1}</h1> <h1>{h1}</h1>
{/if} {/if}
{#if $$slots.subtitle} {#if $$slots.subtitle}
@ -64,4 +69,6 @@
<slot/> <slot/>
</main> </main>
<BaseFooter/> {#if !noFooter}
<BaseFooter/>
{/if}