liquid_feedback_frontend
diff app/main/lf2/_issues.lua @ 215:1dab81353eb1
More enhancements for second generation frontend
| author | bsw |
|---|---|
| date | Sat Mar 05 15:34:17 2011 +0100 (2011-03-05) |
| parents | acf92c2d33f4 |
| children | 4f6e6b213fb8 |
line diff
1.1 --- a/app/main/lf2/_issues.lua Thu Mar 03 23:47:35 2011 +0100 1.2 +++ b/app/main/lf2/_issues.lua Sat Mar 05 15:34:17 2011 +0100 1.3 @@ -29,10 +29,23 @@ 1.4 local delegation = issue_delegation or area_delegation or global_delegation 1.5 1.6 local delegating_interest = issue.delegating_interest 1.7 + --[[ 1.8 + local current_delegating_interest = false 1.9 1.10 - ui.box{ class = "issue", content = function() 1.11 + for i, trustee in ipairs(trustees) do 1.12 + if i > 1 and trustee.participation then 1.13 + delegating_interest = true 1.14 + end 1.15 + end 1.16 + --]] 1.17 + local row_count = #initiatives + 3 1.18 + if #trustees > 1 then 1.19 + row_count = row_count + 1 1.20 + end 1.21 + 1.22 + ui.box{ class = "issue", row_count = row_count, content = function() 1.23 1.24 - ui.box_row{ class = "head", content = function() 1.25 + ui.box_row{ class = "head2", content = function() 1.26 1.27 ui.box_col{ class = "issue_id left head", content = function() 1.28 ui.link{ 1.29 @@ -50,7 +63,7 @@ 1.30 1.31 end } 1.32 1.33 - ui.box_row{ class = "head2", content = function() 1.34 + ui.box_row{ class = "head", content = function() 1.35 1.36 ui.box_col{ class = "state_name left", content = function() 1.37 ui.tag{ content = issue.state_name } 1.38 @@ -61,15 +74,19 @@ 1.39 end } 1.40 1.41 if #trustees > 1 then 1.42 - ui.box_row{ class = "head2", content = function() 1.43 + local class = "head2" 1.44 + if issue.closed or issue.fully_frozen then 1.45 + class = class .. " head2_last" 1.46 + end 1.47 + ui.box_row{ class = class, content = function() 1.48 ui.box_col{ class = "left", content = function() 1.49 execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } 1.50 end } 1.51 if not issue.closed and not issue.fully_frozen then 1.52 if trustees[1].scope_out == "issue" then 1.53 - text = _"Change or revoke issue delegation..." 1.54 + text = _"Change or revoke issue delegation" 1.55 else 1.56 - text = _"Set issue delegation..." 1.57 + text = _"Set issue delegation" 1.58 end 1.59 ui.box_col{ class = "right", content = function() 1.60 ui.link{ 1.61 @@ -81,28 +98,32 @@ 1.62 end } 1.63 end 1.64 1.65 - ui.box_row{ class = "head2", content = function() 1.66 - ui.box_col{ class = "interest left", content = function() 1.67 - if interest then 1.68 - ui.image{ static = "lf2/icon_star.png" } 1.69 - if issue.close then 1.70 - slot.put(" ", _"You were interested in this issue") 1.71 - else 1.72 - slot.put(" ", _"You are interested in this issue") 1.73 + if not issue.closed and not issue.fully_frozen then 1.74 + ui.box_row{ class = "head2 head2_last", content = function() 1.75 + ui.box_col{ class = "interest left", content = function() 1.76 + if interest then 1.77 + ui.image{ static = "lf2/icon_star.png" } 1.78 + if issue.close then 1.79 + slot.put(" ", _"You were interested in this issue") 1.80 + else 1.81 + slot.put(" ", _"You are interested in this issue") 1.82 + end 1.83 + elseif delegating_interest then 1.84 + ui.image{ static = "lf2/icon_delegated_star.png" } 1.85 + if issue.closed then 1.86 + slot.put(" ", _"Someone in your delegation chain was interested") 1.87 + else 1.88 + slot.put(" ", _"Someone in your delegation chain is interested") 1.89 + end 1.90 + elseif not issue.closed and not issue.fully_frozen then 1.91 + ui.link{ 1.92 + text = _"Add my interest", 1.93 + module = "interest", action = "update", params = { issue_id = issue.id }, 1.94 + routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.95 + } 1.96 end 1.97 - elseif delegating_interest then 1.98 - ui.image{ static = "lf2/icon_delegated_star.png" } 1.99 - if issue.closed then 1.100 - slot.put(" ", _"You were interested in this issue by delegation") 1.101 - else 1.102 - slot.put(" ", _"You are interested in this issue by delegation") 1.103 - end 1.104 - else 1.105 - slot.put(_"You are not interested in this issue") 1.106 - end 1.107 - end } 1.108 + end } 1.109 1.110 - if not issue.closed and not issue.fully_frozen then 1.111 ui.box_col{ class = "right", content = function() 1.112 if interest then 1.113 ui.link{ 1.114 @@ -110,24 +131,25 @@ 1.115 module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, 1.116 routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.117 } 1.118 - else 1.119 + slot.put(" · ") 1.120 + elseif delegating_interest then 1.121 ui.link{ 1.122 text = _"Add my interest", 1.123 module = "interest", action = "update", params = { issue_id = issue.id }, 1.124 routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } 1.125 } 1.126 + slot.put(" · ") 1.127 end 1.128 if #trustees == 1 then 1.129 - slot.put(" · ") 1.130 ui.link{ 1.131 - text = _"Set issue delegation...", 1.132 + text = _"Set issue delegation", 1.133 module = "lf2", view = "delegation", params = { issue_id = issue.id } 1.134 } 1.135 end 1.136 end } 1.137 - end 1.138 + end } 1.139 1.140 - end } 1.141 + end 1.142 1.143 for i, initiative in ipairs(issue.initiatives) do 1.144 ui.box_row{ class = "initiative", content = function() ui.box_col { content = function()