mirror of
https://github.com/R0m1k3/PleinR.git
synced 2026-10-18 20:58:03 +02:00
Add association meetings and GDPR settings
This commit is contained in:
1 parent
b4c8967a3c
commit
28ada88155
20 files changed
+2663
-27
No files matched your search
+5
-1
@@ -20,6 +20,8 @@ type Capability =
|
||||
| "moderatePromos"
|
||||
| "manageAdmins"
|
||||
| "manageCategories"
|
||||
| "manageMeetings"
|
||||
| "manageSettings"
|
||||
| "memberSpace";
|
||||
|
||||
const CAPABILITIES: Record<AppRole, Capability[]> = {
|
||||
@@ -29,9 +31,11 @@ const CAPABILITIES: Record<AppRole, Capability[]> = {
|
||||
"moderatePromos",
|
||||
"manageAdmins",
|
||||
"manageCategories",
|
||||
"manageMeetings",
|
||||
"manageSettings",
|
||||
"memberSpace",
|
||||
],
|
||||
moderator: ["viewDashboard", "manageMembers", "moderatePromos"],
|
||||
moderator: ["viewDashboard", "manageMembers", "moderatePromos", "manageMeetings"],
|
||||
editor: ["viewDashboard", "manageMembers"],
|
||||
member: ["memberSpace"],
|
||||
};
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import { asc } from "drizzle-orm";
|
||||
import { db } from "@/db";
|
||||
import { siteSettings } from "@/db/schema";
|
||||
|
||||
export const SITE_SETTING_DEFAULTS = {
|
||||
association_name: "Plein R",
|
||||
association_tagline: "Association des commerçants et entreprises du Bassin de Pompey.",
|
||||
association_intro:
|
||||
"Plein R rassemble les acteurs économiques locaux autour du réseau, des rencontres et de la mise en valeur du territoire.",
|
||||
association_mission:
|
||||
"Créer du lien entre adhérents, encourager les échanges de proximité et porter une dynamique collective au service du Bassin de Pompey.",
|
||||
association_address: "",
|
||||
association_email: "",
|
||||
association_phone: "",
|
||||
association_website: "",
|
||||
association_siret: "",
|
||||
association_rna: "",
|
||||
association_contact: "",
|
||||
association_president: "",
|
||||
association_president_role: "Présidence",
|
||||
association_president_message: "",
|
||||
association_president_photo: "",
|
||||
association_vice_president: "",
|
||||
association_treasurer: "",
|
||||
association_secretary: "",
|
||||
association_board_members: "",
|
||||
association_host_name: "",
|
||||
association_host_address: "",
|
||||
association_host_phone: "",
|
||||
association_publication_director: "",
|
||||
association_privacy_contact: "",
|
||||
legal_updated: "",
|
||||
};
|
||||
|
||||
export type SiteSettings = typeof SITE_SETTING_DEFAULTS;
|
||||
export type SiteSettingKey = keyof SiteSettings;
|
||||
|
||||
export async function getSiteSettings(): Promise<SiteSettings> {
|
||||
const rows = await db.select().from(siteSettings).orderBy(asc(siteSettings.key));
|
||||
const merged = { ...SITE_SETTING_DEFAULTS };
|
||||
for (const row of rows) {
|
||||
if (row.key in merged) {
|
||||
merged[row.key as SiteSettingKey] = row.value ?? "";
|
||||
}
|
||||
}
|
||||
return merged;
|
||||
}
|
||||
|
||||
export function splitLines(value: string) {
|
||||
return value
|
||||
.split(/\r?\n/)
|
||||
.map((line) => line.trim())
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
export function parseBoardMembers(value: string) {
|
||||
return splitLines(value).map((line) => {
|
||||
const [name, role] = line.split("|").map((part) => part.trim());
|
||||
return { name, role: role || "Membre du directoire" };
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user