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

@@ -89,17 +89,58 @@
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.driver.Data.file_number}}</dd>
</div>
{{end}}
{{if and .ViewState.driver.Data.other_properties .ViewState.driver.Data.other_properties.last_subscription_date}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Dernière adhésion</dt>
<dd class="mt-1 text-sm text-gray-900">{{ .ViewState.driver.Data.other_properties.last_subscription_date}}</dd>
</div>
{{range .ViewState.profile_optional_fields}}
{{$fieldName := .name}}
{{$fieldLabel := .label}}
{{$fieldType := .type}}
{{if eq .type "multicheckbox"}}
{{$hasValues := false}}
{{range .options}}
{{$optionKey := printf "%s___%s" $fieldName .value}}
{{if index $.ViewState.driver.Data.other_properties $optionKey}}{{$hasValues = true}}{{end}}
{{end}}
{{if $hasValues}}
<div class="sm:col-span-2">
<dt class="text-sm font-medium text-gray-500">{{$fieldLabel}}</dt>
<dd class="mt-1 text-sm text-gray-900">
<div class="flex flex-wrap gap-2">
{{range .options}}
{{$optionKey := printf "%s___%s" $fieldName .value}}
{{if index $.ViewState.driver.Data.other_properties $optionKey}}
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-200 text-gray-800">
{{.label}}
</span>
{{end}}
{{end}}
</div>
</dd>
</div>
{{end}}
{{else if eq .type "select"}}
{{$fieldValue := index $.ViewState.driver.Data.other_properties $fieldName}}
{{if and $fieldValue (ne $fieldValue "0") (ne $fieldValue "")}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">{{$fieldLabel}}</dt>
<dd class="mt-1 text-sm text-gray-900">
{{if eq $fieldName "gender"}}
{{genderISO5218 $fieldValue}}
{{else}}
{{range .options}}
{{if eq .value $fieldValue}}{{.label}}{{end}}
{{end}}
{{end}}
</dd>
</div>
{{end}}
{{else}}
{{$fieldValue := index $.ViewState.driver.Data.other_properties $fieldName}}
{{if $fieldValue}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">{{$fieldLabel}}</dt>
<dd class="mt-1 text-sm text-gray-900">{{$fieldValue}}</dd>
</div>
{{end}}
{{end}}
{{if and .ViewState.driver.Data.other_properties .ViewState.driver.Data.other_properties.comment}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Commentaire</dt>
<dd class="mt-1 text-sm text-gray-900">{{ .ViewState.driver.Data.other_properties.comment}}</dd>
</div>
{{end}}
</dl>
</div>