Refonte des horaires et contacts adhérents

This commit is contained in:
Michael committed 2026-07-23 16:22:28 +02:00
1 parent 5e7233f98d
commit dd9697019c
7 files changed
+960 -41

No files matched your search

+3 -2
View File
@@ -23,6 +23,7 @@ import {
users,
} from "@/db/schema";
import { can, LABEL_TO_ROLE } from "@/lib/rbac";
import { normalizeWebsite } from "@/lib/member-profile";
import { SITE_SETTING_DEFAULTS } from "@/lib/site-settings";
import type { AppRole } from "@/types/next-auth";
@@ -267,7 +268,7 @@ export async function updateMember(formData: FormData) {
description: String(formData.get("description") ?? "").trim() || null,
postalCode: String(formData.get("postalCode") ?? "").trim() || null,
phone: String(formData.get("phone") ?? "").trim() || null,
website: String(formData.get("website") ?? "").trim() || null,
website: normalizeWebsite(String(formData.get("website") ?? "")),
memberSince: formData.get("memberSince") ? Number(formData.get("memberSince")) : null,
coverUrl: String(formData.get("coverUrl") ?? "").trim() || null,
logoUrl: String(formData.get("logoUrl") ?? "").trim() || null,
@@ -797,7 +798,7 @@ export async function updateOwnProfile(formData: FormData) {
postalCode: String(formData.get("postalCode") ?? "").trim() || null,
city: String(formData.get("city") ?? "").trim() || null,
phone: String(formData.get("phone") ?? "").trim() || null,
website: String(formData.get("website") ?? "").trim() || null,
website: normalizeWebsite(String(formData.get("website") ?? "")),
hours: String(formData.get("hours") ?? "").trim() || null,
tags: String(formData.get("tags") ?? "").trim() || null,
coverUrl: String(formData.get("coverUrl") ?? "").trim() || null,
+2 -2
View File
@@ -6,6 +6,7 @@ import { db } from "@/db";
import { categories, members, users } from "@/db/schema";
import { can } from "@/lib/rbac";
import { ImageField } from "@/components/ImageField";
import { HoursEditor } from "@/components/HoursEditor";
import { communeOptions } from "@/lib/communes";
import { deleteMember, resetMemberPassword, updateMember } from "../../actions";
@@ -148,8 +149,7 @@ export default async function EditMemberPage({
</div>
<div style={{ marginTop: 16 }}>
<label className="field-label">Horaires (une ligne par jour : « Jour|plage », ex : Mardi – Vendredi|7h – 19h30)</label>
<textarea name="hours" rows={4} defaultValue={member.hours ?? ""} className="field" style={{ resize: "vertical" }} placeholder={"Mardi – Vendredi|7h – 19h30\nSamedi|7h – 19h\nDimanche|7h – 13h\nLundi|Fermé"} />
<HoursEditor defaultValue={member.hours} />
</div>
<div style={{ display: "flex", gap: 10, marginTop: 22 }}>
+2 -2
View File
@@ -5,6 +5,7 @@ import { db } from "@/db";
import { categories, imageConsents, meetingRegistrations, meetings, members, promotions, type Member } from "@/db/schema";
import { ImageField } from "@/components/ImageField";
import { ImageConsentForm } from "@/components/ImageConsentForm";
import { HoursEditor } from "@/components/HoursEditor";
import { communeOptions } from "@/lib/communes";
import { saveImageConsent, updateOwnProfile } from "../actions";
import { MemberSpaceForm } from "./MemberSpaceForm";
@@ -196,8 +197,7 @@ export default async function EspacePage() {
</div>
<div style={{ marginTop: 16 }}>
<label className="field-label">Horaires (une ligne par jour : « Jour|plage »)</label>
<textarea name="hours" rows={4} defaultValue={profile.hours ?? ""} className="field" style={{ resize: "vertical" }} placeholder={"Mardi – Vendredi|7h – 19h30\nSamedi|7h – 19h"} />
<HoursEditor defaultValue={profile.hours} />
</div>
<button