liquid_feedback_frontend

view app/main/issue/_list.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children 5c601807d397
line source
1 local issues_selector = param.get("issues_selector", "table")
3 local paginate = ui.paginate
5 local issues
7 if not issues_selector then
8 issues = param.get("issues", "table")
9 paginate = function(args)
10 args.content()
11 end
12 end
14 ui.order{
15 name = "issue_list",
16 selector = issues_selector,
17 options = {
18 {
19 name = "population",
20 label = _"Population",
21 order_by = "issue.population DESC"
22 },
23 {
24 name = "newest",
25 label = _"Newest",
26 order_by = "issue.created DESC"
27 },
28 {
29 name = "oldest",
30 label = _"Oldest",
31 order_by = "issue.created"
32 }
33 },
34 content = function()
35 paginate{
36 selector = issues_selector,
37 content = function()
38 local highlight_string = param.get("highlight_string", "string")
39 ui.list{
40 attr = { class = "issues" },
41 records = issues or issues_selector:exec(),
42 columns = {
43 {
44 label = _"Issue",
45 content = function(record)
46 if not param.get("for_area_list", atom.boolean) then
47 ui.field.text{
48 value = record.area.name
49 }
50 slot.put("<br />")
51 end
52 ui.link{
53 text = _"Issue ##{id}":gsub("#{id}", tostring(record.id)),
54 module = "issue",
55 view = "show",
56 id = record.id
57 }
58 slot.put("<br />")
59 slot.put("<br />")
60 end
61 },
62 {
63 label = _"State",
64 content = function(record)
65 ui.field.issue_state{ value = record.state }
66 end
67 },
68 {
69 label = _"Initiatives",
70 content = function(record)
71 execute.view{
72 module = "initiative",
73 view = "_list",
74 params = {
75 issue = record,
76 initiatives_selector = record:get_reference_selector("initiatives"),
77 highlight_string = highlight_string,
78 limit = 3
79 }
80 }
81 end
82 },
83 }
84 }
86 end
87 }
88 end
89 }

Impressum / About Us