diff --git a/src/api/types.ts b/src/api/types.ts
index 14ac84c9..61bb4225 100644
--- a/src/api/types.ts
+++ b/src/api/types.ts
@@ -20,6 +20,17 @@ export interface System {
color?: string;
}
+export interface Config {
+ timezone: string;
+ pings_enabled: boolean;
+ member_default_private?: boolean;
+ group_default_private?: boolean;
+ show_private_info?: boolean;
+ member_limit: number;
+ group_limit: number;
+ description_templates: string[];
+}
+
interface MemberPrivacy {
visibility?: string,
description_privacy?: string,
diff --git a/src/lib/group/Edit.svelte b/src/lib/group/Edit.svelte
index e0255bc4..e25a1be3 100644
--- a/src/lib/group/Edit.svelte
+++ b/src/lib/group/Edit.svelte
@@ -5,6 +5,8 @@
import api from '../../api';
import autosize from 'svelte-autosize';
+ const descriptions: string[] = JSON.parse(localStorage.getItem("pk-config"))?.description_templates;
+
let loading: boolean = false;
export let group: Group;
export let editMode: boolean;
@@ -114,6 +116,16 @@
Description:
+ {#if descriptions.length > 0 && descriptions[0].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 1 && descriptions[1].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 2 && descriptions[2].trim() != ""}
+
+ {/if}
+
{#if !loading}
diff --git a/src/lib/group/NewGroup.svelte b/src/lib/group/NewGroup.svelte
index dfbd0771..7a9134e7 100644
--- a/src/lib/group/NewGroup.svelte
+++ b/src/lib/group/NewGroup.svelte
@@ -6,6 +6,8 @@
import { createEventDispatcher } from 'svelte';
import FaPlus from 'svelte-icons/fa/FaPlus.svelte';
+ const descriptions: string[] = JSON.parse(localStorage.getItem("pk-config"))?.description_templates;
+
let loading: boolean = false;
let err: string[] = [];
let message: string;
@@ -154,6 +156,16 @@
{/if}
Description:
+ {#if descriptions.length > 0 && descriptions[0].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 1 && descriptions[1].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 2 && descriptions[2].trim() != ""}
+
+ {/if}
+
{#if !loading && input.name}
diff --git a/src/lib/member/Edit.svelte b/src/lib/member/Edit.svelte
index ba65c67a..849db6b9 100644
--- a/src/lib/member/Edit.svelte
+++ b/src/lib/member/Edit.svelte
@@ -7,6 +7,8 @@
import { Member } from '../../api/types'
import api from '../../api';
+ const descriptions: string[] = JSON.parse(localStorage.getItem("pk-config"))?.description_templates;
+
let loading: boolean = false;
export let member: Member;
export let editMode: boolean;
@@ -137,6 +139,16 @@
Description:
+ {#if descriptions.length > 0 && descriptions[0].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 1 && descriptions[1].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 2 && descriptions[2].trim() != ""}
+
+ {/if}
+
{#if !loading}
diff --git a/src/lib/member/NewMember.svelte b/src/lib/member/NewMember.svelte
index 30500617..ec351bb4 100644
--- a/src/lib/member/NewMember.svelte
+++ b/src/lib/member/NewMember.svelte
@@ -7,6 +7,8 @@
import { Member } from '../../api/types';
import api from '../../api';
+ const descriptions: string[] = JSON.parse(localStorage.getItem("pk-config"))?.description_templates;
+
let err: string[] = [];
let message: string;
let loading: boolean = false;
@@ -219,6 +221,16 @@
Description:
+ {#if descriptions.length > 0 && descriptions[0].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 1 && descriptions[1].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 2 && descriptions[2].trim() != ""}
+
+ {/if}
+
{#if !loading && input.name}
diff --git a/src/lib/system/Edit.svelte b/src/lib/system/Edit.svelte
index be055794..406d1057 100644
--- a/src/lib/system/Edit.svelte
+++ b/src/lib/system/Edit.svelte
@@ -4,6 +4,8 @@
// import moment from 'moment-timezone';
import { currentUser } from '../../stores';
+ const descriptions: string[] = JSON.parse(localStorage.getItem("pk-config"))?.description_templates;
+
import { System } from '../../api/types';
import api from '../../api';
@@ -82,6 +84,16 @@
Description:
+ {#if descriptions.length > 0 && descriptions[0].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 1 && descriptions[1].trim() != ""}
+
+ {/if}
+ {#if descriptions.length > 2 && descriptions[2].trim() != ""}
+
+ {/if}
+
\ No newline at end of file
diff --git a/src/pages/DiscordLogin.svelte b/src/pages/DiscordLogin.svelte
index 4754b5eb..16d348ae 100644
--- a/src/pages/DiscordLogin.svelte
+++ b/src/pages/DiscordLogin.svelte
@@ -15,6 +15,7 @@
const res = await api().private.discord.callback.post({ data: { code: params.get("code"), redirect_domain: window.location.origin } });
localStorage.setItem("pk-token", res.token);
localStorage.setItem("pk-user", JSON.stringify(res.system));
+ localStorage.setItem("pk-config", JSON.stringify(res.config));
window.location.href = window.location.origin;
}
else
diff --git a/src/pages/Home.svelte b/src/pages/Home.svelte
index 613216d8..436f7e23 100644
--- a/src/pages/Home.svelte
+++ b/src/pages/Home.svelte
@@ -40,6 +40,8 @@
const res: System = await api().systems("@me").get({ token });
localStorage.setItem("pk-token", token);
localStorage.setItem("pk-user", JSON.stringify(res));
+ const settings = await api().systems("@me").settings.get({ token });
+ localStorage.setItem("pk-config", JSON.stringify(settings));
err = null;
loggedIn.update(() => true);
currentUser.update(() => res);
diff --git a/src/pages/Settings.svelte b/src/pages/Settings.svelte
index 5823df31..29f45fb8 100644
--- a/src/pages/Settings.svelte
+++ b/src/pages/Settings.svelte
@@ -1,9 +1,13 @@