diff --git a/src/App.svelte b/src/App.svelte index afecf3e6..aef1c587 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -54,6 +54,7 @@ import Privacy from "./components/Privacy.svelte"; import ResetPassword from "./components/ResetPassword.svelte"; import Contacts from "./components/Contacts.svelte"; +import ContactDetail from "./components/ContactDetail.svelte"; store.init(); registerSW(); @@ -125,7 +126,7 @@ import Contacts from "./components/Contacts.svelte"; - + diff --git a/src/components/ContactDetail.svelte b/src/components/ContactDetail.svelte new file mode 100644 index 00000000..aa9fe042 --- /dev/null +++ b/src/components/ContactDetail.svelte @@ -0,0 +1,285 @@ + + +{#await promise} + Loading contact details... +{:then} + + + + + + + + + + + {$_('contacts')} + + + + {original_data.firstname} + {original_data.middlename || ''} + {original_data.lastname} + + + + + + + {original_data.firstname} + {original_data.middlename || ''} + {original_data.lastname} + + {#if store.state.jwtinfo.userdetails.permissions.includes('CONTACT:DELETE')} + {#if delete_triggered} + {$_('confirm-deletion')} + { + delete_triggered = !delete_triggered; + }} + class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:text-sm">{$_('cancel')} + {/if} + {#if !delete_triggered} + { + delete_triggered = true; + }} + type="button" + class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">Delete + Contact + {/if} + {/if} + {#if !delete_triggered} + {$_('save-changes')} + {/if} + + + + + {$_('first-name')} + + {#if !isFirstnameValid} + + {$_('first-name-is-required')} + + {/if} + + + {$_('middle-name')} + + + + {$_('last-name')} + + {#if !isLastnameValid} + + {$_('last-name-is-required')} + + {/if} + + + {$_('e-mail-adress')} + + {#if !isEmailValid} + + {$_('valid-email-is-required')} + + {/if} + + + {$_('phone')} + + + + {$_('groups')} + + {#each teams as team} + + {team.parentGroup.name} + > + {team.name} + + {/each} + {#each orgs as org} + {org.name} + {/each} + + + +{:catch error} + +{/await}