diff --git a/frontend/src/routes/edit/EditableField.svelte b/frontend/src/lib/components/edit/EditableField.svelte similarity index 100% rename from frontend/src/routes/edit/EditableField.svelte rename to frontend/src/lib/components/edit/EditableField.svelte diff --git a/frontend/src/routes/edit/EditableName.svelte b/frontend/src/lib/components/edit/EditableName.svelte similarity index 100% rename from frontend/src/routes/edit/EditableName.svelte rename to frontend/src/lib/components/edit/EditableName.svelte diff --git a/frontend/src/routes/edit/EditablePronouns.svelte b/frontend/src/lib/components/edit/EditablePronouns.svelte similarity index 100% rename from frontend/src/routes/edit/EditablePronouns.svelte rename to frontend/src/lib/components/edit/EditablePronouns.svelte diff --git a/frontend/src/routes/edit/FieldEntry.svelte b/frontend/src/lib/components/edit/FieldEntry.svelte similarity index 100% rename from frontend/src/routes/edit/FieldEntry.svelte rename to frontend/src/lib/components/edit/FieldEntry.svelte diff --git a/frontend/src/routes/edit/FlagButton.svelte b/frontend/src/lib/components/edit/FlagButton.svelte similarity index 100% rename from frontend/src/routes/edit/FlagButton.svelte rename to frontend/src/lib/components/edit/FlagButton.svelte diff --git a/frontend/src/routes/edit/MarkdownHelp.svelte b/frontend/src/lib/components/edit/MarkdownHelp.svelte similarity index 100% rename from frontend/src/routes/edit/MarkdownHelp.svelte rename to frontend/src/lib/components/edit/MarkdownHelp.svelte diff --git a/frontend/src/routes/edit/member/[id]/+page.svelte b/frontend/src/routes/edit/member/[id]/+page.svelte index 1ab1819..3547165 100644 --- a/frontend/src/routes/edit/member/[id]/+page.svelte +++ b/frontend/src/routes/edit/member/[id]/+page.svelte @@ -34,16 +34,16 @@ import { PUBLIC_SHORT_BASE } from "$env/static/public"; import { apiFetchClient, fastFetchClient } from "$lib/api/fetch"; import IconButton from "$lib/components/IconButton.svelte"; - import EditableField from "../../EditableField.svelte"; - import EditableName from "../../EditableName.svelte"; - import EditablePronouns from "../../EditablePronouns.svelte"; + import EditableField from "$lib/components/edit/EditableField.svelte"; + import EditableName from "$lib/components/edit/EditableName.svelte"; + import EditablePronouns from "$lib/components/edit/EditablePronouns.svelte"; import ErrorAlert from "$lib/components/ErrorAlert.svelte"; import type { PageData, Snapshot } from "./$types"; import { addToast, delToast } from "$lib/toast"; import { memberNameRegex } from "$lib/api/regex"; import { charCount, renderMarkdown } from "$lib/utils"; - import MarkdownHelp from "../../MarkdownHelp.svelte"; - import FlagButton from "../../FlagButton.svelte"; + import MarkdownHelp from "$lib/components/edit/MarkdownHelp.svelte"; + import FlagButton from "$lib/components/edit/FlagButton.svelte"; const MAX_AVATAR_BYTES = 1_000_000; diff --git a/frontend/src/routes/edit/profile-old/+page.svelte b/frontend/src/routes/edit/profile-old/+page.svelte deleted file mode 100644 index ea1648a..0000000 --- a/frontend/src/routes/edit/profile-old/+page.svelte +++ /dev/null @@ -1,502 +0,0 @@ - - - - Edit profile - pronouns.cc - - -

- Edit profile - - - {#if modified} - - {/if} - -

- -{#if error} - -{/if} - - - -
- {#each links as _, index} -
- moveLink(index, true)} - /> - moveLink(index, false)} - /> - - removeLink(index)} - /> -
- {/each} -
- - - -
-
- -
-
- - -

- - This is the text used for the "Members" heading. If you leave it blank, the default text - will be used. -

-
- {#if PUBLIC_SHORT_BASE} -
-

- Current short ID: {data.user.sid} - - - - -
- - - This ID is used in prns.cc links. You can reroll one short ID every hour (shared - between your main profile and all members) by pressing the button above. - -

- {/if} -
-
-
- - -
-

- - This only hides your member list. - - Your members will still be visible to anyone at - pronouns.cc/@{data.user.name}/[member-name]. - -

-
-
-

- You can optionally set your timezone, which will show your current local time on your - profile. -

- - - - - -

- {#if timezone} - This will show up on your profile like this: - - {currentTime} (UTC{displayTimezone}) -
- {/if} - - Your timezone is never shared directly, only the difference between UTC and your - current timezone is. - -

-
-
-
-
-

- Preferences -

- {#each preferenceIds as id} - removePreference(id)} - /> - {/each} -
-
-
diff --git a/frontend/src/routes/edit/profile-old/+page.ts b/frontend/src/routes/edit/profile-old/+page.ts deleted file mode 100644 index 894eb83..0000000 --- a/frontend/src/routes/edit/profile-old/+page.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { PrideFlag, APIError, MeUser, PronounsJson } from "$lib/api/entities"; -import { apiFetchClient } from "$lib/api/fetch"; -import { error } from "@sveltejs/kit"; - -import pronounsRaw from "$lib/pronouns.json"; -const pronouns = pronounsRaw as PronounsJson; - -export const ssr = false; - -export const load = async () => { - try { - const user = await apiFetchClient(`/users/@me`); - const flags = await apiFetchClient("/users/@me/flags"); - - return { - user, - pronouns: pronouns.autocomplete, - flags, - }; - } catch (e) { - throw error((e as APIError).code, (e as APIError).message); - } -}; diff --git a/frontend/src/routes/edit/profile/+page.svelte b/frontend/src/routes/edit/profile/+page.svelte index 441d0ad..e727633 100644 --- a/frontend/src/routes/edit/profile/+page.svelte +++ b/frontend/src/routes/edit/profile/+page.svelte @@ -6,7 +6,7 @@ import { FormGroup, Icon, Input } from "sveltestrap"; import { userAvatars, type MeUser } from "$lib/api/entities"; import FallbackImage from "$lib/components/FallbackImage.svelte"; - import EditableName from "../EditableName.svelte"; + import EditableName from "$lib/components/edit/EditableName.svelte"; import { addToast } from "$lib/toast"; import IconButton from "$lib/components/IconButton.svelte"; diff --git a/frontend/src/routes/edit/profile/bio/+page.svelte b/frontend/src/routes/edit/profile/bio/+page.svelte index 19c9c6f..2cbbf38 100644 --- a/frontend/src/routes/edit/profile/bio/+page.svelte +++ b/frontend/src/routes/edit/profile/bio/+page.svelte @@ -3,7 +3,7 @@ import type { Writable } from "svelte/store"; import { MAX_DESCRIPTION_LENGTH, type MeUser } from "$lib/api/entities"; import { charCount, renderMarkdown } from "$lib/utils"; - import MarkdownHelp from "../../MarkdownHelp.svelte"; + import MarkdownHelp from "$lib/components/edit/MarkdownHelp.svelte"; import { Card, CardBody, CardHeader } from "sveltestrap"; const user = getContext>("user"); diff --git a/frontend/src/routes/edit/profile/fields/+page.svelte b/frontend/src/routes/edit/profile/fields/+page.svelte index 8f5e2de..c08f339 100644 --- a/frontend/src/routes/edit/profile/fields/+page.svelte +++ b/frontend/src/routes/edit/profile/fields/+page.svelte @@ -4,7 +4,7 @@ import { Alert, Button, Icon } from "sveltestrap"; import type { MeUser } from "$lib/api/entities"; - import EditableField from "../../EditableField.svelte"; + import EditableField from "$lib/components/edit/EditableField.svelte"; const user = getContext>("user"); diff --git a/frontend/src/routes/edit/profile/flags/+page.svelte b/frontend/src/routes/edit/profile/flags/+page.svelte index d62122a..f71a6dc 100644 --- a/frontend/src/routes/edit/profile/flags/+page.svelte +++ b/frontend/src/routes/edit/profile/flags/+page.svelte @@ -6,7 +6,7 @@ import type { MeUser, PrideFlag } from "$lib/api/entities"; import IconButton from "$lib/components/IconButton.svelte"; - import FlagButton from "../../FlagButton.svelte"; + import FlagButton from "$lib/components/edit/FlagButton.svelte"; export let data: PageData; diff --git a/frontend/src/routes/edit/profile/links/+page.svelte b/frontend/src/routes/edit/profile/links/+page.svelte new file mode 100644 index 0000000..9f2a658 --- /dev/null +++ b/frontend/src/routes/edit/profile/links/+page.svelte @@ -0,0 +1,63 @@ + + +{#each $user.links as _, index} +
+ moveLink(index, true)} + /> + moveLink(index, false)} + /> + + removeLink(index)} + /> +
+{/each} +
+ + + diff --git a/frontend/src/routes/edit/profile/other/+page.svelte b/frontend/src/routes/edit/profile/other/+page.svelte new file mode 100644 index 0000000..b653010 --- /dev/null +++ b/frontend/src/routes/edit/profile/other/+page.svelte @@ -0,0 +1,180 @@ + + +{#if error} + +{/if} + +
+
+ + +

+ + This is the text used for the "Members" heading. If you leave it blank, the default text will + be used. +

+
+ {#if PUBLIC_SHORT_BASE} +
+

+ Current short ID: {$user.sid} + + + + +
+ + + This ID is used in prns.cc links. You can reroll one short ID every hour (shared + between your main profile and all members) by pressing the button above. + +

+ {/if} +
+
+
+ + +
+

+ + This only hides your member list. + + Your members will still be visible to anyone at + pronouns.cc/@{$user.name}/[member-name]. + +

+
+
+

+ You can optionally set your timezone, which will show your current local time on your + profile. +

+ + + + + +

+ {#if $user.timezone} + This will show up on your profile like this: + + {currentTime} (UTC{displayTimezone}) +
+ {/if} + + Your timezone is never shared directly, only the difference between UTC and your current + timezone is. + +

+
+
+
+
+

+ Preferences +

+ {#each preferenceIds as id} + removePreference(id)} + /> + {/each} +
diff --git a/frontend/src/routes/edit/profile-old/CustomPreference.svelte b/frontend/src/routes/edit/profile/other/CustomPreference.svelte similarity index 100% rename from frontend/src/routes/edit/profile-old/CustomPreference.svelte rename to frontend/src/routes/edit/profile/other/CustomPreference.svelte diff --git a/frontend/src/routes/edit/profile-old/IconPicker.svelte b/frontend/src/routes/edit/profile/other/IconPicker.svelte similarity index 97% rename from frontend/src/routes/edit/profile-old/IconPicker.svelte rename to frontend/src/routes/edit/profile/other/IconPicker.svelte index eef2ddc..949f277 100644 --- a/frontend/src/routes/edit/profile-old/IconPicker.svelte +++ b/frontend/src/routes/edit/profile/other/IconPicker.svelte @@ -8,7 +8,7 @@ Input, Tooltip, } from "sveltestrap"; - import icons from "../../../icons"; + import icons from "../../../../icons"; import IconButton from "$lib/components/IconButton.svelte"; export let icon = ""; diff --git a/frontend/src/routes/edit/profile/pronouns/+page.svelte b/frontend/src/routes/edit/profile/pronouns/+page.svelte index c3a33a3..3cf81ec 100644 --- a/frontend/src/routes/edit/profile/pronouns/+page.svelte +++ b/frontend/src/routes/edit/profile/pronouns/+page.svelte @@ -3,7 +3,7 @@ import type { Writable } from "svelte/store"; import type { MeUser } from "$lib/api/entities"; import { Button, Icon, Popover } from "sveltestrap"; - import EditablePronouns from "../../EditablePronouns.svelte"; + import EditablePronouns from "$lib/components/edit/EditablePronouns.svelte"; import IconButton from "$lib/components/IconButton.svelte"; import type { PageData } from "./$types";