add ul.grid, improve /create and SLayout
This commit is contained in:
parent
4f816c9066
commit
58d6a248c7
5 changed files with 172 additions and 27 deletions
|
|
@ -1,11 +1,15 @@
|
|||
<script lang="ts">
|
||||
import Centered from "$lib/Centered.svelte";
|
||||
import { getMe } from "$lib/globals.svelte";
|
||||
import GuildSelect from "$lib/GuildSelect.svelte";
|
||||
import PrivacySelect from "$lib/PrivacySelect.svelte";
|
||||
import SLayout from "$lib/SLayout.svelte";
|
||||
import { RiErrorWarningLine } from "svelte-remixicon";
|
||||
|
||||
let me = getMe();
|
||||
|
||||
let content = $state("");
|
||||
let privacy = $state(0);
|
||||
|
||||
let contentLength = $derived(content.length);
|
||||
|
||||
|
|
@ -14,35 +18,43 @@
|
|||
|
||||
{#if me}
|
||||
<SLayout title="New post">
|
||||
<form method="POST">
|
||||
<p>Posting as <strong>@{me.username}</strong></p>
|
||||
<form method="POST" class="card">
|
||||
<p>Posting as <strong>@{me.username}</strong></p>
|
||||
|
||||
<label>
|
||||
Post to: <!-- TODO autocomplete! -->
|
||||
<input />
|
||||
</label>
|
||||
<label>
|
||||
Post to: <!-- TODO autocomplete! -->
|
||||
<GuildSelect />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="text" name="title" maxlength=256 placeholder="An interesting title"/>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<textarea bind:value={content}></textarea>
|
||||
<output><small class="faint">{contentLength} chars</small></output>
|
||||
</label>
|
||||
</form>
|
||||
|
||||
{#snippet left()}
|
||||
...
|
||||
{/snippet}
|
||||
<label>
|
||||
<input type="text" name="title" maxlength=256 placeholder="An interesting title"/>
|
||||
</label>
|
||||
|
||||
{#snippet right()}
|
||||
...
|
||||
{/snippet}
|
||||
<label>
|
||||
<textarea bind:value={content}></textarea>
|
||||
<output><small class="faint">{contentLength} chars</small></output>
|
||||
</label>
|
||||
|
||||
<PrivacySelect bind:value={privacy} />
|
||||
{#if privacy === 0}
|
||||
<span class="warning"><RiErrorWarningLine /> Your post will be PUBLIC!</span>
|
||||
{/if}
|
||||
|
||||
<button class="card primary" disabled>Create</button>
|
||||
|
||||
</form>
|
||||
|
||||
{#snippet left()}
|
||||
...
|
||||
{/snippet}
|
||||
|
||||
{#snippet right()}
|
||||
...
|
||||
{/snippet}
|
||||
</SLayout>
|
||||
{:else}
|
||||
<Centered>
|
||||
You must be <a href="login">logged in</a> in order to create posts.
|
||||
You must be <a href="login">logged in</a> in order to create posts.
|
||||
</Centered>
|
||||
{/if}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue