annotate app/main/lf2/_initiative_support.lua @ 291:71eed60f6a41
Closed branch of experimental frontend
author |
jbe |
date |
Sat Feb 25 15:56:55 2012 +0100 (2012-02-25) |
parents |
7ea52c710503 |
children |
|
rev |
line source |
bsw@215
|
1 local initiative = param.get("initiative", "table")
|
bsw@215
|
2 local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
|
bsw@215
|
3
|
bsw@215
|
4 local routing = {
|
bsw@215
|
5 default = {
|
bsw@215
|
6 mode = "redirect",
|
bsw@215
|
7 module = "lf2",
|
bsw@215
|
8 view = "initiative",
|
bsw@215
|
9 id = initiative.id
|
bsw@215
|
10 }
|
bsw@215
|
11 }
|
bsw@215
|
12
|
bsw@215
|
13 if not initiative.issue.fully_frozen and not initiative.issue.closed then
|
bsw@215
|
14 ui.box_row{ content = function()
|
bsw@215
|
15 if supporter then
|
bsw@215
|
16 ui.box_col{ class = "left", content = function()
|
bsw@215
|
17 if not supporter:has_critical_opinion() then
|
bsw@215
|
18 ui.image{ static = "lf2/icon_star.png" }
|
bsw@215
|
19 slot.put(" ")
|
bsw@215
|
20 ui.tag{ content = _"Your are supporter" }
|
bsw@215
|
21 else
|
bsw@215
|
22 ui.image{ static = "lf2/icon_star.png" }
|
bsw@215
|
23 slot.put(" ")
|
bsw@215
|
24 ui.tag{ content = _"Your are potential supporter" }
|
bsw@215
|
25 end
|
bsw@218
|
26 slot.put(" · ")
|
bsw@215
|
27 ui.link{
|
bsw@218
|
28 text = _"revoke",
|
bsw@215
|
29 module = "initiative",
|
bsw@215
|
30 action = "remove_support",
|
bsw@215
|
31 id = initiative.id,
|
bsw@215
|
32 routing = routing,
|
bsw@215
|
33 }
|
bsw@215
|
34 end }
|
bsw@215
|
35 elseif not initiative.revoked then
|
bsw@215
|
36 ui.box_col{ content = function()
|
bsw@215
|
37 ui.image{ static = "lf2/icon_star_grey.png" }
|
bsw@215
|
38 slot.put(" ")
|
bsw@215
|
39 ui.link{
|
bsw@215
|
40 text = _"Support this initiative",
|
bsw@215
|
41 module = "initiative",
|
bsw@215
|
42 action = "add_support",
|
bsw@215
|
43 id = initiative.id,
|
bsw@215
|
44 routing = routing
|
bsw@215
|
45 }
|
bsw@215
|
46 end }
|
bsw@215
|
47 end
|
bsw@215
|
48 end }
|
bsw@215
|
49 end
|
bsw@215
|
50
|