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';
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 res = await get(url);
if (res.ok) {
data = await res.json();
} else error(res);
loading = false;
}
$effect(loadJournal);
</script>
{#if data}
<ul>
{#each data.journal as entry (entry.id)}
<li>
@@ -27,3 +30,10 @@
</li>
{/each}
</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(){
console.log('calcYearMap called');
let result = {
months : {},
years : {}
+3 -2
View File
@@ -10,12 +10,13 @@ export async function loadTranslation(lang){
export function t(key,args = {}){
if (key === undefined) return "";
if (key instanceof Response) key = 'status.'+key.status;
let set = translations.values;
let set = translations.values;
let keys = key.split('.');
for (let token of keys){
if (!set[token]){
console.warn('Missing translation for '+key);
return keys[keys.length-1].replaceAll('_',' ');
set = keys[keys.length-1].replaceAll('_',' ');
break;
}
set = set[token];
}
+2
View File
@@ -198,6 +198,7 @@
"items": "Artikel",
"join_objects" : "{objects} zusammenführen",
"journal": "Journal",
"kanban": "Kanban",
"key": "Suchbegriff",
@@ -208,6 +209,7 @@
"loading": "lade…",
"loading_data": "Daten werden geladen…",
"loading_object": "lade {object}…",
"load {object}": "{object} laden",
"local_court": "Amtsgericht",
"locality": "Ort",
"location": "Ort",
+2
View File
@@ -198,6 +198,7 @@
"items": "items",
"join_objects" : "join {objects}",
"journal": "Journal",
"kanban": "Kanban",
"key": "search term",
@@ -208,6 +209,7 @@
"loading": "loading…",
"loading_data": "loading data…",
"loading_object": "loading {object}…",
"load {object}": "load {object}",
"local_court": "local court",
"locality": "locality",
"location": "location",