mirror of
https://github.com/R0m1k3/PleinR.git
synced 2026-10-19 05:08:20 +02:00
Backend: commune en menu deroulant (communes du Bassin de Pompey)
- Constante BASSIN_POMPEY_COMMUNES (13 communes) dans src/lib/communes.ts - Champ commune devenu un select dans : ajout adherent, edition fiche, espace adherent. communeOptions() conserve une valeur existante hors liste. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
7bdb234475
commit
b5a606e945
4 files changed
+51
-3
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { BASSIN_POMPEY_COMMUNES } from "@/lib/communes";
|
||||
import { addMember } from "../actions";
|
||||
|
||||
export function AddMemberPanel({
|
||||
@@ -56,7 +57,14 @@ export function AddMemberPanel({
|
||||
</div>
|
||||
<div>
|
||||
<label className="field-label">Commune</label>
|
||||
<input name="city" placeholder="ex : Pompey" className="field" />
|
||||
<select name="city" className="field" defaultValue="">
|
||||
<option value="">—</option>
|
||||
{BASSIN_POMPEY_COMMUNES.map((c) => (
|
||||
<option key={c} value={c}>
|
||||
{c}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label className="field-label">Statut</label>
|
||||
|
||||
@@ -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 { communeOptions } from "@/lib/communes";
|
||||
import { deleteMember, resetMemberPassword, updateMember } from "../../actions";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
@@ -93,7 +94,14 @@ export default async function EditMemberPage({
|
||||
</div>
|
||||
<div>
|
||||
<label className="field-label">Commune</label>
|
||||
<input name="city" defaultValue={member.city ?? ""} className="field" />
|
||||
<select name="city" className="field" defaultValue={member.city ?? ""}>
|
||||
<option value="">—</option>
|
||||
{communeOptions(member.city).map((c) => (
|
||||
<option key={c} value={c}>
|
||||
{c}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label className="field-label">Adresse</label>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { auth } from "@/auth";
|
||||
import { db } from "@/db";
|
||||
import { categories, members, promotions, type Member } from "@/db/schema";
|
||||
import { ImageField } from "@/components/ImageField";
|
||||
import { communeOptions } from "@/lib/communes";
|
||||
import { updateOwnProfile } from "../actions";
|
||||
import { MemberSpaceForm } from "./MemberSpaceForm";
|
||||
|
||||
@@ -96,7 +97,14 @@ export default async function EspacePage() {
|
||||
</div>
|
||||
<div>
|
||||
<label className="field-label">Commune</label>
|
||||
<input name="city" defaultValue={profile.city ?? ""} className="field" />
|
||||
<select name="city" className="field" defaultValue={profile.city ?? ""}>
|
||||
<option value="">—</option>
|
||||
{communeOptions(profile.city).map((c) => (
|
||||
<option key={c} value={c}>
|
||||
{c}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label className="field-label">Adresse</label>
|
||||
|
||||
Reference in new issue
Block a user