bsw@1045: local unit = param.get( "unit", "table" ) bsw@1045: local area = param.get( "area", "table" ) bsw@1045: bsw@1045: local args = { bsw@1045: unit_id = unit and unit.id or nil, bsw@1045: area_id = area and area.id or nil bsw@1045: } bsw@1045: bsw@1045: local lastWinner = Initiative:getLastWinner( args ) bsw@1045: local lastLooser = Initiative:getLastLoser( args ) bsw@1045: local nextEndingVoting = Initiative:getNextEndingVoting( args ) bsw@1045: local nextEndingVerification = Initiative:getNextEndingVerification( args ) bsw@1045: local nextEndingDiscussion = Initiative:getNextEndingDiscussion( args ) bsw@1045: local bestInAdmission = Initiative:getBestInAdmission( args ) bsw@1045: bsw@1045: local slides = { } bsw@1045: bsw@1045: if lastWinner then bsw@1045: slides[#slides+1] = { bsw@1045: title = _"Latest approved issue", bsw@1045: initiative = lastWinner bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if lastLooser then bsw@1045: slides[#slides+1] = { bsw@1045: title = _"Latest disapproved issue", bsw@1045: initiative = lastLooser bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if nextEndingVoting then bsw@1045: slides[#slides+1] = { bsw@1045: title = _("Voting #{time_info}", { time_info = nextEndingVoting.issue.state_time_text }), bsw@1045: initiative = nextEndingVoting bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if nextEndingVerification then bsw@1045: slides[#slides+1] = { bsw@1045: title = _("Verification #{time_info}", { time_info = nextEndingVerification.issue.state_time_text }), bsw@1045: initiative = nextEndingVerification bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if nextEndingDiscussion then bsw@1045: slides[#slides+1] = { bsw@1045: title = _("Discussion #{time_info}", { time_info = nextEndingDiscussion.issue.state_time_text }), bsw@1045: initiative = nextEndingDiscussion bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if bestInAdmission then bsw@1045: slides[#slides+1] = { bsw@1045: title = _"Best not admitted initiative", bsw@1045: initiative = bestInAdmission bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: execute.view { bsw@1045: module = "slideshow", view = "_slideshow", params = { bsw@1045: slides = slides bsw@1045: } bsw@1045: }