From e3c33a7492617bde049d2b999532cfa8cd70afbc Mon Sep 17 00:00:00 2001 From: iou1name Date: Wed, 25 Sep 2019 12:51:36 -0400 Subject: [PATCH] collapsible sections --- static/buckler.css | 8 ++- static/buckler.js | 14 +++++ templates/index.html | 132 ++++++++++++++++++++++++------------------- 3 files changed, 95 insertions(+), 59 deletions(-) diff --git a/static/buckler.css b/static/buckler.css index 085c403..86f8ab5 100644 --- a/static/buckler.css +++ b/static/buckler.css @@ -22,13 +22,19 @@ main { main section { background-color: whitesmoke; - padding: 5%; + padding: 2% 5%; border-radius: 0.5em; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); } +h2 { + font-size: 16px; + margin: 0; + cursor: pointer; +} + #avail_sites { margin: 0; padding-left: 1em; diff --git a/static/buckler.js b/static/buckler.js index dbbe081..dca9f39 100644 --- a/static/buckler.js +++ b/static/buckler.js @@ -1,3 +1,17 @@ +function load() { + let headers = document.querySelectorAll('h2'); + headers.forEach(function(header) { + header.addEventListener('click', function() { + let article = this.nextElementSibling; + if (article.style.display === 'none') { + article.style.display = ''; + } else { + article.style.display = 'none'; + } + }); + }); +} + function perm_change(row) { let user_perms = users_perms[row.children[0].textContent]; let row_perms = []; diff --git a/templates/index.html b/templates/index.html index 0c1f393..cb8c878 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,11 +2,12 @@ Buckler + - +
@@ -15,72 +16,87 @@
- Available sites - +

Available Sites

+
{% if request['session']['admin'] %}
- - - - - {% for app in apps %} - +

User Permissions

+
+
+
User{{ app }}
+ + + + {% for app in apps %} + + {% endfor %} + + + + + {% for username, values in users.items() %} + + + {% for value in values %} + + {% endfor %} + + {% endfor %} - - - - - {% for username, values in users.items() %} - - - {% for value in values %} - - {% endfor %} - - - {% endfor %} - -
User{{ app }}
{{ username }}
{{ username }}
+ + +
{% endif %}
-
- -
- -
- -
- -
+

Change Password

+
+
+
+ +
+ +
+ +
+ +
+
- {% if fido2_keys %} - - - - - - - - - {% for key in fido2_keys %} - - - - - {% endfor %} - -
NickDelete
{{ key['nick'] }}
- {% else %} - No registered keys. - {% endif %} -
Add key +

Security Keys

+
+
+ {% if fido2_keys %} + + + + + + + + + {% for key in fido2_keys %} + + + + + {% endfor %} + +
NickDelete
{{ key['nick'] }}
+ {% else %} + No registered keys. + {% endif %} +
Add key +