From e89f513677aca90f1746cdba6a0918946a651716 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Fri, 10 Oct 2025 20:53:33 +0200 Subject: [PATCH] implemented adding of new addresses, numbers, emails and web pages Signed-off-by: Stephan Richter --- frontend/src/routes/contact/Card.svelte | 23 +++++++++++++++++++++- frontend/src/routes/contact/Index.svelte | 4 ---- frontend/src/routes/contact/URL.svelte | 2 +- translations/src/main/resources/de.json | 1 + web/src/main/resources/web/css/default.css | 4 ++++ 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/frontend/src/routes/contact/Card.svelte b/frontend/src/routes/contact/Card.svelte index 6516216..4b19b7e 100644 --- a/frontend/src/routes/contact/Card.svelte +++ b/frontend/src/routes/contact/Card.svelte @@ -26,6 +26,23 @@ let orgs = $derived(contact.vcard.match(/^ORG.*:.+$/gm)); let urls = $derived(contact.vcard.match(/^URL.*:.+$/gm)); + function add_address(){ + var new_addr = `ADR;TYPE=WORK:;;${t('street')};${t('locality')};${t('region')};${t('post_code')};${t('country')}`; + patch('END:',`${new_addr}\nEND:`); + } + + function add_email(){ + patch('END:',`EMAIL:${t('email')}@example.com\nEND:`); + } + + function add_number(){ + patch('END:',`TEL:${t('phone')}\nEND:`); + } + + function add_url(){ + patch('END:',`URL:https://example.com\nEND:`); + } + async function drop(){ for (let n of names){ n = name(n); @@ -114,13 +131,15 @@ + {#each addresses as code}
{/each} - + + {#each numbers as code} {/each} @@ -128,6 +147,7 @@ + {#each emails as code} {/each} @@ -142,6 +162,7 @@ + {#each urls as code} {/each} diff --git a/frontend/src/routes/contact/Index.svelte b/frontend/src/routes/contact/Index.svelte index 0e4d6d7..84fa550 100644 --- a/frontend/src/routes/contact/Index.svelte +++ b/frontend/src/routes/contact/Index.svelte @@ -23,13 +23,9 @@ PRODID:Umbrella Contact manager by SRSoftware FN:${t('formatted_name')} N:${t('family_name')};${t('given_name')};;; ORG:${t('organization')} -EMAIL;TYPE=HOME:${t('email')} EMAIL;TYPE=WORK:${t('email')} -ADR;TYPE=HOME:;;${t('street')};${t('locality')};${t('region')};${t('post_code')};${t('country')} ADR;TYPE=WORK:;;${t('street')};${t('locality')};${t('region')};${t('post_code')};${t('country')} TEL;TYPE=CELL;:${t('phone_cell')} -TEL;TYPE=HOME;:${t('phone_home')} -TEL;TYPE=WORK;:${t('phone_work')} X-TAX-NUMBER:${t('tax_id')} X-BANK-ACCOUNT:${t('bank_account')}\\nIBAN:XXXX\\nBIC:XXXX X-COURT:${t('local_court')} diff --git a/frontend/src/routes/contact/URL.svelte b/frontend/src/routes/contact/URL.svelte index e258705..4c39221 100644 --- a/frontend/src/routes/contact/URL.svelte +++ b/frontend/src/routes/contact/URL.svelte @@ -14,5 +14,5 @@ {#if value} - + {/if} \ No newline at end of file diff --git a/translations/src/main/resources/de.json b/translations/src/main/resources/de.json index 8e1c86e..d8c732a 100644 --- a/translations/src/main/resources/de.json +++ b/translations/src/main/resources/de.json @@ -293,6 +293,7 @@ "user_module" : "Umbrella User-Verwaltung", "users": "Benutzer", + "website": "Website", "welcome" : "Willkommen, {0}", "wiki": "Wiki", "wikis": "Wiki-Seiten", diff --git a/web/src/main/resources/web/css/default.css b/web/src/main/resources/web/css/default.css index dc55aa4..144cea0 100644 --- a/web/src/main/resources/web/css/default.css +++ b/web/src/main/resources/web/css/default.css @@ -419,4 +419,8 @@ fieldset.vcard{ border-width: 1px; vertical-align: top; padding: 2px; +} + +.vcard td button.symbol{ + float: right; } \ No newline at end of file