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