added GUI files

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-08-07 15:44:35 +02:00
parent 98ae959b7c
commit 5de24db209
2 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
<script>
import {api} from '../../urls.svelte.js'
import {t} from '../../translations.svelte.js';
import LineEditor from '../../Components/LineEditor.svelte';
import Multiline from '../../Components/MultilineEditor.svelte';
async function patch(changeSet){
const url = api(`company/${company.id}`)
const resp = await fetch(url,{
credentials : 'include',
method : 'PATCH',
body : JSON.stringify(changeSet)
});
if (resp.ok){
return true;
}
error = await resp.text();
return false;
}
let { company } = $props();
</script>
{#if company}
<fieldset>
<legend>{t('name')}</legend>
<LineEditor bind:value={company.name} editable={true} onSet={val => patch({name:val})} />
</fieldset>
<fieldset>
<legend>{t('address')}</legend>
<Multiline bind:value={company.address} editable={true} onSet={val => patch({address:val})} />
</fieldset>
{/if}

View File

@@ -53,7 +53,7 @@
<tr onclick={e => showDetail(cid)}>
<td>{company.name}</td>
<td>{company.email}</td>
<td>{company.address.replace('\r','').replace('\n',' / ')}</td>
<td>{company.address.replace('\r','').replaceAll('\n',' / ')}</td>
</tr>
{#if selected==cid}
<tr>