Compare commits

...
2 Commits
Author SHA1 Message Date
StephanRichter 695c1e769f loading journal on demand
Build Docker Image / Docker-Build (push) Failing after 14m46s
Build Docker Image / Clean-Registry (push) Successful in 10s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-08-16 10:01:05 +02:00
StephanRichter eed6dbf38b removed obsolete call to console.log
Build Docker Image / Docker-Build (push) Successful in 2m12s
Build Docker Image / Clean-Registry (push) Successful in 6s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-08-12 09:19:16 +02:00
5 changed files with 20 additions and 6 deletions
+13 -3
View File
@@ -4,19 +4,22 @@
import { t } from '../../translations.svelte'; import { t } from '../../translations.svelte';
let { module, entityId } = $props(); let { module, entityId } = $props();
let data = $state({journal:[]}); let data = $state(null);
let loading = $state(false);
async function loadJournal(){ async function onclick(ev){
loading = true;
const url = api(`journal/${module}/${entityId}`); const url = api(`journal/${module}/${entityId}`);
const res = await get(url); const res = await get(url);
if (res.ok) { if (res.ok) {
data = await res.json(); data = await res.json();
} else error(res); } else error(res);
loading = false;
} }
$effect(loadJournal);
</script> </script>
{#if data}
<ul> <ul>
{#each data.journal as entry (entry.id)} {#each data.journal as entry (entry.id)}
<li> <li>
@@ -27,3 +30,10 @@
</li> </li>
{/each} {/each}
</ul> </ul>
{:else}
{#if loading}
{t('loading…')}
{:else}
<button {onclick}>{t('load {object}',{object:t('journal')})}</button>
{/if}
{/if}
-1
View File
@@ -60,7 +60,6 @@
} }
function calcYearMap(){ function calcYearMap(){
console.log('calcYearMap called');
let result = { let result = {
months : {}, months : {},
years : {} years : {}
+2 -1
View File
@@ -15,7 +15,8 @@ export function t(key,args = {}){
for (let token of keys){ for (let token of keys){
if (!set[token]){ if (!set[token]){
console.warn('Missing translation for '+key); console.warn('Missing translation for '+key);
return keys[keys.length-1].replaceAll('_',' '); set = keys[keys.length-1].replaceAll('_',' ');
break;
} }
set = set[token]; set = set[token];
} }
+2
View File
@@ -198,6 +198,7 @@
"items": "Artikel", "items": "Artikel",
"join_objects" : "{objects} zusammenführen", "join_objects" : "{objects} zusammenführen",
"journal": "Journal",
"kanban": "Kanban", "kanban": "Kanban",
"key": "Suchbegriff", "key": "Suchbegriff",
@@ -208,6 +209,7 @@
"loading": "lade…", "loading": "lade…",
"loading_data": "Daten werden geladen…", "loading_data": "Daten werden geladen…",
"loading_object": "lade {object}…", "loading_object": "lade {object}…",
"load {object}": "{object} laden",
"local_court": "Amtsgericht", "local_court": "Amtsgericht",
"locality": "Ort", "locality": "Ort",
"location": "Ort", "location": "Ort",
+2
View File
@@ -198,6 +198,7 @@
"items": "items", "items": "items",
"join_objects" : "join {objects}", "join_objects" : "join {objects}",
"journal": "Journal",
"kanban": "Kanban", "kanban": "Kanban",
"key": "search term", "key": "search term",
@@ -208,6 +209,7 @@
"loading": "loading…", "loading": "loading…",
"loading_data": "loading data…", "loading_data": "loading data…",
"loading_object": "loading {object}…", "loading_object": "loading {object}…",
"load {object}": "load {object}",
"local_court": "local court", "local_court": "local court",
"locality": "locality", "locality": "locality",
"location": "location", "location": "location",