liquid_feedback_frontend
diff app/main/lf2/_issues.lua @ 217:73dbc9e2bfd4
Cummulative patch for enhancements at next generation frontend
author | bsw |
---|---|
date | Sat Mar 12 19:22:50 2011 +0100 (2011-03-12) |
parents | 4f6e6b213fb8 |
children |
line diff
1.1 --- a/app/main/lf2/_issues.lua Mon Mar 07 12:15:22 2011 +0100 1.2 +++ b/app/main/lf2/_issues.lua Sat Mar 12 19:22:50 2011 +0100 1.3 @@ -1,161 +1,5 @@ 1.4 local issues = param.get("issues", "table") 1.5 1.6 for i, issue in ipairs(issues) do 1.7 - local initiatives = issue.initiatives 1.8 - 1.9 - local interested_members = issue.interested_members 1.10 - 1.11 - -- prepare interest of current user 1.12 - local interest = issue.interest 1.13 - 1.14 - -- prepare trustees 1.15 - local trustees = Member:new_selector() 1.16 - :add_field("delegation_chain.*") 1.17 - :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, " .. tostring(issue.id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id") 1.18 - :add_order_by("index") 1.19 - :exec() 1.20 - 1.21 - local global_delegation 1.22 - local area_delegation 1.23 - local issue_delegation 1.24 - 1.25 - for i, delegation in ipairs(issue.outgoing_delegations) do 1.26 - if delegation.scope == "global" then global_delegation = delegation 1.27 - elseif delegation.scope == "area" then area_delegation = delegation 1.28 - elseif delegation.scope == "issue" then issue_delegation = delegation 1.29 - end 1.30 - end 1.31 - 1.32 - local delegation = issue_delegation or area_delegation or global_delegation 1.33 - 1.34 - local delegating_interest = issue.delegating_interest 1.35 - --[[ 1.36 - local current_delegating_interest = false 1.37 - 1.38 - for i, trustee in ipairs(trustees) do 1.39 - if i > 1 and trustee.participation then 1.40 - delegating_interest = true 1.41 - end 1.42 - end 1.43 - --]] 1.44 - local row_count = #initiatives + 3 1.45 - if #trustees > 1 then 1.46 - row_count = row_count + 1 1.47 - end 1.48 - 1.49 - ui.box{ class = "issue", row_count = row_count, content = function() 1.50 - 1.51 - ui.box_row{ class = "head2", content = function() 1.52 - 1.53 - ui.box_col{ class = "issue_id left head", content = function() 1.54 - ui.link{ 1.55 - module = "lf2", view = "issue", id = issue.id, 1.56 - content = _("Issue ##{id}", { id = issue.id }) 1.57 - } 1.58 - end } 1.59 - 1.60 - ui.box_col{ class = "policy_name right", content = function() 1.61 - ui.link{ 1.62 - module = "lf2", view = "policy", id = issue.policy_id, 1.63 - content = issue.policy.name 1.64 - } 1.65 - end } 1.66 - 1.67 - end } 1.68 - 1.69 - ui.box_row{ class = "head2", content = function() 1.70 - 1.71 - ui.box_col{ class = "state_name left", content = function() 1.72 - ui.tag{ content = issue.state_name } 1.73 - end } 1.74 - ui.box_col{ class = "state_time_left right", content = function() 1.75 - ui.tag{ content = issue.closed and _("since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left = issue.state_time_left }) } 1.76 - end } 1.77 - end } 1.78 - 1.79 - if #trustees > 1 then 1.80 - local class = "head" 1.81 - if not issue.closed and not issue.fully_frozen then 1.82 - class = "head2" 1.83 - end 1.84 - ui.box_row{ class = "head2", content = function() 1.85 - ui.box_col{ class = "left", content = function() 1.86 - execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small", issue_id = issue.id } } 1.87 - end } 1.88 - if not issue.closed and not issue.fully_frozen then 1.89 - if trustees[1].scope_out == "issue" then 1.90 - text = _"Change or revoke issue delegation" 1.91 - else 1.92 - text = _"Set issue delegation" 1.93 - end 1.94 - ui.box_col{ class = "right", content = function() 1.95 - ui.link{ 1.96 - text = text, 1.97 - module = "lf2", view = "delegation", params = { issue_id = issue.id } 1.98 - } 1.99 - end } 1.100 - end 1.101 - end } 1.102 - end 1.103 - 1.104 - if not issue.closed and not issue.fully_frozen then 1.105 - ui.box_row{ class = "head", content = function() 1.106 - ui.box_col{ class = "interest left", content = function() 1.107 - if interest then 1.108 - ui.image{ static = "lf2/icon_star.png" } 1.109 - if issue.close then 1.110 - slot.put(" ", _"You were interested in this issue") 1.111 - else 1.112 - slot.put(" ", _"You are interested in this issue") 1.113 - end 1.114 - elseif delegating_interest then 1.115 - ui.image{ static = "lf2/icon_delegated_star.png" } 1.116 - if issue.closed then 1.117 - slot.put(" ", _"Someone in your delegation chain was interested") 1.118 - else 1.119 - slot.put(" ", _"Someone in your delegation chain is interested") 1.120 - end 1.121 - elseif not issue.closed and not issue.fully_frozen then 1.122 - ui.link{ 1.123 - text = _"Add my interest", 1.124 - module = "interest", action = "update", params = { issue_id = issue.id }, 1.125 - routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.126 - } 1.127 - end 1.128 - end } 1.129 - 1.130 - ui.box_col{ class = "right", content = function() 1.131 - if interest then 1.132 - ui.link{ 1.133 - text = _"Remove interest", 1.134 - module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, 1.135 - routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.136 - } 1.137 - slot.put(" · ") 1.138 - elseif delegating_interest then 1.139 - ui.link{ 1.140 - text = _"Add my interest", 1.141 - module = "interest", action = "update", params = { issue_id = issue.id }, 1.142 - routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.143 - } 1.144 - slot.put(" · ") 1.145 - end 1.146 - if #trustees == 1 then 1.147 - ui.link{ 1.148 - text = _"Set issue delegation", 1.149 - module = "lf2", view = "delegation", params = { issue_id = issue.id } 1.150 - } 1.151 - end 1.152 - end } 1.153 - end } 1.154 - 1.155 - end 1.156 - 1.157 - for i, initiative in ipairs(issue.initiatives) do 1.158 - ui.box_row{ class = "initiative", content = function() ui.box_col { content = function() 1.159 - execute.view{ module = "lf2", view = "_initiative", params = { initiative = initiative } } 1.160 - end } end } 1.161 - end 1.162 - 1.163 - end } 1.164 -end 1.165 \ No newline at end of file 1.166 + execute.view{ module = "lf2", view = "_issue", params = { issue = issue, for_list = true } } 1.167 +end