Added refresh button to Minetest dashboards
This commit is contained in:
parent
6aa09f9fdd
commit
046fad7f57
@ -175,7 +175,7 @@ function modpol.orgs:add_org(name, user)
|
|||||||
child_org.name = name
|
child_org.name = name
|
||||||
child_org.parent = self.id
|
child_org.parent = self.id
|
||||||
child_org.processes = {}
|
child_org.processes = {}
|
||||||
child_org.modules = self.modules
|
child_org.modules = modpol.copy_table(self.modules)
|
||||||
|
|
||||||
setmetatable(child_org, modpol.orgs)
|
setmetatable(child_org, modpol.orgs)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ function modpol.interactions.dashboard(user)
|
|||||||
-- set up formspec
|
-- set up formspec
|
||||||
local formspec = {
|
local formspec = {
|
||||||
"formspec_version[4]",
|
"formspec_version[4]",
|
||||||
"size[10,6]",
|
"size[10,8]",
|
||||||
"label[0.5,0.5;M O D U L A R P O L I T I C S]",
|
"label[0.5,0.5;M O D U L A R P O L I T I C S]",
|
||||||
"label[0.5,2;All orgs:]",
|
"label[0.5,2;All orgs:]",
|
||||||
"dropdown[2,1.5;7,0.8;all_orgs;"..formspec_list(all_orgs)..";;]",
|
"dropdown[2,1.5;7,0.8;all_orgs;"..formspec_list(all_orgs)..";;]",
|
||||||
@ -59,7 +59,8 @@ function modpol.interactions.dashboard(user)
|
|||||||
"dropdown[2,2.5;7,0.8;user_orgs;"..formspec_list(user_orgs)..";;]",
|
"dropdown[2,2.5;7,0.8;user_orgs;"..formspec_list(user_orgs)..";;]",
|
||||||
"label[0.5,4;All users:]",
|
"label[0.5,4;All users:]",
|
||||||
"dropdown[2,3.5;7,0.8;all_users;"..formspec_list(all_users)..";;]",
|
"dropdown[2,3.5;7,0.8;all_users;"..formspec_list(all_users)..";;]",
|
||||||
"button_exit[8.5,5;1,0.8;close;Close]",
|
"button[0.5,7;1,0.8;refresh;Refresh]",
|
||||||
|
"button_exit[8.5,7;1,0.8;close;Close]",
|
||||||
}
|
}
|
||||||
local formspec_string = table.concat(formspec, "")
|
local formspec_string = table.concat(formspec, "")
|
||||||
-- present to player
|
-- present to player
|
||||||
@ -70,12 +71,11 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
|||||||
if formname == "modpol:dashboard" then
|
if formname == "modpol:dashboard" then
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
if nil then
|
if nil then
|
||||||
-- buttons first
|
|
||||||
-- none here right now!
|
|
||||||
|
|
||||||
-- Put all dropdowns at the end
|
|
||||||
elseif fields.close then
|
elseif fields.close then
|
||||||
minetest.close_formspec(pname, formname)
|
minetest.close_formspec(pname, formname)
|
||||||
|
elseif fields.refresh then
|
||||||
|
modpol.interactions.dashboard(pname)
|
||||||
|
-- Put all dropdowns at the end
|
||||||
elseif fields.all_orgs or fields.user_orgs then
|
elseif fields.all_orgs or fields.user_orgs then
|
||||||
local org_name = fields.all_orgs or fields.user_orgs
|
local org_name = fields.all_orgs or fields.user_orgs
|
||||||
modpol.interactions.org_dashboard(pname, org_name)
|
modpol.interactions.org_dashboard(pname, org_name)
|
||||||
@ -163,6 +163,7 @@ function modpol.interactions.org_dashboard(user, org_string)
|
|||||||
"dropdown[2,3.5;7,0.8;modules;"..formspec_list(modules)..";;]",
|
"dropdown[2,3.5;7,0.8;modules;"..formspec_list(modules)..";;]",
|
||||||
"label[0.5,5;Pending ("..num_pending.."):]",
|
"label[0.5,5;Pending ("..num_pending.."):]",
|
||||||
"dropdown[2,4.5;7,0.8;pending;"..formspec_list(pending)..";;]",
|
"dropdown[2,4.5;7,0.8;pending;"..formspec_list(pending)..";;]",
|
||||||
|
"button[0.5,7;1,0.8;refresh;Refresh]",
|
||||||
"button[8.5,7;1,0.8;back;Back]",
|
"button[8.5,7;1,0.8;back;Back]",
|
||||||
}
|
}
|
||||||
local formspec_string = table.concat(formspec, "")
|
local formspec_string = table.concat(formspec, "")
|
||||||
@ -183,6 +184,8 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
|||||||
if nil then
|
if nil then
|
||||||
elseif fields.back then
|
elseif fields.back then
|
||||||
modpol.interactions.dashboard(pname)
|
modpol.interactions.dashboard(pname)
|
||||||
|
elseif fields.refresh then
|
||||||
|
modpol.interactions.org_dashboard(pname,org.name)
|
||||||
|
|
||||||
-- Put all dropdowns at the end
|
-- Put all dropdowns at the end
|
||||||
-- Receiving modules
|
-- Receiving modules
|
||||||
|
Loading…
x
Reference in New Issue
Block a user