Completed checkbox_query and rewrite of change_modules module with checkboxes

This commit is contained in:
Nathan Schneider
2022-01-02 23:13:56 -07:00
parent 28a05c584c
commit 2989bd34bd
6 changed files with 195 additions and 23 deletions

View File

@ -49,16 +49,14 @@ function change_modules:initiate(result)
if v[2] ~= modules_before[i][2] then
if v[2] then
table.insert(self.data.add_modules, v[1])
modpol.msg("add-insert: "..v[1])
else
table.insert(self.data.remove_modules, v[1])
modpol.msg("remove-insert: "..v[1])
end
end
end
-- abort if no changes
if self.data.add_modules == {}
and self.data.remove_modules == {} then
if #self.data.add_modules == 0
and #self.data.remove_modules == 0 then
modpol.interactions.message(
self.initiator, "No module changes proposed")
modpol.interactions.org_dashboard(
@ -74,7 +72,7 @@ function change_modules:initiate(result)
self.data.summary = self.data.summary.."\nAdd: "..
table.concat(self.data.add_modules,", ")
elseif #self.data.remove_modules > 0 then
summary = "\nRemove: "..
self.data.summary = "\nRemove: "..
table.concat(self.data.remove_modules,", ")
end
self.org:call_module(