liquid_feedback_frontend

annotate app/main/slideshow/_index.lua @ 1653:6a82661ea3cb

Same icon for canceled as for finished without winner
author bsw
date Fri Feb 12 17:35:21 2021 +0100 (2021-02-12)
parents 701a5cf6b067
children
rev   line source
bsw@1045 1 local unit = param.get( "unit", "table" )
bsw@1045 2 local area = param.get( "area", "table" )
bsw@1045 3
bsw@1045 4 local args = {
bsw@1045 5 unit_id = unit and unit.id or nil,
bsw@1045 6 area_id = area and area.id or nil
bsw@1045 7 }
bsw@1045 8
bsw@1045 9 local lastWinner = Initiative:getLastWinner( args )
bsw@1045 10 local lastLooser = Initiative:getLastLoser( args )
bsw@1045 11 local nextEndingVoting = Initiative:getNextEndingVoting( args )
bsw@1045 12 local nextEndingVerification = Initiative:getNextEndingVerification( args )
bsw@1045 13 local nextEndingDiscussion = Initiative:getNextEndingDiscussion( args )
bsw@1045 14 local bestInAdmission = Initiative:getBestInAdmission( args )
bsw@1045 15
bsw@1045 16 local slides = { }
bsw@1045 17
bsw@1045 18 if lastWinner then
bsw@1045 19 slides[#slides+1] = {
bsw@1045 20 title = _"Latest approved issue",
bsw@1045 21 initiative = lastWinner
bsw@1045 22 }
bsw@1045 23 end
bsw@1045 24
bsw@1045 25 if lastLooser then
bsw@1045 26 slides[#slides+1] = {
bsw@1045 27 title = _"Latest disapproved issue",
bsw@1045 28 initiative = lastLooser
bsw@1045 29 }
bsw@1045 30 end
bsw@1045 31
bsw@1045 32 if nextEndingVoting then
bsw@1045 33 slides[#slides+1] = {
bsw@1045 34 title = _("Voting #{time_info}", { time_info = nextEndingVoting.issue.state_time_text }),
bsw@1045 35 initiative = nextEndingVoting
bsw@1045 36 }
bsw@1045 37 end
bsw@1045 38
bsw@1045 39 if nextEndingVerification then
bsw@1045 40 slides[#slides+1] = {
bsw@1045 41 title = _("Verification #{time_info}", { time_info = nextEndingVerification.issue.state_time_text }),
bsw@1045 42 initiative = nextEndingVerification
bsw@1045 43 }
bsw@1045 44 end
bsw@1045 45
bsw@1045 46 if nextEndingDiscussion then
bsw@1045 47 slides[#slides+1] = {
bsw@1045 48 title = _("Discussion #{time_info}", { time_info = nextEndingDiscussion.issue.state_time_text }),
bsw@1045 49 initiative = nextEndingDiscussion
bsw@1045 50 }
bsw@1045 51 end
bsw@1045 52
bsw@1045 53 if bestInAdmission then
bsw@1045 54 slides[#slides+1] = {
bsw@1045 55 title = _"Best not admitted initiative",
bsw@1045 56 initiative = bestInAdmission
bsw@1045 57 }
bsw@1045 58 end
bsw@1045 59
bsw@1045 60 execute.view {
bsw@1045 61 module = "slideshow", view = "_slideshow", params = {
bsw@1045 62 slides = slides
bsw@1045 63 }
bsw@1045 64 }

Impressum / About Us