working on vcard display
This commit is contained in:
@@ -11,24 +11,64 @@
|
|||||||
let { contact } = $props();
|
let { contact } = $props();
|
||||||
|
|
||||||
let addresses = $derived(contact.vcard.match(/^ADR.*:.+$/gm));
|
let addresses = $derived(contact.vcard.match(/^ADR.*:.+$/gm));
|
||||||
|
let code = $state(false);
|
||||||
let emails = $derived(contact.vcard.match(/^EMAIL.*:.+$/gm));
|
let emails = $derived(contact.vcard.match(/^EMAIL.*:.+$/gm));
|
||||||
let extra_fields = $derived(contact.vcard.match(/^X-.*:.+/gm));
|
let extra_fields = $derived(contact.vcard.match(/^X-.*:.+/gm));
|
||||||
|
|
||||||
|
function toggleCode(){
|
||||||
|
code = !code;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset class="vcard">
|
||||||
<legend>{t('contact_number',{number:contact.id})}</legend>
|
<legend>
|
||||||
<FN vcard={contact.vcard} />
|
{t('contact_number',{number:contact.id})}
|
||||||
<Org vcard={contact.vcard} />
|
<button class="symbol" onclick={toggleCode}>C</button>
|
||||||
<Name vcard={contact.vcard} />
|
</legend>
|
||||||
{#each addresses as code}
|
<table>
|
||||||
<Address {code} />
|
<thead></thead>
|
||||||
{/each}
|
<tbody>
|
||||||
{#each emails as code}
|
<tr>
|
||||||
<Email {code} />
|
<td>
|
||||||
{/each}
|
<FN vcard={contact.vcard} />
|
||||||
{#each extra_fields as code}
|
</td>
|
||||||
<ExtraField {code} />
|
{#if code}
|
||||||
{/each}
|
<td rowspan="6">
|
||||||
<hr/>
|
<pre>{contact.vcard}</pre>
|
||||||
<pre>{contact.vcard}</pre>
|
</td>
|
||||||
|
{/if}
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Org vcard={contact.vcard} />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Name vcard={contact.vcard} />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{#each addresses as code}
|
||||||
|
<Address {code} />
|
||||||
|
{/each}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{#each emails as code}
|
||||||
|
<Email {code} />
|
||||||
|
{/each}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{#each extra_fields as code}
|
||||||
|
<ExtraField {code} />
|
||||||
|
{/each}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -8,5 +8,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if name}
|
{#if name}
|
||||||
<span class="formatted name"><span>{t('formatted name')}: </span>{name}</span>
|
<span class="formatted name">{name}</span>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -8,5 +8,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if o}
|
{#if o}
|
||||||
<span class="organization"><span>{t('organization')}: </span>{o}</span>
|
<span class="organization">{o}</span>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -387,4 +387,32 @@ a.wikilink{
|
|||||||
text-align: initial;
|
text-align: initial;
|
||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset.vcard{
|
||||||
|
display: inline;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vcard legend{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vcard .name{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vcard .address span {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.vcard table{
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: -1px;
|
||||||
|
}
|
||||||
|
.vcard td{
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
vertical-align: top;
|
||||||
|
padding: 2px;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user