diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2020-04-20 00:52:33 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2020-04-20 00:52:33 +0200 |
| commit | 2460ef593a17eecad863e8702904292cc9706d9e (patch) | |
| tree | e872cee22c8f77b1f25976d794d48564723627dd /templates/admin.html | |
Kickoff
Diffstat (limited to 'templates/admin.html')
| -rw-r--r-- | templates/admin.html | 67 |
1 files changed, 67 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> | ||
| 10 | function 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> | ||
