liquid_feedback_frontend
view 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 |
line source
1 local unit = param.get( "unit", "table" )
2 local area = param.get( "area", "table" )
4 local args = {
5 unit_id = unit and unit.id or nil,
6 area_id = area and area.id or nil
7 }
9 local lastWinner = Initiative:getLastWinner( args )
10 local lastLooser = Initiative:getLastLoser( args )
11 local nextEndingVoting = Initiative:getNextEndingVoting( args )
12 local nextEndingVerification = Initiative:getNextEndingVerification( args )
13 local nextEndingDiscussion = Initiative:getNextEndingDiscussion( args )
14 local bestInAdmission = Initiative:getBestInAdmission( args )
16 local slides = { }
18 if lastWinner then
19 slides[#slides+1] = {
20 title = _"Latest approved issue",
21 initiative = lastWinner
22 }
23 end
25 if lastLooser then
26 slides[#slides+1] = {
27 title = _"Latest disapproved issue",
28 initiative = lastLooser
29 }
30 end
32 if nextEndingVoting then
33 slides[#slides+1] = {
34 title = _("Voting #{time_info}", { time_info = nextEndingVoting.issue.state_time_text }),
35 initiative = nextEndingVoting
36 }
37 end
39 if nextEndingVerification then
40 slides[#slides+1] = {
41 title = _("Verification #{time_info}", { time_info = nextEndingVerification.issue.state_time_text }),
42 initiative = nextEndingVerification
43 }
44 end
46 if nextEndingDiscussion then
47 slides[#slides+1] = {
48 title = _("Discussion #{time_info}", { time_info = nextEndingDiscussion.issue.state_time_text }),
49 initiative = nextEndingDiscussion
50 }
51 end
53 if bestInAdmission then
54 slides[#slides+1] = {
55 title = _"Best not admitted initiative",
56 initiative = bestInAdmission
57 }
58 end
60 execute.view {
61 module = "slideshow", view = "_slideshow", params = {
62 slides = slides
63 }
64 }