liquid_feedback_frontend
diff app/main/slideshow/_index.lua @ 1045:701a5cf6b067
Imported LiquidFeedback Frontend 3.0 branch
author | bsw |
---|---|
date | Thu Jul 10 01:19:48 2014 +0200 (2014-07-10) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/slideshow/_index.lua Thu Jul 10 01:19:48 2014 +0200 1.3 @@ -0,0 +1,64 @@ 1.4 +local unit = param.get( "unit", "table" ) 1.5 +local area = param.get( "area", "table" ) 1.6 + 1.7 +local args = { 1.8 + unit_id = unit and unit.id or nil, 1.9 + area_id = area and area.id or nil 1.10 +} 1.11 + 1.12 +local lastWinner = Initiative:getLastWinner( args ) 1.13 +local lastLooser = Initiative:getLastLoser( args ) 1.14 +local nextEndingVoting = Initiative:getNextEndingVoting( args ) 1.15 +local nextEndingVerification = Initiative:getNextEndingVerification( args ) 1.16 +local nextEndingDiscussion = Initiative:getNextEndingDiscussion( args ) 1.17 +local bestInAdmission = Initiative:getBestInAdmission( args ) 1.18 + 1.19 +local slides = { } 1.20 + 1.21 +if lastWinner then 1.22 + slides[#slides+1] = { 1.23 + title = _"Latest approved issue", 1.24 + initiative = lastWinner 1.25 + } 1.26 +end 1.27 + 1.28 +if lastLooser then 1.29 + slides[#slides+1] = { 1.30 + title = _"Latest disapproved issue", 1.31 + initiative = lastLooser 1.32 + } 1.33 +end 1.34 + 1.35 +if nextEndingVoting then 1.36 + slides[#slides+1] = { 1.37 + title = _("Voting #{time_info}", { time_info = nextEndingVoting.issue.state_time_text }), 1.38 + initiative = nextEndingVoting 1.39 + } 1.40 +end 1.41 + 1.42 +if nextEndingVerification then 1.43 + slides[#slides+1] = { 1.44 + title = _("Verification #{time_info}", { time_info = nextEndingVerification.issue.state_time_text }), 1.45 + initiative = nextEndingVerification 1.46 + } 1.47 +end 1.48 + 1.49 +if nextEndingDiscussion then 1.50 + slides[#slides+1] = { 1.51 + title = _("Discussion #{time_info}", { time_info = nextEndingDiscussion.issue.state_time_text }), 1.52 + initiative = nextEndingDiscussion 1.53 + } 1.54 +end 1.55 + 1.56 +if bestInAdmission then 1.57 + slides[#slides+1] = { 1.58 + title = _"Best not admitted initiative", 1.59 + initiative = bestInAdmission 1.60 + } 1.61 +end 1.62 + 1.63 +execute.view { 1.64 + module = "slideshow", view = "_slideshow", params = { 1.65 + slides = slides 1.66 + } 1.67 +}