bsw/jbe@0: local issues_selector = param.get("issues_selector", "table") bsw/jbe@0: bsw/jbe@0: bsw@2: ui.filter{ bsw/jbe@0: selector = issues_selector, bsw@2: filters = { bsw@2: { bsw@2: type = "boolean", bsw@2: name = "any", bsw@2: label = _"Any", bsw@2: selector_modifier = function() end bsw@2: }, bsw/jbe@0: { bsw@2: type = "boolean", bsw@2: name = "new", bsw@2: label = _"New", bsw@2: selector_modifier = function(selector, value) bsw@2: if value then bsw@2: selector:add_where("issue.accepted ISNULL AND issue.closed ISNULL") bsw@2: end bsw@2: end bsw@2: }, bsw@2: { bsw@2: type = "boolean", bsw@2: name = "accepted", bsw@2: label = _"In discussion", bsw@2: selector_modifier = function(selector, value) bsw@2: if value then bsw@2: selector:add_where("issue.accepted NOTNULL AND issue.half_frozen ISNULL AND issue.closed ISNULL") bsw@2: end bsw@2: end bsw/jbe@0: }, bsw/jbe@0: { bsw@2: type = "boolean", bsw@2: name = "half_frozen", bsw@2: label = _"Frozen", bsw@2: selector_modifier = function(selector, value) bsw@2: if value then bsw@2: selector:add_where("issue.half_frozen NOTNULL AND issue.closed ISNULL") bsw@2: end bsw@2: end bsw@2: }, bsw@2: { bsw@2: type = "boolean", bsw@2: name = "frozen", bsw@2: label = _"Voting", bsw@2: selector_modifier = function(selector, value) bsw@2: if value then bsw@2: selector:add_where("issue.fully_frozen NOTNULL AND issue.closed ISNULL") bsw@2: end bsw@2: end bsw/jbe@0: }, bsw/jbe@0: { bsw@2: type = "boolean", bsw@2: name = "finished", bsw@2: label = _"Finished", bsw@2: selector_modifier = function(selector, value) bsw@2: if value then bsw@2: selector:add_where("issue.closed NOTNULL AND ranks_available") bsw@2: end bsw@2: end bsw@2: }, bsw@2: { bsw@2: type = "boolean", bsw@2: name = "cancelled", bsw@2: label = _"Cancelled", bsw@2: selector_modifier = function(selector, value) bsw@2: if value then bsw@2: selector:add_where("issue.closed NOTNULL AND NOT ranks_available") bsw@2: end bsw@2: end bsw@2: }, bsw/jbe@0: }, bsw/jbe@0: content = function() bsw@2: ui.order{ bsw@2: name = "issue_list", bsw/jbe@0: selector = issues_selector, bsw@2: options = { bsw@2: { bsw@2: name = "population", bsw@2: label = _"Population", bsw@2: order_by = "issue.population DESC" bsw@2: }, bsw@2: { bsw@2: name = "newest", bsw@2: label = _"Newest", bsw@2: order_by = "issue.created DESC" bsw@2: }, bsw@2: { bsw@2: name = "oldest", bsw@2: label = _"Oldest", bsw@2: order_by = "issue.created" bsw@2: } bsw@2: }, bsw/jbe@0: content = function() bsw@2: ui.paginate{ bsw@2: selector = issues_selector, bsw@2: content = function() bsw@2: local highlight_string = param.get("highlight_string", "string") bsw@2: local issues = issues or issues_selector:exec() bsw@2: -- issues:load(initiatives) bsw@2: ui.list{ bsw@2: attr = { class = "issues" }, bsw@2: records = issues, bsw@2: columns = { bsw@2: { bsw@2: label = _"Issue", bsw@2: content = function(record) bsw@2: if not param.get("for_area_list", atom.boolean) then bsw@2: ui.field.text{ bsw@2: value = record.area.name bsw@2: } bsw@2: slot.put("
") bsw@2: end bsw@2: ui.link{ bsw@2: text = _"Issue ##{id}":gsub("#{id}", tostring(record.id)), bsw@2: module = "issue", bsw@2: view = "show", bsw@2: id = record.id bsw@2: } bsw@2: if record.state == "new" then bsw@2: ui.image{ bsw@2: static = "icons/16/new.png" bsw@2: } bsw@2: end bsw@2: slot.put("
") bsw@2: slot.put("
") bsw@2: end bsw@2: }, bsw@2: { bsw@2: label = _"State", bsw@2: content = function(record) bsw@2: ui.field.issue_state{ value = record.state } bsw@2: end bsw@2: }, bsw@2: { bsw@2: label = _"Initiatives", bsw@2: content = function(record) bsw@2: local initiatives_selector = record:get_reference_selector("initiatives") bsw@2: local highlight_string = param.get("highlight_string") bsw@2: if highlight_string then bsw@2: initiatives_selector:add_field( {'"highlight"("initiative"."name", ?)', highlight_string }, "name_highlighted") bsw@2: end bsw@2: execute.view{ bsw@2: module = "initiative", bsw@2: view = "_list", bsw@2: params = { bsw@2: issue = record, bsw@2: initiatives_selector = initiatives_selector, bsw@2: highlight_string = highlight_string, bsw@2: limit = 3 bsw@2: } bsw@2: } bsw@2: end bsw@2: }, bsw@2: } bsw@2: } bsw@2: end bsw/jbe@0: } bsw/jbe@0: end bsw/jbe@0: } bsw/jbe@0: end bsw@2: }