Rename front layouts to templates

This commit is contained in:
Alice Gaudon 2021-11-21 13:08:57 +01:00
parent da6fda02a9
commit c0918b17ed
25 changed files with 42 additions and 42 deletions

View File

@ -1,6 +1,6 @@
<script> <script>
import {locals} from "../../../ts/stores"; import {locals} from "../../../ts/stores";
import BaseLayout from "../../layouts/BaseLayout.svelte"; import BaseTemplate from "../../templates/BaseTemplate.svelte";
import Message from "../../components/Message.svelte"; import Message from "../../components/Message.svelte";
import NamePanel from "./NamePanel.svelte"; import NamePanel from "./NamePanel.svelte";
import PasswordPanel from "./PasswordPanel.svelte"; import PasswordPanel from "./PasswordPanel.svelte";
@ -14,7 +14,7 @@
const emails = $locals.emails || []; const emails = $locals.emails || [];
</script> </script>
<BaseLayout title="Account" description="Manage your account settings and data."> <BaseTemplate title="Account" description="Manage your account settings and data.">
<div class="container"> <div class="container">
<div class="panel"> <div class="panel">
<h2><Icon name="user"/> Personal information</h2> <h2><Icon name="user"/> Personal information</h2>
@ -101,4 +101,4 @@
{/if} {/if}
</section> </section>
</div> </div>
</BaseLayout> </BaseTemplate>

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import {locals} from "../../ts/stores.js"; import {locals} from "../../ts/stores.js";
import BaseLayout from "../layouts/BaseLayout.svelte"; import BaseTemplate from "../templates/BaseTemplate.svelte";
import Form from "../utils/Form.svelte"; import Form from "../utils/Form.svelte";
import Field from "../utils/Field.svelte"; import Field from "../utils/Field.svelte";
import Icon from "../utils/Icon.svelte"; import Icon from "../utils/Icon.svelte";
@ -18,9 +18,9 @@
} }
</script> </script>
<BaseLayout title="Authentication / Registration" <BaseTemplate title="Authentication / Registration"
description="Join {$locals.app.name} and share your files!" description="Join {$locals.app.name} and share your files!"
h1="Authentication and registration"> h1="Authentication and registration">
<div class="container"> <div class="container">
{#if hasRoute('login')} {#if hasRoute('login')}
@ -74,4 +74,4 @@
</section> </section>
{/if} {/if}
</div> </div>
</BaseLayout> </BaseTemplate>

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import {locals} from "../../ts/stores"; import {locals} from "../../ts/stores";
import BaseLayout from "../layouts/BaseLayout.svelte"; import BaseTemplate from "../templates/BaseTemplate.svelte";
import Pagination from "../components/Pagination.svelte"; import Pagination from "../components/Pagination.svelte";
import Form from "../utils/Form.svelte"; import Form from "../utils/Form.svelte";
import Field from "../utils/Field.svelte"; import Field from "../utils/Field.svelte";
@ -16,7 +16,7 @@
} }
</style> </style>
<BaseLayout title="{$locals.app.name} - Review accounts" h1={false}> <BaseTemplate title="{$locals.app.name} - Review accounts" h1={false}>
{#if hasRoute('backend')} {#if hasRoute('backend')}
<Breadcrumb currentPageTitle="Accounts pending review" pages={[ <Breadcrumb currentPageTitle="Accounts pending review" pages={[
{link: route('backend'), title:'Backend'}, {link: route('backend'), title:'Backend'},
@ -78,4 +78,4 @@
</div> </div>
<Pagination pagination={$locals.pagination} routeName="accounts-approval" contextSize="3" /> <Pagination pagination={$locals.pagination} routeName="accounts-approval" contextSize="3" />
</BaseLayout> </BaseTemplate>

View File

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import {locals} from "../../ts/stores.js"; import {locals} from "../../ts/stores.js";
import BaseLayout from "../layouts/BaseLayout.svelte"; import BaseTemplate from "../templates/BaseTemplate.svelte";
import Breadcrumb from "../components/Breadcrumb.svelte"; import Breadcrumb from "../components/Breadcrumb.svelte";
import Icon from "../utils/Icon.svelte"; import Icon from "../utils/Icon.svelte";
const menu = $locals.menu || []; const menu = $locals.menu || [];
</script> </script>
<BaseLayout title="{$locals.app.name} backend" h1={false}> <BaseTemplate title="{$locals.app.name} backend" h1={false}>
<div class="container"> <div class="container">
<Breadcrumb currentPageTitle="Backend"/> <Breadcrumb currentPageTitle="Backend"/>
@ -30,4 +30,4 @@
</nav> </nav>
</div> </div>
</div> </div>
</BaseLayout> </BaseTemplate>

View File

@ -1,5 +1,5 @@
<script> <script>
import Error from "./Error.svelte"; import ErrorTemplate from "../templates/ErrorTemplate.svelte";
</script> </script>
<Error code={400} message="Bad request." /> <ErrorTemplate code={400} message="Bad request." />

View File

@ -1,5 +1,5 @@
<script> <script>
import Error from "./Error.svelte"; import ErrorTemplate from "../templates/ErrorTemplate.svelte";
</script> </script>
<Error code={401} message="Unauthorized." /> <ErrorTemplate code={401} message="Unauthorized." />

View File

@ -1,5 +1,5 @@
<script> <script>
import Error from "./Error.svelte"; import ErrorTemplate from "../templates/ErrorTemplate.svelte";
</script> </script>
<Error code={403} message="Forbidden" /> <ErrorTemplate code={403} message="Forbidden" />

View File

@ -1,5 +1,5 @@
<script> <script>
import Error from "./Error.svelte"; import ErrorTemplate from "../templates/ErrorTemplate.svelte";
</script> </script>
<Error code={404} message="Page not found." /> <ErrorTemplate code={404} message="Page not found." />

View File

@ -1,5 +1,5 @@
<script> <script>
import Error from "./Error.svelte"; import ErrorTemplate from "../templates/ErrorTemplate.svelte";
</script> </script>
<Error code={429} message="Too many requests." /> <ErrorTemplate code={429} message="Too many requests." />

View File

@ -1,5 +1,5 @@
<script> <script>
import Error from "./Error.svelte"; import ErrorTemplate from "../templates/ErrorTemplate.svelte";
</script> </script>
<Error code={500} message="Internal server error." /> <ErrorTemplate code={500} message="Internal server error." />

View File

@ -1,5 +1,5 @@
<script> <script>
import Error from "./Error.svelte"; import ErrorTemplate from "../templates/ErrorTemplate.svelte";
</script> </script>
<Error code={503} message="Service unavailable." /> <ErrorTemplate code={503} message="Service unavailable." />

View File

@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import {locals} from "../ts/stores"; import {locals} from "../ts/stores";
import {route, hasRoute, hasAnyRoute} from "../../common/Routing"; import {route, hasRoute, hasAnyRoute} from "../../common/Routing";
import BaseLayout from "./layouts/BaseLayout.svelte"; import BaseTemplate from "./templates/BaseTemplate.svelte";
</script> </script>
<BaseLayout title="{$locals.app.name}" h1={false}> <BaseTemplate title="{$locals.app.name}" h1={false}>
<div class="panel"> <div class="panel">
<h1>swaf - Svelte Web Application Framework</h1> <h1>swaf - Svelte Web Application Framework</h1>
<p>Welcome to {$locals.app.name}!</p> <p>Welcome to {$locals.app.name}!</p>
@ -22,4 +22,4 @@
</nav> </nav>
{/if} {/if}
</div> </div>
</BaseLayout> </BaseTemplate>

View File

@ -1,13 +1,13 @@
<script> <script>
import {locals} from "../ts/stores"; import {locals} from "../ts/stores";
import BaseLayout from "./layouts/BaseLayout.svelte"; import BaseTemplate from "./templates/BaseTemplate.svelte";
import Message from "./components/Message.svelte"; import Message from "./components/Message.svelte";
const actionType = $locals.magicLink?.action_type; const actionType = $locals.magicLink?.action_type;
const h1 = 'Magic Link' + (actionType ? (' - ' + actionType) : ''); const h1 = 'Magic Link' + (actionType ? (' - ' + actionType) : '');
</script> </script>
<BaseLayout title="{$locals.app.name} {h1}" {h1}> <BaseTemplate title="{$locals.app.name} {h1}" {h1}>
<div class="container"> <div class="container">
<div class="panel"> <div class="panel">
{#if $locals.err} {#if $locals.err}
@ -18,4 +18,4 @@
{/if} {/if}
</div> </div>
</div> </div>
</BaseLayout> </BaseTemplate>

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import {locals} from "../ts/stores.js"; import {locals} from "../ts/stores.js";
import BaseLayout from "./layouts/BaseLayout.svelte"; import BaseTemplate from "./templates/BaseTemplate.svelte";
import Message from "./components/Message.svelte"; import Message from "./components/Message.svelte";
import WebsocketClient from "../ts/WebsocketClient.js"; import WebsocketClient from "../ts/WebsocketClient.js";
import {Time} from "../../common/Time.js"; import {Time} from "../../common/Time.js";
@ -37,7 +37,7 @@
}); });
</script> </script>
<BaseLayout h1="Authentication lobby" title="{$locals.app.name} authentication lobby"> <BaseTemplate h1="Authentication lobby" title="{$locals.app.name} authentication lobby">
<div class="container"> <div class="container">
<div class="panel"> <div class="panel">
<Message type="success" sticky <Message type="success" sticky
@ -48,4 +48,4 @@
<p class="center">Waiting for you to open the link...</p> <p class="center">Waiting for you to open the link...</p>
</div> </div>
</div> </div>
</BaseLayout> </BaseTemplate>

View File

@ -64,7 +64,7 @@ export default class SvelteViewEngine extends ViewEngine {
const view = await this.fileCache.get(actualFile, !config.get<boolean>('view.cache')); const view = await this.fileCache.get(actualFile, !config.get<boolean>('view.cache'));
// Root template // Root template
const templateFile = await this.resolveFileFromCanonicalNameOrFail('layouts/svelte_layout.html'); const templateFile = await this.resolveFileFromCanonicalNameOrFail('templates/svelte_template.html');
const rawOutput = await this.fileCache.get(templateFile, !config.get<boolean>('view.cache')); const rawOutput = await this.fileCache.get(templateFile, !config.get<boolean>('view.cache'));
// Pre-compiled parts // Pre-compiled parts

View File

@ -1,6 +1,6 @@
<script> <script>
import {route} from "../../common/Routing"; import {route} from "../../common/Routing";
import BaseLayout from "./layouts/BaseLayout.svelte"; import BaseTemplate from "./templates/BaseTemplate.svelte";
import Message from "./components/Message.svelte"; import Message from "./components/Message.svelte";
import Form from "./utils/Form.svelte"; import Form from "./utils/Form.svelte";
import Field from "./utils/Field.svelte"; import Field from "./utils/Field.svelte";
@ -13,7 +13,7 @@
const paginationData = new PaginationData(20, 20, 1000).serialize(); const paginationData = new PaginationData(20, 20, 1000).serialize();
</script> </script>
<BaseLayout title="Design test"> <BaseTemplate title="Design test">
<DesignButtons/> <DesignButtons/>
<div class="panel"> <div class="panel">
@ -114,6 +114,6 @@
{link: route('design'), title: 'self'}, {link: route('design'), title: 'self'},
]}/> ]}/>
</div> </div>
</BaseLayout> </BaseTemplate>

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import AllTests from "./AllTests.svelte"; import AllTests from "./AllTests.svelte";
import BaseLayout from "./layouts/BaseLayout.svelte"; import BaseLayout from "./templates/BaseTemplate.svelte";
</script> </script>
<BaseLayout title="Frontend tests"> <BaseLayout title="Frontend tests">