From 7ed42e017e3fe73891329ee36dcd7d91e92358d6 Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 17 Oct 2019 13:38:40 -0400 Subject: [PATCH] submit user perms --- static/buckler.js | 19 +++++++++++++++++++ templates/index.html | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/static/buckler.js b/static/buckler.js index 5d7462a..fa085a4 100644 --- a/static/buckler.js +++ b/static/buckler.js @@ -37,3 +37,22 @@ function perm_change(row) { } console.log("perms_changed = " + perms_changed); } + +function submit_user_perms(row) { + let row_perms = {}; + for (let child of row.children) { + if (child.firstChild.type == "checkbox") { + if (child.firstChild.checked) { + row_perms[child.firstChild.dataset.appName] = true; + } else { + row_perms[child.firstChild.dataset.appName] = false; + } + } + } + console.log(row_perms); + fetch(window.location.pathname, { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: row_perms + }); +} diff --git a/templates/index.html b/templates/index.html index 614948d..b70e18e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -32,6 +32,7 @@

Admin Panel

+

User Permissions

@@ -53,13 +54,14 @@ {% for name, value in values.items() %} {% endfor %} - + {% endfor %}
+

Invite New User