summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2020-04-20 00:52:33 +0200
committerDirk Engling <erdgeist@erdgeist.org>2020-04-20 00:52:33 +0200
commit2460ef593a17eecad863e8702904292cc9706d9e (patch)
treee872cee22c8f77b1f25976d794d48564723627dd /templates
Kickoff
Diffstat (limited to 'templates')
-rw-r--r--templates/admin.html67
-rw-r--r--templates/mandant.html37
2 files changed, 104 insertions, 0 deletions
diff --git a/templates/admin.html b/templates/admin.html
new file mode 100644
index 0000000..e62979e
--- /dev/null
+++ b/templates/admin.html
@@ -0,0 +1,67 @@
1<!DOCTYPE html>
2<html>
3<head>
4<title>Filer Admin</title>
5<meta charset="UTF-8">
6{{ dropzone.load_css() }}
7{{ dropzone.style('border: 2px dashed #0087F7; min-height: 3em;') }}
8<link rel="stylesheet" href="/static/style.css">
9<script>
10function generatePassword() {
11 var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+,-./:;<=>?@_{|}~";
12 var randarray = new Uint16Array(32);
13 var retval = "";
14 window.crypto.getRandomValues(randarray);
15 for (var i = 0, n = chars.length; i < randarray.length; ++i)
16 retval += chars.charAt(Math.floor(randarray[i] * n / 65336));
17 console.log(retval);
18 document.getElementById("password").value = retval;
19}
20</script>
21</head>
22<body>
23{{ dropzone.load_js() }}
24<h1>Kanzlei Hubrig – Administration</h1>
25<h2>Mandanten</h2>
26<ul>
27{%- for item in users %}
28 <li>
29 <form action="/admin/del-user/{{item}}" method="post" style="display: inline;" onsubmit="return confirm('Sind Sie sicher?');">
30 <input type="hidden" name="_method" value="DELETE">
31 <button class="delete">löschen</button>
32 </form>
33 <button class="edit" onclick="document.getElementById('user').value='{{item}}'">edit</button>
34 <a href="/admin/Dokumente/{{item}}">{{item}}</a> <small>Mandanten-URL: {{url_root}}Dokumente/{{item}}</small>
35 </li>
36{%- endfor %}
37<li>
38 <form action="/admin/new-user" method="post">
39 <input id="user" name="user" type="text" placeholder="Name" required></input>
40 <input id="password" name="password" type="text" placeholder="Passwort" autocomplete="off" required></input>
41 <script>generatePassword()</script>
42 <button class="add" type="button" onclick="generatePassword()">Zufall</button>
43 <button class="add">Hinzufügen</button>
44 </form>
45</li>
46</ul>
47
48<h2>Öffentliche Dokumente</h2>
49<ul>
50{%- for item in tree.children recursive %}
51 <li><form action="/admin/{{ item.name }}" method="post" style="display: inline;" onsubmit="return confirm('Are you sure?');">
52 <input type="hidden" name="_method" value="DELETE">
53 <button class="delete">löschen</button>
54 </form>
55 <a href="{{ item.name }}" download="{{item.download}}">{{ item.download }}</a>
56 {%- if item.children -%}
57 <ul>{{ loop(item.children) }}</ul>
58 {%- endif %}</li>
59{%- endfor %}
60</ul>
61
62<h2>Öffentliches Dokument hochladen</h2>
63<div class="droppy">{{ dropzone.create(action='/admin') }}</div>
64
65{{ dropzone.config() }}
66</body>
67</html>
diff --git a/templates/mandant.html b/templates/mandant.html
new file mode 100644
index 0000000..16c07ab
--- /dev/null
+++ b/templates/mandant.html
@@ -0,0 +1,37 @@
1<!DOCTYPE html>
2<html>
3<head>
4<title>Filer</title>
5<meta charset="UTF-8">
6{{ dropzone.load_css() }}
7{{ dropzone.style('border: 2px dashed #0087F7; min-height: 10px;') }}
8<link rel="stylesheet" href="/static/style.css">
9</head>
10<body>
11{{ dropzone.load_js() }}
12<h1>Kanzlei Hubrig – Dokumenten-Austausch</h1>
13{%- if admin %}
14<a href="/admin">Zurück zur Übersicht</a>
15{% endif -%}
16<h2>Dokumente</h2>
17<ul>
18{%- for item in tree.children recursive %}
19 <li><form action="/{{admin}}{{ item.name }}" method="post" style="display: inline;" onsubmit="return confirm('Sind Sie sicher?');">
20 <input type="hidden" name="_method" value="DELETE">
21 <button class="delete" type="submit">löschen</button>
22 </form>
23 <div class="age">{{item.ttl}} Tag{%- if not item.ttl == 1 -%}e{%- endif -%}</div>
24 {%- if 'children' in item -%}
25 {{item.download}}<br/>
26 <ul>{{ loop(item.children) }}</ul>
27 {%- else -%}
28 <a href="/{{admin}}{{item.name}}" download="{{item.download}}">{{ item.download }}</a>
29 {%- endif %}</li>
30{%- endfor %}
31</ul>
32
33<div class="droppy">{{ dropzone.create(action="/"+admin+"Dokumente/"+user) }}</div>
34
35{{ dropzone.config() }}
36</body>
37</html>