Make customer addresses editable.

This commit is contained in:
2025-01-10 16:24:01 +01:00
parent 39f4acc1fc
commit 2b3c93a8b6
13 changed files with 213 additions and 15 deletions

View File

@@ -7,6 +7,7 @@
<div class="py-12" x-data="customerForm()">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
<!-- Customer data -->
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<div class="max-w-xl">
@@ -49,7 +50,6 @@
</div>
</div>
<!-- Existing addresses -->
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg" x-bind="addresses">
<div class="max-w">
@@ -58,19 +58,22 @@
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __('customer.Existing addresses') }}
</h2>
</header>
<div class="grid grid-cols-3">
<div class="grid grid-cols-3 space-x-4 space-y-4">
<template x-for="address in addresses" :key="address.id">
<div>
<div class="flex flex-col p-8 pb-0">
<div class="border border-gray-500 pb-8">
<div class="flex flex-col p-8">
<x-address-card/>
</div>
<x-danger-button
x-show="!address.is_delivery && !address.is_address"
class="ml-8"
x-data=""
x-on:click.prevent="delete_id = address.id;$dispatch('open-modal', 'confirm-user-deletion')"
>{{ __('customer.Delete Address') }}</x-danger-button>
<div class="flex flex-row">
<a class="ml-8 inline-block" x-bind:href="'/address/' + address.id + '/edit'"><x-primary-button class="pl-2"><x-edit-icon class="h-6 mr-2"/>{{ __('form.Edit') }}</x-primary-button></a>
<x-danger-button
class="ml-2 pl-2"
x-data=""
x-on:click.prevent="delete_id = address.id;$dispatch('open-modal', 'confirm-user-deletion')"
><x-trash-icon class="h-6 mr-2"/>{{ __('form.Delete') }}</x-danger-button>
</div>
</div>
</template>
</div>
@@ -189,7 +192,6 @@
</form>
</x-modal>
</div>
</div>