Configurable fields in solidarity driver profile + wallet details display + change SMS

This commit is contained in:
Arnaud Delcasse
2025-09-25 13:25:33 +02:00
parent 9280f36a62
commit 27ce05a91a
10 changed files with 353 additions and 69 deletions

View File

@@ -121,31 +121,46 @@
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
<div class="grid grid-cols-6 gap-6">
{{range .ViewState.profile_optional_fields}}
<div class="col-span-6 sm:col-span-3">
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
<label for="{{.name}}" class="block text-sm font-medium text-gray-700">{{.label}}</label>
{{if eq .type "select"}}
<div class="sm:mt-0 sm:col-span-2">
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
<select id="{{.name}}" name="{{.name}}"
{{if eq .name "gender"}}x-model="gender"{{else}}x-model="other_properties.{{.name}}"{{end}}
class="p-2 max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
<option value="0">Inconnu</option>
<option value="1">Masculin</option>
<option value="2">Féminin</option>
<option value="9">Sans objet</option>
{{range .options}}
<option value="{{.value}}">{{.label}}</option>
{{end}}
</select>
</div>
{{else if eq .type "textarea"}}
<textarea id="{{.name}}" name="{{.name}}" rows="3" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"></textarea>
{{else if eq .type "multicheckbox"}}
<div class="mt-1 space-y-2">
{{$name := .name}}
{{range .options}}
<label class="flex items-center">
<input type="checkbox" name="{{$name}}[]" value="{{.value}}"
x-model="other_properties.{{$name}}___{{.value}}"
class="h-4 w-4 text-co-blue focus:ring-co-blue border-co-blue rounded">
<span class="ml-2 text-sm text-gray-700">{{.label}}</span>
</label>
{{end}}
</div>
{{else if eq .type "date"}}
<input type="date" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else if eq .type "number"}}
<input type="number" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else}}
<input type="text" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{end}}
</div>
<div class="col-span-6 sm:col-span-3">
<label for="last_subscription_date" class="block text-sm font-medium text-gray-700">Date de dernière adhésion</label>
<input type="date" name="last_subscription_date" id="last_subscription_date" autocomplete="last_subscription_date" placeholder="JJ/MM/AAAA"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="other_properties.last_subscription_date">
</div>
<div class="col-span-6 sm:col-span-3">
<label for="comment" class="block text-sm font-medium text-gray-700">Commentaire</label>
<textarea name="comment" id="comment"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="other_properties.comment"></textarea>
</div>
{{end}}
<!-- <div class="col-span-3 sm:col-span-3">
<label class="block text-sm font-medium text-gray-700"> Photo </label>