Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified layout of election creation page #689

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 38 additions & 32 deletions src/routes/(app)/elections/ElectionEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,49 @@
<h1 class="text-2xl font-bold">
{isCreating ? m.elections_create() : m.elections_edit()}
</h1>
<Input
name="markdown"
label={m.elections_content_sv()}
textarea
bind:value={$form.markdown}
error={$errors.markdown}
{...$constraints.markdown}
/>
<Input
name="markdownEn"
label={m.elections_content_en()}
textarea
bind:value={$form.markdownEn}
error={$errors.markdownEn}
{...$constraints.markdownEn}
/>
<label class="label-text" for="committee">{m.elections_committee()}*</label>
<select
id="committee"
name="committeeId"
class="max-w select select-bordered w-full"
bind:value={$form.committeeId}
{...$constraints.committeeId}
>
{#each data.committees as committeeOption}
<option value={committeeOption.id}>{committeeOption.name}</option>
{/each}
</select>
{#if $errors.committeeId}
<p class="text-error">{$errors.committeeId}</p>
{/if}
<div class="flex flex-col gap-0 *:w-full md:h-64 md:flex-row md:gap-8">
<Input
name="markdown"
label={m.elections_content_sv()}
textarea
bind:value={$form.markdown}
error={$errors.markdown}
class="h-full"
placeholder="- Post 1&#13;- Post 2&#13;- Post 3"
{...$constraints.markdown}
/>
<Input
name="markdownEn"
label={m.elections_content_en()}
textarea
bind:value={$form.markdownEn}
error={$errors.markdownEn}
class="h-full"
placeholder="- Position 1&#13;- Position 2&#13;- Position 3"
{...$constraints.markdownEn}
/>
</div>
<Input
name="link"
label={m.elections_link()}
bind:value={$form.link}
error={$errors.link}
placeholder={m.elections_link_placeholder()}
{...$constraints.link}
/>
<Input
Expand All @@ -60,22 +82,6 @@
error={$errors.expiresAt}
{...$constraints.expiresAt}
/>

<label class="label-text" for="committee">{m.elections_committee()}*</label>
<select
id="committee"
name="committeeId"
class="max-w select select-bordered w-full"
bind:value={$form.committeeId}
{...$constraints.committeeId}
>
{#each data.committees as committeeOption}
<option value={committeeOption.id}>{committeeOption.name}</option>
{/each}
</select>
{#if $errors.committeeId}
<p class="text-error">{$errors.committeeId}</p>
{/if}
<button type="submit" class="btn btn-primary mx-auto mt-4 w-4/12">
{m.elections_save()}
</button>
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@
"elections_expiryDate": "Last application date (23:59)",
"elections_committee": "Committee",
"elections_save": "Save",
"elections_link_placeholder": "https://forms.google.com/... or https://dsek.se/news/...",
"expenses": "Expenses",
"expense": "Expense",
"expenseCreated": "Expense created",
Expand Down
1 change: 1 addition & 0 deletions src/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@
"elections_expiryDate": "Sista ansökningsdag (23:59)",
"elections_committee": "Utskott",
"elections_save": "Spara",
"elections_link_placeholder": "https://forms.google.com/... eller https://dsek.se/news/...",
"expenses": "Utlägg",
"expense": "Utlägg",
"expenseCreated": "Utlägg skapat",
Expand Down
Loading