liquid_feedback_frontend

view app/main/supporter/_show_box.lua @ 725:344e5fdce8c9

Fixed public search, made draft history available again
author bsw
date Thu Jun 28 13:52:42 2012 +0200 (2012-06-28)
parents b1ba5d237b6d
children 2cfa41e89c15
line source
1 local initiative = param.get("initiative", "table") or Initiative:by_id(param.get_id())
4 local initiative = param.get("initiative", "table")
5 local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
7 local partial = {
8 routing = {
9 default = {
10 mode = "redirect",
11 module = "initiative",
12 view = "show_support",
13 id = initiative.id
14 }
15 }
16 }
18 local routing = {
19 default = {
20 mode = "redirect",
21 module = request.get_module(),
22 view = request.get_view(),
23 id = param.get_id_cgi(),
24 params = param.get_all_cgi()
25 }
26 }
28 if not initiative.issue.fully_frozen and not initiative.issue.closed then
29 if supporter then
30 if not supporter:has_critical_opinion() then
31 ui.tag{ content = function()
32 ui.image{
33 static = "icons/16/thumb_up_green.png"
34 }
35 if initiative.issue.closed then
36 slot.put(_"You were supporter")
37 else
38 slot.put(_"You are supporter")
39 end
40 end }
41 else
42 ui.tag{ attr = { class = "potential_supporter" }, content = function()
43 ui.image{
44 static = "icons/16/thumb_up.png"
45 }
46 if initiative.issue.closed then
47 slot.put(_"You were potential supporter")
48 else
49 slot.put(_"You are potential supporter")
50 end
51 end }
52 end
53 slot.put(" (")
54 ui.link{
55 text = _"Withdraw",
56 module = "initiative",
57 action = "remove_support",
58 id = initiative.id,
59 routing = routing,
60 partial = partial
61 }
62 slot.put(") ")
63 elseif not initiative.revoked and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id) then
64 local params = param.get_all_cgi()
65 params.dyn = nil
66 ui.link{
67 text = _"Support this initiative",
68 module = "initiative",
69 action = "add_support",
70 id = initiative.id,
71 routing = routing,
72 partial = partial
73 }
74 slot.put(" ")
75 end
76 end
80 if not initiative.issue.closed then
81 slot.put(" · ")
82 local ignored_initiative = IgnoredInitiative:by_pk(app.session.member.id, initiative.id)
83 if ignored_initiative then
84 ui.tag{
85 content = _"You have ignored this initiative"
86 }
87 ui.link{
88 text = _"Stop ignoring initiative",
89 module = "initiative",
90 action = "update_ignore",
91 id = initiative.id,
92 params = { delete = true },
93 routing = {
94 default = {
95 mode = "redirect",
96 module = request.get_module(),
97 view = request.get_view(),
98 id = param.get_id_cgi(),
99 params = param.get_all_cgi()
100 }
101 }
102 }
103 else
104 ui.link{
105 text = _"Ignore initiative",
106 module = "initiative",
107 action = "update_ignore",
108 id = initiative.id,
109 routing = {
110 default = {
111 mode = "redirect",
112 module = request.get_module(),
113 view = request.get_view(),
114 id = param.get_id_cgi(),
115 params = param.get_all_cgi()
116 }
117 }
118 }
119 end
120 end

Impressum / About Us