Major improvements on policy configuration

- Bugfixes on change_policy
- Replaced _consent modules with configurable modules
This commit is contained in:
Nathan Schneider
2022-08-09 17:00:24 -06:00
parent 78ea89559f
commit 22a2048d5a
21 changed files with 253 additions and 379 deletions

View File

@ -27,7 +27,11 @@ function modpol.interactions.get_policy_string(
this_policy =
tostring(this_org.policies[module_slug][k])
else
this_policy = tostring(v)
if not v then
this_policy = "none"
else
this_policy = tostring(v)
end
end
table.insert(output, k.." - "..this_policy)
end
@ -207,6 +211,7 @@ function modpol.interactions.org_dashboard(user, org_string)
org.name, module.slug, "\n")..
"\n".."Proceed?",
function(input)
print("\n")
if input == "Yes" then
org:call_module(module_sel, user)
elseif input == "No" then
@ -468,10 +473,8 @@ function modpol.interactions.binary_poll_user(user, question, func)
answer = io.read()
until answer == "y" or answer == "n"
if answer == "y" then
modpol.interactions.message(user, "Response recorded")
func("Yes")
elseif answer == "n" then
modpol.interactions.message(user, "Response recorded")
func("No")
else
modpol.interactions.message(user, "Error: invalid response")