html-sites #3

Merged
TorstenHettstedt merged 10 commits from html-sites into master 2021-04-08 20:16:00 +02:00
4 changed files with 44 additions and 21 deletions
Showing only changes of commit c8d9bc040e - Show all commits
+4 -1
View File
@@ -10,9 +10,12 @@
}, },
"dependencies": { "dependencies": {
"ganalytics": "^3.1.2", "ganalytics": "^3.1.2",
"navaid": "^1.0.2" "navaid": "^1.0.2",
"open-iconic": "^1.1.1"
}, },
"devDependencies": { "devDependencies": {
"@iconify-icons/oi": "^1.1.0",
"@iconify/svelte": "^1.0.4",
"@rollup/plugin-commonjs": "^15.0.0", "@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0", "@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.0", "@rollup/plugin-replace": "^2.3.0",
+2 -2
View File
@@ -75,7 +75,7 @@
}; };
let r = { let r = {
"workingDay": "2020-01-15", "workingDay": "2020-01-15",
"workingTime": "99:00:00" "workingTime": "09:00:00"
}; };
let records = { let records = {
"title" : "Einträge", "title" : "Einträge",
@@ -83,7 +83,7 @@
}; };
const router = Navaid('/') const router = Navaid('/')
.on('/', () => run(import('../routes/Home.svelte'))) .on('/', () => run(import('../routes/Home.svelte'), weekly))
.on('/views/weekly', () => run(import('../routes/Views.svelte'), weekly)) .on('/views/weekly', () => run(import('../routes/Views.svelte'), weekly))
.on('/views/monthly', () => run(import('../routes/Views.svelte'), monthly)) .on('/views/monthly', () => run(import('../routes/Views.svelte'), monthly))
.on('/views/yearly', () => run(import('../routes/Views.svelte'), yearly)) .on('/views/yearly', () => run(import('../routes/Views.svelte'), yearly))
+1 -10
View File
@@ -2,14 +2,5 @@
<script> <script>
import Views from "./Views.svelte"; import Views from "./Views.svelte";
let r = { export let params;
"Zeitraum": "2020#01",
"Arbeitstage": 20,
"Arbeitsstunden": "99:00:00",
"Unterstunden": "10:22:00"
};
let params = {
"title" : "Wochenansicht",
"records" : [r, r]
};
</script> </script>
+37 -8
View File
@@ -1,6 +1,12 @@
<script> <script>
export let params; export let params;
let title = "Bearbeitung Einträge" let title = "Bearbeitung Einträge"
import IconifyIcon from '@iconify/svelte';
import wrenchIcon from '@iconify-icons/oi/wrench';
import trashIcon from '@iconify-icons/oi/trash';
import checkIcon from '@iconify-icons/oi/check';
import xIcon from '@iconify-icons/oi/x';
let activeRecord = null;
</script> </script>
<svelte:head> <svelte:head>
@@ -9,23 +15,46 @@
<h1>{title}</h1> <h1>{title}</h1>
{#if activeRecord === null}
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Zeitraum</th> <th>Datum</th>
<th>Arbeitstage</th>
<th>Arbeitsstunden</th> <th>Arbeitsstunden</th>
<th>Über- / Unterstunden</th> <th>Aktionen</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{#each params.records as record} {#each params.records as record}
<tr> <tr>
<td>{record.Zeitraum}</td> <td>{record.workingDay}</td>
<td>{record.Arbeitstage}</td> <td>{record.workingTime}</td>
<td>{record.Arbeitsstunden}</td> <td>
<td>{record.Unterstunden}</td> <button>Bearbeiten <IconifyIcon icon={wrenchIcon} /></button>
<button>Löschen <IconifyIcon icon={trashIcon} color="red" /></button>
</td>
</tr> </tr>
{/each} {/each}
</tbody> </tbody>
</table> </table>
{:else}
<!--suppress HtmlUnknownTarget -->
<form action="/working-hours" name="editRecord">
<fieldset name="record-data">
<div>
<label for="workingDay">Arbeitstag</label>
<!--suppress JSUnresolvedVariable -->
<input bind:value={activeRecord.workingDay} placeholder="Arbeitstag" type="date" id="workingDay">
</div>
<div>
<label for="workingTime">Arbeitszeit</label>
<!--suppress JSUnresolvedVariable -->
<input bind:value={activeRecord.workingTime} placeholder="Arbeitszeit" type="time" id="workingTime">
</div>
</fieldset>
<fieldset name="buttons">
<button>Übernehmen <IconifyIcon icon={checkIcon} color="green" /></button>
<button>Abbrechen <IconifyIcon icon={xIcon} /></button>
</fieldset>
</form>
{/if}