liquid_feedback_frontend

view app/main/issue/_list.lua @ 2:5c601807d397

Version alpha3

Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft

Wiki formatting for drafts

Showing differences between two drafts of the same initiative

Display of outgoing delegation chains

Many other improvements
author bsw
date Mon Nov 23 12:00:00 2009 +0100 (2009-11-23)
parents 3bfb2fcf7ab9
children afd9f769c7ae
line source
1 local issues_selector = param.get("issues_selector", "table")
4 ui.filter{
5 selector = issues_selector,
6 filters = {
7 {
8 type = "boolean",
9 name = "any",
10 label = _"Any",
11 selector_modifier = function() end
12 },
13 {
14 type = "boolean",
15 name = "new",
16 label = _"New",
17 selector_modifier = function(selector, value)
18 if value then
19 selector:add_where("issue.accepted ISNULL AND issue.closed ISNULL")
20 end
21 end
22 },
23 {
24 type = "boolean",
25 name = "accepted",
26 label = _"In discussion",
27 selector_modifier = function(selector, value)
28 if value then
29 selector:add_where("issue.accepted NOTNULL AND issue.half_frozen ISNULL AND issue.closed ISNULL")
30 end
31 end
32 },
33 {
34 type = "boolean",
35 name = "half_frozen",
36 label = _"Frozen",
37 selector_modifier = function(selector, value)
38 if value then
39 selector:add_where("issue.half_frozen NOTNULL AND issue.closed ISNULL")
40 end
41 end
42 },
43 {
44 type = "boolean",
45 name = "frozen",
46 label = _"Voting",
47 selector_modifier = function(selector, value)
48 if value then
49 selector:add_where("issue.fully_frozen NOTNULL AND issue.closed ISNULL")
50 end
51 end
52 },
53 {
54 type = "boolean",
55 name = "finished",
56 label = _"Finished",
57 selector_modifier = function(selector, value)
58 if value then
59 selector:add_where("issue.closed NOTNULL AND ranks_available")
60 end
61 end
62 },
63 {
64 type = "boolean",
65 name = "cancelled",
66 label = _"Cancelled",
67 selector_modifier = function(selector, value)
68 if value then
69 selector:add_where("issue.closed NOTNULL AND NOT ranks_available")
70 end
71 end
72 },
73 },
74 content = function()
75 ui.order{
76 name = "issue_list",
77 selector = issues_selector,
78 options = {
79 {
80 name = "population",
81 label = _"Population",
82 order_by = "issue.population DESC"
83 },
84 {
85 name = "newest",
86 label = _"Newest",
87 order_by = "issue.created DESC"
88 },
89 {
90 name = "oldest",
91 label = _"Oldest",
92 order_by = "issue.created"
93 }
94 },
95 content = function()
96 ui.paginate{
97 selector = issues_selector,
98 content = function()
99 local highlight_string = param.get("highlight_string", "string")
100 local issues = issues or issues_selector:exec()
101 -- issues:load(initiatives)
102 ui.list{
103 attr = { class = "issues" },
104 records = issues,
105 columns = {
106 {
107 label = _"Issue",
108 content = function(record)
109 if not param.get("for_area_list", atom.boolean) then
110 ui.field.text{
111 value = record.area.name
112 }
113 slot.put("<br />")
114 end
115 ui.link{
116 text = _"Issue ##{id}":gsub("#{id}", tostring(record.id)),
117 module = "issue",
118 view = "show",
119 id = record.id
120 }
121 if record.state == "new" then
122 ui.image{
123 static = "icons/16/new.png"
124 }
125 end
126 slot.put("<br />")
127 slot.put("<br />")
128 end
129 },
130 {
131 label = _"State",
132 content = function(record)
133 ui.field.issue_state{ value = record.state }
134 end
135 },
136 {
137 label = _"Initiatives",
138 content = function(record)
139 local initiatives_selector = record:get_reference_selector("initiatives")
140 local highlight_string = param.get("highlight_string")
141 if highlight_string then
142 initiatives_selector:add_field( {'"highlight"("initiative"."name", ?)', highlight_string }, "name_highlighted")
143 end
144 execute.view{
145 module = "initiative",
146 view = "_list",
147 params = {
148 issue = record,
149 initiatives_selector = initiatives_selector,
150 highlight_string = highlight_string,
151 limit = 3
152 }
153 }
154 end
155 },
156 }
157 }
158 end
159 }
160 end
161 }
162 end
163 }

Impressum / About Us