refactor(web): simplify address to single free-form value
Docker Image bauen und veröffentlichen / docker (push) Canceled after 26s

This commit is contained in:
2026-09-01 07:02:40 +02:00
parent c945e785c8
commit 1f383878ab
3 changed files with 112 additions and 201 deletions
+9 -22
View File
@@ -26,14 +26,11 @@ type LabeledValue struct {
Value string
}
// AddressValue is one ADR entry with its TYPE parameter.
// AddressValue is one ADR entry with its TYPE parameter; the full address
// is captured as a single free-form string.
type AddressValue struct {
Type string
Street string
City string
Region string
PostalCode string
Country string
Type string
Value string
}
// ContactFormData pre-fills the create/edit contact form. Phones, Emails,
@@ -198,21 +195,11 @@ templ emailRow(p LabeledValue) {
}
templ addressRow(a AddressValue) {
<div class="form-row grid grid-cols-2 gap-2 items-start bg-gray-50 rounded-md p-3">
<div class="col-span-2">
@typeSelect("address_type", a.Type)
</div>
<input name="address_street" type="text" value={ a.Street } placeholder="Street and number"
class="col-span-2 rounded-md border-gray-300 border px-2 py-1.5 text-sm"/>
<input name="address_city" type="text" value={ a.City } placeholder="City"
class="rounded-md border-gray-300 border px-2 py-1.5 text-sm"/>
<input name="address_postal_code" type="text" value={ a.PostalCode } placeholder="Postal code"
class="rounded-md border-gray-300 border px-2 py-1.5 text-sm"/>
<input name="address_region" type="text" value={ a.Region } placeholder="State / Region"
class="rounded-md border-gray-300 border px-2 py-1.5 text-sm"/>
<input name="address_country" type="text" value={ a.Country } placeholder="Country"
class="rounded-md border-gray-300 border px-2 py-1.5 text-sm"/>
<button type="button" class="remove-row-btn text-red-600 hover:underline text-xs col-span-2 text-left">Remove</button>
<div class="form-row flex gap-2 items-center">
@typeSelect("address_type", a.Type)
<input name="address_value" type="text" value={ a.Value } placeholder="Street, city, postal code, country"
class="flex-1 rounded-md border-gray-300 border px-2 py-1.5 text-sm"/>
<button type="button" class="remove-row-btn text-red-600 hover:underline text-xs shrink-0">Remove</button>
</div>
}