-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGästevoucher.svelte
69 lines (65 loc) · 1.71 KB
/
Gästevoucher.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<script>
import Papa from "papaparse";
const _ = R("lodash");
export let privat
let vouchers = "",
values;
const update_vouchers = async () => {
const res = await Papa.parse(vouchers, { comments: "#" });
values = res.data.map((e) => e[0].trim());
};
</script>
<style>
@import "css/main.css";
.page {
padding: 0;
}
.grid {
display: grid;
grid-template-columns: repeat(1, 1fr);
grid-gap: 10px;
}
</style>
{#if values}
{#each _.chunk(values, 9) as slice}
<div
class="page"
orientation="portrait"
size="A4"
style="font-family: sans">
<div class="grid">
{#each slice as s}
<div style="padding: 0 10px 0 10px;">
<b>Zugangscode für {privat.wlan} des {privat.schulname}</b><br>
Verbinden Sie sich mit dem WLAN und geben Sie den Zugangscode beim Anmeldebildschirm ein. Der Zugang ist für acht Stunden ab der ersten Eingabe gültig.
<center><b style="font-size: xx-large; font-family: monospace;">{s}</b></center>
</div>
<hr />
{/each}
</div>
</div>
{/each}
{:else}
<h3 class="title">Voucher austauschen</h3>
<div class="field">
<label class="label" for="ta">
Voucher als Liste zeilenweise in das Textfeld einfügen. Alte Voucher
werden entfernt und durch die neuen ersetzt.
</label>
<div class="control">
<textarea
class="textarea"
id="ta"
bind:value={vouchers}
rows="10"
cols="20" />
</div>
</div>
<div class="field is-grouped">
<div class="control">
<button
class="button is-link"
on:click={() => update_vouchers()}>Aktualisieren</button>
</div>
</div>
{/if}