bsw@31: function link_area(area) bsw@31: ui.link{ bsw@31: external = "", bsw@31: attr = { bsw@31: onclick = bsw@31: "openEl('area_" .. tostring(area.id) .. "');" .. bsw@31: "return(false);" bsw@31: }, bsw@31: content = function() bsw@31: ui.heading{ bsw@31: attr = { style = "background-color: #000; color: #fff;" }, bsw@31: content = area.name bsw@31: } bsw@31: end bsw@31: } bsw@31: end bsw@31: bsw@31: slot.set_layout("report") bsw@31: bsw@31: ui.form{ bsw@31: attr = { bsw@31: style = " float: right;", bsw@31: onsubmit = "openElDirect(); return(false);" bsw@31: }, bsw@31: content = function() bsw@31: slot.put("#") bsw@31: ui.tag{ bsw@31: tag = "input", bsw@31: attr = { bsw@31: id = "input_issue", bsw@31: type = "text", bsw@31: style = "width: 4em;" bsw@31: } bsw@31: } bsw@31: slot.put(".") bsw@31: ui.tag{ bsw@31: tag = "input", bsw@31: attr = { bsw@31: id = "input_initiative", bsw@31: type = "text", bsw@31: style = "width: 4em;" bsw@31: } bsw@31: } bsw@31: slot.put(" ") bsw@31: ui.tag{ bsw@31: tag = "input", bsw@31: attr = { bsw@31: type = "submit", bsw@31: value = "OK", bsw@31: } bsw@31: } bsw@31: end bsw@31: } bsw@31: bsw@31: ui.link{ bsw@31: external = "", bsw@31: attr = { bsw@31: onclick = "undo(); return(false);" bsw@31: }, bsw@31: text = _"Back" bsw@31: } bsw@31: bsw@31: slot.put(" ") bsw@31: bsw@31: ui.link{ bsw@31: external = "", bsw@31: text = _"Areas" bsw@31: } bsw@31: bsw@31: slot.put(" ") bsw@31: bsw@31: ui.link{ bsw@31: external = "", bsw@31: attr = { bsw@31: onclick = "openPrevIssue(); return(false);" bsw@31: }, bsw@31: text = "<< " .. _"Previous issue" bsw@31: } bsw@31: bsw@31: slot.put(" ") bsw@31: bsw@31: ui.link{ bsw@31: external = "", bsw@31: attr = { bsw@31: onclick = "openPrevInitiative(); return(false);" bsw@31: }, bsw@31: text = "< " .. _"Previous initiative" bsw@31: } bsw@31: bsw@31: slot.put(" ") bsw@31: bsw@31: ui.link{ bsw@31: external = "", bsw@31: attr = { bsw@31: onclick = "openNextInitiative(); return(false);" bsw@31: }, bsw@31: text = _"Next initiative" .. " >" bsw@31: } bsw@31: bsw@31: slot.put(" ") bsw@31: bsw@31: ui.link{ bsw@31: external = "", bsw@31: attr = { bsw@31: onclick = "openNextIssue(); return(false);" bsw@31: }, bsw@31: text = _"Next issue" .. " >>" bsw@31: } bsw@31: bsw@31: local areas = Area:new_selector():exec() bsw@31: bsw@31: bsw@31: ui.container{ bsw@31: attr = { id = "areas" }, bsw@31: content = function() bsw@31: for i, area in ipairs(areas) do bsw@31: link_area(area) bsw@31: end bsw@31: end bsw@31: } bsw@31: bsw@31: ui.script{ script = "openEl('areas')" } bsw@31: bsw@31: for i, area in ipairs(areas) do bsw@31: execute.view{ bsw@31: module = "report", bsw@31: view = "area", bsw@31: params = { area = area } bsw@31: } bsw@31: end