liquid_feedback_frontend
diff app/main/lf2/_issues.lua @ 212:3e4ad069847a
Some more work at 2nd generation frontend code
| author | bsw |
|---|---|
| date | Thu Mar 03 18:39:00 2011 +0100 (2011-03-03) |
| parents | 4993b71b383f |
| children | acf92c2d33f4 |
line diff
1.1 --- a/app/main/lf2/_issues.lua Wed Mar 02 20:06:26 2011 +0100 1.2 +++ b/app/main/lf2/_issues.lua Thu Mar 03 18:39:00 2011 +0100 1.3 @@ -34,26 +34,14 @@ 1.4 1.5 ui.box_row{ class = "head", content = function() 1.6 1.7 - ui.box_col{ class = "issue_id left", content = function() 1.8 + ui.box_col{ class = "issue_id left head", content = function() 1.9 ui.link{ 1.10 module = "lf2", view = "issue", id = issue.id, 1.11 content = _("Issue ##{id}", { id = issue.id }) 1.12 } 1.13 end } 1.14 1.15 - ui.box_col{ class = "unit_name right", content = function() 1.16 - ui.link{ 1.17 - module = "lf2", view = "unit", id = 1, 1.18 - content = "Dummy unit name" 1.19 - } 1.20 - end } 1.21 - ui.box_col{ class = "area_name right clearright", content = function() 1.22 - ui.link{ 1.23 - module = "lf2", view = "area_name", id = issue.area_id, 1.24 - content = issue.area.name 1.25 - } 1.26 - end } 1.27 - ui.box_col{ class = "policy_name left clearleft first", content = function() 1.28 + ui.box_col{ class = "policy_name right", content = function() 1.29 ui.link{ 1.30 module = "lf2", view = "policy", id = issue.policy_id, 1.31 content = issue.policy.name 1.32 @@ -66,43 +54,80 @@ 1.33 1.34 ui.box_col{ class = "state_name left", content = function() 1.35 ui.tag{ content = issue.state_name } 1.36 - slot.put(" · ") 1.37 + end } 1.38 + ui.box_col{ class = "state_time_left right", content = function() 1.39 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.40 end } 1.41 end } 1.42 1.43 - if interest or delegation then 1.44 + if #trustees > 1 then 1.45 ui.box_row{ class = "head2", content = function() 1.46 - ui.box_col{ class = "interest left", content = function() 1.47 - if interest then 1.48 - ui.image{ static = "lf2/icon_star.png" } 1.49 - if issue.closed then 1.50 - slot.put(" ", _"You were interested in this issue") 1.51 - else 1.52 - slot.put(" ", _"You are interested in this issue") 1.53 - end 1.54 - elseif delegating_interest then 1.55 - ui.image{ static = "lf2/icon_delegated_star.png" } 1.56 - if issue.closed then 1.57 - slot.put(" ", _"You were interested in this issue by delegation") 1.58 - else 1.59 - slot.put(" ", _"You are interested in this issue by delegation") 1.60 - end 1.61 - elseif trustees then 1.62 - slot.put(_"You have delegated this issue") 1.63 + ui.box_col{ class = "left", content = function() 1.64 + execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } 1.65 + end } 1.66 + if not issue.closed and not issue.fully_frozen then 1.67 + if trustees[1].scope_out == "issue" then 1.68 + text = _"Change or revoke issue delegation..." 1.69 else 1.70 - slot.put(_"You are not interested in this issue") 1.71 - end 1.72 - end } 1.73 - -- TODO if delegation ist falsch 1.74 - if delegation then 1.75 - slot.put(tostring(delegation.id)) 1.76 - ui.box_col{ class = "delegation right", content = function() 1.77 - execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } 1.78 + text = _"Set issue delegation..." 1.79 + end 1.80 + ui.box_col{ class = "right", content = function() 1.81 + ui.link{ 1.82 + text = text, 1.83 + module = "lf2", view = "delegation", params = { issue_id = issue.id } 1.84 + } 1.85 end } 1.86 end 1.87 end } 1.88 end 1.89 + 1.90 + ui.box_row{ class = "head2", content = function() 1.91 + ui.box_col{ class = "interest left", content = function() 1.92 + if interest then 1.93 + ui.image{ static = "lf2/icon_star.png" } 1.94 + if issue.closed then 1.95 + slot.put(" ", _"You were interested in this issue") 1.96 + else 1.97 + slot.put(" ", _"You are interested in this issue") 1.98 + end 1.99 + elseif delegating_interest then 1.100 + ui.image{ static = "lf2/icon_delegated_star.png" } 1.101 + if issue.closed then 1.102 + slot.put(" ", _"You were interested in this issue by delegation") 1.103 + else 1.104 + slot.put(" ", _"You are interested in this issue by delegation") 1.105 + end 1.106 + else 1.107 + slot.put(_"You are not interested in this issue") 1.108 + end 1.109 + end } 1.110 + 1.111 + if not issue.closed and not issue.fully_frozen then 1.112 + ui.box_col{ class = "right", content = function() 1.113 + if interest then 1.114 + ui.link{ 1.115 + text = _"Remove interest", 1.116 + module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, 1.117 + routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.118 + } 1.119 + else 1.120 + ui.link{ 1.121 + text = _"Add my interest", 1.122 + module = "interest", action = "update", params = { issue_id = issue.id }, 1.123 + routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.124 + } 1.125 + end 1.126 + if #trustees == 1 then 1.127 + slot.put(" · ") 1.128 + ui.link{ 1.129 + text = _"Set issue delegation...", 1.130 + module = "lf2", view = "delegation", params = { issue_id = issue.id } 1.131 + } 1.132 + end 1.133 + end } 1.134 + end 1.135 + 1.136 + end } 1.137 1.138 for i, initiative in ipairs(issue.initiatives) do 1.139 ui.box_row{ class = "initiative", content = function() ui.box_col { content = function()