diff --git a/Foxnouns.Backend/Controllers/MembersController.cs b/Foxnouns.Backend/Controllers/MembersController.cs index 42b8ee5..968b571 100644 --- a/Foxnouns.Backend/Controllers/MembersController.cs +++ b/Foxnouns.Backend/Controllers/MembersController.cs @@ -164,9 +164,6 @@ public class MembersController( member.Links = req.Links ?? []; } - if (req.HasProperty(nameof(req.Unlisted))) - member.Unlisted = req.Unlisted ?? false; - if (req.Names != null) { errors.AddRange( @@ -247,7 +244,6 @@ public class MembersController( public Pronoun[]? Pronouns { get; init; } public Field[]? Fields { get; init; } public Snowflake[]? Flags { get; init; } - public bool? Unlisted { get; init; } } [HttpDelete("/api/v2/users/@me/members/{memberRef}")] diff --git a/Foxnouns.Backend/Utils/ValidationUtils.cs b/Foxnouns.Backend/Utils/ValidationUtils.cs index 3374e3e..bb225ff 100644 --- a/Foxnouns.Backend/Utils/ValidationUtils.cs +++ b/Foxnouns.Backend/Utils/ValidationUtils.cs @@ -414,7 +414,7 @@ public static partial class ValidationUtils case > Limits.FieldEntryTextLimit: errors.Add( ( - $"{errorPrefix}.{entryIdx}.display_text", + $"{errorPrefix}.{entryIdx}.value", ValidationError.LengthError( "Pronoun display text is too long", 1, @@ -427,7 +427,7 @@ public static partial class ValidationUtils case < 1: errors.Add( ( - $"{errorPrefix}.{entryIdx}.display_text", + $"{errorPrefix}.{entryIdx}.value", ValidationError.LengthError( "Pronoun display text is too short", 1, diff --git a/Foxnouns.Frontend/package.json b/Foxnouns.Frontend/package.json index 3fc70d1..142b442 100644 --- a/Foxnouns.Frontend/package.json +++ b/Foxnouns.Frontend/package.json @@ -44,8 +44,6 @@ "markdown-it": "^14.1.0", "pretty-bytes": "^6.1.1", "sanitize-html": "^2.13.1", - "svelte-tippy": "^1.3.2", - "tippy.js": "^6.3.7", "tslog": "^4.9.3" } } diff --git a/Foxnouns.Frontend/pnpm-lock.yaml b/Foxnouns.Frontend/pnpm-lock.yaml index 9b78513..d35d2ed 100644 --- a/Foxnouns.Frontend/pnpm-lock.yaml +++ b/Foxnouns.Frontend/pnpm-lock.yaml @@ -29,12 +29,6 @@ importers: sanitize-html: specifier: ^2.13.1 version: 2.13.1 - svelte-tippy: - specifier: ^1.3.2 - version: 1.3.2 - tippy.js: - specifier: ^6.3.7 - version: 6.3.7 tslog: specifier: ^4.9.3 version: 4.9.3 @@ -1331,9 +1325,6 @@ packages: svelte: optional: true - svelte-tippy@1.3.2: - resolution: {integrity: sha512-41f+85hwhKBRqX0UNYrgFsi34Kk/KDvUkIZXYANxkWoA2NTVTCZbUC2J8hRNZ4TRVxObTshoZRjK2co5+i6LMw==} - svelte@5.2.2: resolution: {integrity: sha512-eHIJRcvA6iuXdRGMESTmBtWTQCcCiol4gyH9DA60ybS35W1x27cvtbndNvWDqX72blyf+AYeQ4gzZ0XGg3L8sw==} engines: {node: '>=18'} @@ -1346,9 +1337,6 @@ packages: tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} - tippy.js@6.3.7: - resolution: {integrity: sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -2577,10 +2565,6 @@ snapshots: optionalDependencies: svelte: 5.2.2 - svelte-tippy@1.3.2: - dependencies: - tippy.js: 6.3.7 - svelte@5.2.2: dependencies: '@ampproject/remapping': 2.3.0 @@ -2608,10 +2592,6 @@ snapshots: globalyzer: 0.1.0 globrex: 0.1.2 - tippy.js@6.3.7: - dependencies: - '@popperjs/core': 2.11.8 - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 diff --git a/Foxnouns.Frontend/src/app.scss b/Foxnouns.Frontend/src/app.scss index f250ce6..4a9d5dd 100644 --- a/Foxnouns.Frontend/src/app.scss +++ b/Foxnouns.Frontend/src/app.scss @@ -29,15 +29,6 @@ white-space: pre-line; } -// Make tippy tooltips look like bootstrap's -.tippy-box { - padding: bootstrap.$spacer * 0.25 bootstrap.$spacer * 0.5; - opacity: 0.9; - color: var(--bs-body-bg); - background-color: var(--bs-emphasis-color); - border-radius: var(--bs-border-radius); -} - // Add breakpoint-dependent w-{size} utilities // Source: https://stackoverflow.com/questions/47760132/any-way-to-get-breakpoint-specific-width-classes @each $breakpoint in map-keys(bootstrap.$grid-breakpoints) { diff --git a/Foxnouns.Frontend/src/lib/components/Error.svelte b/Foxnouns.Frontend/src/lib/components/Error.svelte index 64f3bc7..09337a9 100644 --- a/Foxnouns.Frontend/src/lib/components/Error.svelte +++ b/Foxnouns.Frontend/src/lib/components/Error.svelte @@ -1,6 +1,6 @@ - - diff --git a/Foxnouns.Frontend/src/lib/components/StatusIcon.svelte b/Foxnouns.Frontend/src/lib/components/StatusIcon.svelte index 1dbd5a3..d029158 100644 --- a/Foxnouns.Frontend/src/lib/components/StatusIcon.svelte +++ b/Foxnouns.Frontend/src/lib/components/StatusIcon.svelte @@ -1,14 +1,17 @@ - + {preference.tooltip}: +{preference.tooltip} diff --git a/Foxnouns.Frontend/src/lib/components/editor/FieldEditor.svelte b/Foxnouns.Frontend/src/lib/components/editor/FieldEditor.svelte deleted file mode 100644 index 3fa87b5..0000000 --- a/Foxnouns.Frontend/src/lib/components/editor/FieldEditor.svelte +++ /dev/null @@ -1,56 +0,0 @@ - - -

{name}

- -{#each entries as _, index} - -{/each} - -
- - - diff --git a/Foxnouns.Frontend/src/lib/components/editor/FieldEntryEditor.svelte b/Foxnouns.Frontend/src/lib/components/editor/FieldEntryEditor.svelte deleted file mode 100644 index 63e56cc..0000000 --- a/Foxnouns.Frontend/src/lib/components/editor/FieldEntryEditor.svelte +++ /dev/null @@ -1,65 +0,0 @@ - - -
- moveValue(index, true)} - /> - moveValue(index, true)} - /> - - - - - - - - - {#each prefIds as id} - (value.status = id)} active={value.status === id}> - - {allPreferences[id].tooltip} - - {/each} - - - removeValue(index)} - /> -
diff --git a/Foxnouns.Frontend/src/lib/components/editor/PronounEntryEditor.svelte b/Foxnouns.Frontend/src/lib/components/editor/PronounEntryEditor.svelte deleted file mode 100644 index aee6859..0000000 --- a/Foxnouns.Frontend/src/lib/components/editor/PronounEntryEditor.svelte +++ /dev/null @@ -1,100 +0,0 @@ - - -
-
- moveValue(index, true)} - /> - moveValue(index, true)} - /> - - - - - - - - - {#each prefIds as id} - (value.status = id)} active={value.status === id}> - - {allPreferences[id].tooltip} - - {/each} - - - (displayOpen = !displayOpen)} - /> - removeValue(index)} - /> -
- - -
- {$t("editor.display-text-label")} - - - - - {$t("editor.display-text-info")} - -
-
-
diff --git a/Foxnouns.Frontend/src/lib/components/editor/PronounsEditor.svelte b/Foxnouns.Frontend/src/lib/components/editor/PronounsEditor.svelte deleted file mode 100644 index 9219c02..0000000 --- a/Foxnouns.Frontend/src/lib/components/editor/PronounsEditor.svelte +++ /dev/null @@ -1,65 +0,0 @@ - - -

{$t("profile.pronouns-header")}

- -{#each entries as _, index} - -{/each} - -
- - - diff --git a/Foxnouns.Frontend/src/lib/components/profile/ProfileFlag.svelte b/Foxnouns.Frontend/src/lib/components/profile/ProfileFlag.svelte index bf171cd..5c042cc 100644 --- a/Foxnouns.Frontend/src/lib/components/profile/ProfileFlag.svelte +++ b/Foxnouns.Frontend/src/lib/components/profile/ProfileFlag.svelte @@ -1,18 +1,17 @@ - {flag.description + {flag.description ?? flag.name} + {flag.description {flag.name} diff --git a/Foxnouns.Frontend/src/lib/defaultPronouns/en.ts b/Foxnouns.Frontend/src/lib/defaultPronouns/en.ts deleted file mode 100644 index 412689a..0000000 --- a/Foxnouns.Frontend/src/lib/defaultPronouns/en.ts +++ /dev/null @@ -1,16 +0,0 @@ -const enPronouns = { - "they/them": { pronouns: ["they", "them", "their", "theirs", "themself"] }, - "they/them (singular)": { - pronouns: ["they", "them", "their", "theirs", "themself"], - display: "they/them (singular)", - }, - "they/them (plural)": { - pronouns: ["they", "them", "their", "theirs", "themselves"], - display: "they/them (plural)", - }, - "he/him": { pronouns: ["he", "him", "his", "his", "himself"] }, - "she/her": { pronouns: ["she", "her", "her", "hers", "herself"] }, - "it/its": { pronouns: ["it", "it", "its", "its", "itself"], display: "it/its" }, -} as Record; - -export default enPronouns; diff --git a/Foxnouns.Frontend/src/lib/defaultPronouns/index.ts b/Foxnouns.Frontend/src/lib/defaultPronouns/index.ts deleted file mode 100644 index e60d38b..0000000 --- a/Foxnouns.Frontend/src/lib/defaultPronouns/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import enPronouns from "./en"; - -const defaultPronouns = { - en: enPronouns, -} as Record>; - -export default defaultPronouns; diff --git a/Foxnouns.Frontend/src/lib/errorCodes.ts b/Foxnouns.Frontend/src/lib/errorCodes.svelte.ts similarity index 100% rename from Foxnouns.Frontend/src/lib/errorCodes.ts rename to Foxnouns.Frontend/src/lib/errorCodes.svelte.ts diff --git a/Foxnouns.Frontend/src/lib/i18n/locales/en.json b/Foxnouns.Frontend/src/lib/i18n/locales/en.json index f743706..7f1e377 100644 --- a/Foxnouns.Frontend/src/lib/i18n/locales/en.json +++ b/Foxnouns.Frontend/src/lib/i18n/locales/en.json @@ -1,150 +1,136 @@ { - "hello": "Hello, {{name}}!", - "nav": { - "log-in": "Log in or sign up", - "settings": "Settings" - }, - "avatar-tooltip": "Avatar for {{name}}", - "profile": { - "edit-member-profile-notice": "You are currently viewing the public profile of {{memberName}}.", - "edit-user-profile-notice": "You are currently viewing your public profile.", - "edit-profile-link": "Edit profile", - "names-header": "Names", - "pronouns-header": "Pronouns", - "default-members-header": "Members", - "create-member-button": "Create member", - "back-to-user": "Back to {{name}}" - }, - "title": { - "log-in": "Log in", - "welcome": "Welcome", - "settings": "Settings" - }, - "auth": { - "log-in-form-title": "Log in with email", - "log-in-form-email-label": "Email address", - "log-in-form-password-label": "Password", - "register-with-email-button": "Register with email", - "log-in-button": "Log in", - "log-in-3rd-party-header": "Log in with another service", - "log-in-3rd-party-desc": "If you prefer, you can also log in with one of these services:", - "log-in-with-discord": "Log in with Discord", - "log-in-with-google": "Log in with Google", - "log-in-with-tumblr": "Log in with Tumblr", - "log-in-with-the-fediverse": "Log in with the Fediverse", - "remote-fediverse-account-label": "Your Fediverse account", - "register-username-label": "Username", - "register-button": "Register account", - "register-with-mastodon": "Register with a Fediverse account", - "log-in-with-fediverse-error-blurb": "Is your instance returning an error?", - "log-in-with-fediverse-force-refresh-button": "Force a refresh on our end" - }, - "error": { - "bad-request-header": "Something was wrong with your input", - "generic-header": "Something went wrong", - "raw-header": "Raw error", - "authentication-error": "Something went wrong when logging you in.", - "bad-request": "Your input was rejected by the server, please check for any mistakes and try again.", - "forbidden": "You are not allowed to perform that action.", - "internal-server-error": "Server experienced an internal error, please try again later.", - "authentication-required": "You need to log in first.", - "missing-scopes": "The current token is missing a required scope. Did you manually edit your cookies?", - "generic-error": "An unknown error occurred.", - "user-not-found": "User not found, please check your spelling and try again. Remember that usernames are case sensitive.", - "member-not-found": "Member not found, please check your spelling and try again.", - "account-already-linked": "This account is already linked with a pronouns.cc account.", - "last-auth-method": "You cannot remove your last authentication method.", - "validation-max-length-error": "Value is too long, maximum length is {{max}}, current length is {{actual}}.", - "validation-min-length-error": "Value is too short, minimum length is {{min}}, current length is {{actual}}.", - "validation-disallowed-value-1": "The following value is not allowed here", - "validation-disallowed-value-2": "Allowed values are", - "validation-reason": "Reason", - "validation-generic": "The value you entered is not allowed here. Reason", - "extra-info-header": "Extra error information", - "noscript-title": "This page requires JavaScript", - "noscript-info": "This page requires JavaScript to function correctly. Some buttons may not work, or the page may not work at all.", - "noscript-short": "Requires JavaScript" - }, - "settings": { - "general-information-tab": "General information", - "your-profile-tab": "Your profile", - "members-tab": "Members", - "authentication-tab": "Authentication", - "export-tab": "Export your data", - "change-username-button": "Change username", - "username-change-hint": "Changing your username will make any existing links to your or your members' profiles invalid.\nYour username must be unique, be at most 40 characters long, and only contain letters from the basic English alphabet, dashes, underscores, and periods. Your username is used as part of your profile link, you can set a separate display name.", - "username-update-error": "Could not update your username as the new username is invalid:\n{{message}}", - "change-avatar-link": "Change your avatar here", - "new-username": "New username", - "table-role": "Role", - "table-custom-preferences": "Custom preferences", - "table-member-list-hidden": "Member list hidden?", - "table-member-count": "Member count", - "table-created-at": "Account created at", - "table-id": "Your ID", - "table-title": "Account information", - "force-log-out-title": "Log out everywhere", - "force-log-out-button": "Force log out", - "force-log-out-hint": "If you think one of your tokens might have been compromised, you can log out on all devices by clicking this button.", - "log-out-title": "Log out", - "log-out-hint": "Use this button to log out on this device only.", - "log-out-button": "Log out", - "avatar": "Avatar", - "username-update-success": "Successfully changed your username!", - "create-member-title": "Create a new member", - "create-member-name-label": "Member name" - }, - "yes": "Yes", - "no": "No", - "edit-profile": { - "user-header": "Editing your profile", - "general-tab": "General", - "names-pronouns-tab": "Names & pronouns", - "file-too-large": "This file is too large, please resize it (maximum is {{max}}, the file you're trying to upload is {{current}})", - "sid-current": "Current short ID:", - "sid": "Short ID", - "sid-reroll": "Reroll short ID", - "sid-hint": "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.", - "sid-copy": "Copy short link", - "update-avatar": "Update avatar", - "avatar-updated": "Avatar updated! It might take a moment to be reflected on your profile.", - "member-header-label": "\"Members\" header text", - "member-header-info": "This is the text used for the \"Members\" heading. If you leave it blank, the default text will be used.", - "hide-member-list-label": "Hide member list", - "timezone-label": "Timezone", - "timezone-preview": "This will show up on your profile like this:", - "timezone-info": "This is optional. Your timezone is never shared directly, only the difference between UTC and your current timezone is.", - "hide-member-list-info": "This only hides your member list. Individual members will still be visible to anyone with a direct link to their pages.", - "profile-options-header": "Profile options", - "bio-tab": "Bio", - "saved-changes": "Successfully saved changes!", - "bio-length-hint": "Using {{length}}/{{maxLength}} characters", - "preview": "Preview", - "fields-tab": "Fields", - "flags-links-tab": "Flags & links", - "back-to-settings-tab": "Back to settings", - "member-header": "Editing profile of {{name}}", - "username": "Username", - "change-username-info": "As changing your username will also change all of your members' links, you can only change it in your account settings.", - "change-username-link": "Go to settings", - "member-name": "Name", - "change-member-name": "Change name", - "display-name": "Display name", - "unlisted-label": "Hide from member list", - "unlisted-note": "This only hides this member from your public member list. They will still be visible to anyone at this link:", - "edit-names-pronouns-header": "Edit names and pronouns", - "back-to-profile-tab": "Back to profile" - }, - "save-changes": "Save changes", - "change": "Change", - "editor": { - "remove-entry": "Remove entry", - "move-entry-down": "Move entry down", - "move-entry-up": "Move entry up", - "add-entry": "Add entry", - "change-display-text": "Change display text", - "display-text-example": "Optional display text (e.g. it/its)", - "display-text-label": "Display text", - "display-text-info": "This is the short text shown on your profile page. If you leave it empty, it will default to the first two forms of the full set." - } + "hello": "Hello, {{name}}!", + "nav": { + "log-in": "Log in or sign up", + "settings": "Settings" + }, + "avatar-tooltip": "Avatar for {{name}}", + "profile": { + "edit-member-profile-notice": "You are currently viewing the public profile of {{memberName}}.", + "edit-user-profile-notice": "You are currently viewing your public profile.", + "edit-profile-link": "Edit profile", + "names-header": "Names", + "pronouns-header": "Pronouns", + "default-members-header": "Members", + "create-member-button": "Create member", + "back-to-user": "Back to {{name}}" + }, + "title": { + "log-in": "Log in", + "welcome": "Welcome", + "settings": "Settings" + }, + "auth": { + "log-in-form-title": "Log in with email", + "log-in-form-email-label": "Email address", + "log-in-form-password-label": "Password", + "register-with-email-button": "Register with email", + "log-in-button": "Log in", + "log-in-3rd-party-header": "Log in with another service", + "log-in-3rd-party-desc": "If you prefer, you can also log in with one of these services:", + "log-in-with-discord": "Log in with Discord", + "log-in-with-google": "Log in with Google", + "log-in-with-tumblr": "Log in with Tumblr", + "log-in-with-the-fediverse": "Log in with the Fediverse", + "remote-fediverse-account-label": "Your Fediverse account", + "register-username-label": "Username", + "register-button": "Register account", + "register-with-mastodon": "Register with a Fediverse account", + "log-in-with-fediverse-error-blurb": "Is your instance returning an error?", + "log-in-with-fediverse-force-refresh-button": "Force a refresh on our end" + }, + "error": { + "bad-request-header": "Something was wrong with your input", + "generic-header": "Something went wrong", + "raw-header": "Raw error", + "authentication-error": "Something went wrong when logging you in.", + "bad-request": "Your input was rejected by the server, please check for any mistakes and try again.", + "forbidden": "You are not allowed to perform that action.", + "internal-server-error": "Server experienced an internal error, please try again later.", + "authentication-required": "You need to log in first.", + "missing-scopes": "The current token is missing a required scope. Did you manually edit your cookies?", + "generic-error": "An unknown error occurred.", + "user-not-found": "User not found, please check your spelling and try again. Remember that usernames are case sensitive.", + "member-not-found": "Member not found, please check your spelling and try again.", + "account-already-linked": "This account is already linked with a pronouns.cc account.", + "last-auth-method": "You cannot remove your last authentication method.", + "validation-max-length-error": "Value is too long, maximum length is {{max}}, current length is {{actual}}.", + "validation-min-length-error": "Value is too long, minimum length is {{min}}, current length is {{actual}}.", + "validation-disallowed-value-1": "The following value is not allowed here", + "validation-disallowed-value-2": "Allowed values are", + "validation-reason": "Reason", + "validation-generic": "The value you entered is not allowed here. Reason", + "extra-info-header": "Extra error information", + "noscript-title": "This page requires JavaScript", + "noscript-info": "This page requires JavaScript to function correctly. Some buttons may not work, or the page may not work at all.", + "noscript-short": "Requires JavaScript" + }, + "settings": { + "general-information-tab": "General information", + "your-profile-tab": "Your profile", + "members-tab": "Members", + "authentication-tab": "Authentication", + "export-tab": "Export your data", + "change-username-button": "Change username", + "username-change-hint": "Changing your username will make any existing links to your or your members' profiles invalid.\nYour username must be unique, be at most 40 characters long, and only contain letters from the basic English alphabet, dashes, underscores, and periods. Your username is used as part of your profile link, you can set a separate display name.", + "username-update-error": "Could not update your username as the new username is invalid:\n{{message}}", + "change-avatar-link": "Change your avatar here", + "new-username": "New username", + "table-role": "Role", + "table-custom-preferences": "Custom preferences", + "table-member-list-hidden": "Member list hidden?", + "table-member-count": "Member count", + "table-created-at": "Account created at", + "table-id": "Your ID", + "table-title": "Account information", + "force-log-out-title": "Log out everywhere", + "force-log-out-button": "Force log out", + "force-log-out-hint": "If you think one of your tokens might have been compromised, you can log out on all devices by clicking this button.", + "log-out-title": "Log out", + "log-out-hint": "Use this button to log out on this device only.", + "log-out-button": "Log out", + "avatar": "Avatar", + "username-update-success": "Successfully changed your username!", + "create-member-title": "Create a new member", + "create-member-name-label": "Member name" + }, + "yes": "Yes", + "no": "No", + "edit-profile": { + "user-header": "Editing your profile", + "general-tab": "General", + "names-pronouns-tab": "Names & pronouns", + "file-too-large": "This file is too large, please resize it (maximum is {{max}}, the file you're trying to upload is {{current}})", + "sid-current": "Current short ID:", + "sid": "Short ID", + "sid-reroll": "Reroll short ID", + "sid-hint": "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.", + "sid-copy": "Copy short link", + "update-avatar": "Update avatar", + "avatar-updated": "Avatar updated! It might take a moment to be reflected on your profile.", + "member-header-label": "\"Members\" header text", + "member-header-info": "This is the text used for the \"Members\" heading. If you leave it blank, the default text will be used.", + "hide-member-list-label": "Hide member list", + "timezone-label": "Timezone", + "timezone-preview": "This will show up on your profile like this:", + "timezone-info": "This is optional. Your timezone is never shared directly, only the difference between UTC and your current timezone is.", + "hide-member-list-info": "This only hides your member list. Individual members will still be visible to anyone with a direct link to their pages.", + "profile-options-header": "Profile options", + "bio-tab": "Bio", + "saved-changes": "Successfully saved changes!", + "bio-length-hint": "Using {{length}}/{{maxLength}} characters", + "preview": "Preview", + "fields-tab": "Fields", + "flags-links-tab": "Flags & links", + "back-to-settings-tab": "Back to settings", + "member-header": "Editing member {{name}}", + "username": "Username", + "change-username-info": "As changing your username will also change all of your members' links, you can only change it in your account settings.", + "change-username-link": "Go to settings", + "member-name": "Name", + "change-member-name": "Change name", + "display-name": "Display name" + }, + "save-changes": "Save changes", + "change": "Change" } diff --git a/Foxnouns.Frontend/src/lib/tippy.ts b/Foxnouns.Frontend/src/lib/tippy.ts deleted file mode 100644 index 39e2ca0..0000000 --- a/Foxnouns.Frontend/src/lib/tippy.ts +++ /dev/null @@ -1,11 +0,0 @@ -import "tippy.js/animations/scale-subtle.css"; -import { createTippy } from "svelte-tippy"; - -// use with use:tippy on elements -// temporary (probably) until sveltestrap works with svelte 5 -const tippy = createTippy({ - animation: "scale-subtle", - delay: [null, 0], -}); - -export default tippy; diff --git a/Foxnouns.Frontend/src/routes/@[username]/+page.svelte b/Foxnouns.Frontend/src/routes/@[username]/+page.svelte index 903312d..792df3f 100644 --- a/Foxnouns.Frontend/src/routes/@[username]/+page.svelte +++ b/Foxnouns.Frontend/src/routes/@[username]/+page.svelte @@ -25,7 +25,7 @@ {/if} - + {#if data.members.length > 0} @@ -33,7 +33,7 @@

{data.user.member_title || $t("profile.default-members-header")} {#if isMeUser} - + {$t("profile.create-member-button")} diff --git a/Foxnouns.Frontend/src/routes/settings/members/[id]/+layout@.svelte b/Foxnouns.Frontend/src/routes/settings/members/[id]/+layout@.svelte index 7de4046..a2539ab 100644 --- a/Foxnouns.Frontend/src/routes/settings/members/[id]/+layout@.svelte +++ b/Foxnouns.Frontend/src/routes/settings/members/[id]/+layout@.svelte @@ -8,20 +8,14 @@ let { data, children }: Props = $props(); const isActive = (path: string) => $page.url.pathname === path; - - let name = $derived( - data.member.display_name === data.member.name - ? data.member.name - : `${data.member.display_name} (${data.member.name})`, - ); - {$t("edit-profile.member-header", { name })} • pronouns.cc + {$t("edit-profile.member-header", { name: data.member.name })} • pronouns.cc
-

{$t("edit-profile.member-header", { name })}

+

{$t("edit-profile.member-header", { name: data.member.name })}

@@ -57,7 +51,7 @@ href="/@{data.user.username}/{data.member.name}" class="list-group-item list-group-item-action text-danger" > - {$t("edit-profile.back-to-profile-tab")} + Back to member {$t("edit-profile.back-to-settings-tab")} diff --git a/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.server.ts b/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.server.ts index 3ff5ac3..7665014 100644 --- a/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.server.ts +++ b/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.server.ts @@ -64,8 +64,7 @@ export const actions = { }, bio: async ({ params, request, fetch, cookies }) => { const body = await request.formData(); - let bio = body.get("bio") as string | null; - if (!bio || bio === "") bio = null; + const bio = body.get("bio") as string | null; try { await fastRequest("PATCH", `/users/@me/members/${params.id}`, { @@ -80,21 +79,4 @@ export const actions = { throw e; } }, - options: async ({ params, request, fetch, cookies }) => { - const body = await request.formData(); - let unlisted = !!body.get("unlisted"); - - try { - await fastRequest("PATCH", `/users/@me/members/${params.id}`, { - body: { unlisted }, - fetch, - cookies, - }); - return { error: null, ok: true }; - } catch (e) { - if (e instanceof ApiError) return { error: e.obj, ok: false }; - log.error("Error patching member %s:", params.id, e); - throw e; - } - }, }; diff --git a/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.svelte b/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.svelte index 04637ee..174108e 100644 --- a/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.svelte +++ b/Foxnouns.Frontend/src/routes/settings/members/[id]/+page.svelte @@ -5,7 +5,7 @@ import { apiRequest, fastRequest } from "$api"; import ApiError from "$api/error"; import log from "$lib/log"; - import { Icon, InputGroup } from "@sveltestrap/sveltestrap"; + import { InputGroup } from "@sveltestrap/sveltestrap"; import { t } from "$lib/i18n"; import AvatarEditor from "$components/editor/AvatarEditor.svelte"; import ErrorAlert from "$components/ErrorAlert.svelte"; @@ -13,7 +13,6 @@ import FormStatusMarker from "$components/editor/FormStatusMarker.svelte"; import SidEditor from "$components/editor/SidEditor.svelte"; import BioEditor from "$components/editor/BioEditor.svelte"; - import { PUBLIC_BASE_URL } from "$env/static/public"; type Props = { data: PageData; form: ActionData }; let { data, form }: Props = $props(); @@ -107,36 +106,7 @@

{$t("edit-profile.sid")}

-
-

{$t("edit-profile.profile-options-header")}

-
-
- - -
-

- - {$t("edit-profile.unlisted-note")} - - {PUBLIC_BASE_URL.substring("https://".length)}/@{data.member.user.username}/{data.member - .name} - -

-
- -
-
-
-
+

{$t("edit-profile.bio-tab")}

diff --git a/Foxnouns.Frontend/src/routes/settings/members/[id]/names-pronouns/+page.svelte b/Foxnouns.Frontend/src/routes/settings/members/[id]/names-pronouns/+page.svelte deleted file mode 100644 index e21bffc..0000000 --- a/Foxnouns.Frontend/src/routes/settings/members/[id]/names-pronouns/+page.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - - - -
- -
- -
- -
- -
- -
diff --git a/Foxnouns.Frontend/src/routes/settings/profile/+layout@.svelte b/Foxnouns.Frontend/src/routes/settings/profile/+layout@.svelte index 6f3d337..12c16d4 100644 --- a/Foxnouns.Frontend/src/routes/settings/profile/+layout@.svelte +++ b/Foxnouns.Frontend/src/routes/settings/profile/+layout@.svelte @@ -2,10 +2,9 @@ import type { Snippet } from "svelte"; import { page } from "$app/stores"; import { t } from "$lib/i18n"; - import type { LayoutData } from "./$types"; - type Props = { data: LayoutData; children: Snippet }; - let { data, children }: Props = $props(); + type Props = { children: Snippet }; + let { children }: Props = $props(); const isActive = (path: string) => $page.url.pathname === path; @@ -54,9 +53,6 @@ > {$t("edit-profile.flags-links-tab")}
- - {$t("edit-profile.back-to-profile-tab")} - {$t("edit-profile.back-to-settings-tab")} diff --git a/Foxnouns.Frontend/src/routes/settings/profile/names-pronouns/+page.svelte b/Foxnouns.Frontend/src/routes/settings/profile/names-pronouns/+page.svelte deleted file mode 100644 index 4954876..0000000 --- a/Foxnouns.Frontend/src/routes/settings/profile/names-pronouns/+page.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - - - -
- -
- -
- -
- -
- -