8 changed files with 105 additions and 5 deletions
@ -1,6 +1,7 @@ |
|||||||
<script> |
<script> |
||||||
import { t } from '../translations.svelte.js'; |
import { t } from '../translations.svelte.js'; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<footer> |
<footer> |
||||||
{@html t('footer.message','<a href="https://srsoftware.de">SRSoftware</a>')} |
{@html t('footer.message','<a href="https://srsoftware.de">SRSoftware</a>')} |
||||||
</footer> |
</footer> |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
<script> |
||||||
|
import { t } from '../../translations.svelte.js'; |
||||||
|
import { checkUser } from '../../user.svelte.js'; |
||||||
|
|
||||||
|
let { fetchOptions, key, value, onUpdate } = $props(); |
||||||
|
|
||||||
|
let options = $state([]); |
||||||
|
|
||||||
|
async function loadOptions(){ |
||||||
|
const resp = await fetchOptions(); |
||||||
|
const arr = await resp.json(); |
||||||
|
for (let entry of arr){ |
||||||
|
const value = entry.value; |
||||||
|
const caption = entry.caption ? entry.caption : value; |
||||||
|
options.push({caption:caption,value:value}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function propagate(){ |
||||||
|
let changeset = {} |
||||||
|
changeset[key] = value; |
||||||
|
onUpdate(changeset); |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
{#if options.length > 0} |
||||||
|
<select bind:value onchange={propagate} > |
||||||
|
{#each options as entry,i} |
||||||
|
<option value={entry.value}>{entry.caption}</option> |
||||||
|
{/each} |
||||||
|
</select> |
||||||
|
{:else} |
||||||
|
<span onclick={loadOptions}>{value}</span> |
||||||
|
{/if} |
||||||
@ -0,0 +1,37 @@ |
|||||||
|
a { |
||||||
|
color: black; |
||||||
|
} |
||||||
|
body { |
||||||
|
background: white; |
||||||
|
color: navy; |
||||||
|
} |
||||||
|
|
||||||
|
fieldset { |
||||||
|
border: 1px solid blue; |
||||||
|
border-radius: 4px; |
||||||
|
} |
||||||
|
|
||||||
|
input{ |
||||||
|
background: lightcyan; |
||||||
|
border: 1px dotted blue; |
||||||
|
border-radius: 4px; |
||||||
|
padding: 3px; |
||||||
|
margin: 3px; |
||||||
|
color: blue; |
||||||
|
} |
||||||
|
|
||||||
|
button{ |
||||||
|
background: red; |
||||||
|
border-radius: 5px; |
||||||
|
padding: 5px 7px; |
||||||
|
border-width: 2px; |
||||||
|
border-style: solid; |
||||||
|
border-color: yellow red red yellow; |
||||||
|
} |
||||||
|
footer { |
||||||
|
position: absolute; |
||||||
|
bottom: 0; |
||||||
|
width: 100%; |
||||||
|
text-align: center; |
||||||
|
margin: 5px; |
||||||
|
} |
||||||
Loading…
Reference in new issue