Completed checkbox_query and rewrite of change_modules module with checkboxes
This commit is contained in:
@ -187,7 +187,12 @@ function modpol.interactions.org_dashboard(user, org_string)
|
||||
print("Interact with which one (use [id] number)?")
|
||||
local to_interact = io.read()
|
||||
local process = org.processes[tonumber(to_interact)]
|
||||
if not process then return end
|
||||
if not process then
|
||||
modpol.interactions.message(
|
||||
user, "Not a pending process")
|
||||
modpol.interactions.org_dashboard(user, org.id)
|
||||
return
|
||||
end
|
||||
if org:has_pending_actions(user) then
|
||||
if org.pending[user][process.id] then
|
||||
org:interact(process.id, user)
|
||||
@ -381,8 +386,10 @@ function modpol.interactions.checkbox_query(
|
||||
end
|
||||
local result_table = modpol.util.copy_table(options)
|
||||
for i,v in ipairs(answer_table) do
|
||||
-- flip the boolean on selected options
|
||||
result_table[v][2] = not result_table[v][2]
|
||||
if result_table[v] then
|
||||
-- flip the boolean on selected options
|
||||
result_table[v][2] = not result_table[v][2]
|
||||
end
|
||||
end
|
||||
func(result_table)
|
||||
end
|
||||
@ -433,5 +440,5 @@ end
|
||||
|
||||
--testing command
|
||||
function modpol.msg(text)
|
||||
modpol.interactions.message("TEST MSG: ",text)
|
||||
modpol.interactions.message("TEST MSG",text)
|
||||
end
|
||||
|
Reference in New Issue
Block a user