liquid_feedback_frontend
diff app/main/lf2/_sidebar_issue.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/_sidebar_issue.lua Thu Mar 03 23:47:35 2011 +0100 1.2 +++ b/app/main/lf2/_sidebar_issue.lua Sat Mar 05 15:34:17 2011 +0100 1.3 @@ -1,6 +1,8 @@ 1.4 local issue = param.get("issue", "table") 1.5 local initiative_id = param.get("initiative_id", atom.integer) 1.6 1.7 +local alternative_initiatives = param.get("alternative_initiatives", "table") 1.8 + 1.9 local initiatives = issue.initiatives 1.10 1.11 local interested_members_selector = Member:new_selector() 1.12 @@ -21,16 +23,9 @@ 1.13 1.14 ui.box{ class = "issue", content = function() 1.15 1.16 - ui.box_row{ class = "issue_id head", content = function() ui.box_col{ class = "head", content = function() 1.17 - ui.link{ 1.18 - module = "lf2", view = "issue", id = issue.id, 1.19 - content = _("Issue ##{id}", { id = issue.id }) 1.20 - } 1.21 - end } end } 1.22 - 1.23 ui.box_row{ class = "unit_name head2", content = function() ui.box_col{ content = function() 1.24 ui.link{ 1.25 - module = "lf2", view = "unit", id = 1, 1.26 + module = "lf2", view = "index", id = 1, 1.27 content = "DE / Berlin / Friedrichshain-Kreuzberg" 1.28 } 1.29 end } end } 1.30 @@ -42,6 +37,13 @@ 1.31 } 1.32 end } end } 1.33 1.34 + ui.box_row{ class = "issue_id head2", content = function() ui.box_col{ class = "head", content = function() 1.35 + ui.link{ 1.36 + module = "lf2", view = "issue", id = issue.id, 1.37 + content = _("Issue ##{id}", { id = issue.id }) 1.38 + } 1.39 + end } end } 1.40 + 1.41 ui.box_row{ class = "policy_name head2", content = function() ui.box_col{ content = function() 1.42 ui.link{ 1.43 module = "lf2", view = "policy", id = issue.policy_id, 1.44 @@ -49,7 +51,7 @@ 1.45 } 1.46 end } end } 1.47 1.48 - ui.box_row{ class = "time_left", content = function() 1.49 + ui.box_row{ class = "time_left head", content = function() 1.50 ui.box_col{ content = issue.closed and _("Closed since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left = issue.state_time_left }) } 1.51 end } 1.52 1.53 @@ -65,7 +67,7 @@ 1.54 if not issue.closed and not issue.fully_frozen then 1.55 ui.image{ static = "lf2/icon_star_grey.png" } 1.56 end 1.57 - slot.put(_"You are not interested in this issue") 1.58 + slot.put(" ", _"You are not interested in this issue") 1.59 end 1.60 1.61 if issue.closed then 1.62 @@ -117,13 +119,15 @@ 1.63 1.64 ui.box_row{ class = "delegation hoverbutton_container", content = function() ui.box_col{ content = function() 1.65 if trustees[1].scope_out then 1.66 + ui.image{ static = "lf2/icon_delegation.png" } 1.67 + slot.put(" ") 1.68 if trustees[1].disabled_out == false then 1.69 if trustees[1].scope_out == "issue" then 1.70 - slot.put(encode.html(_"You have delegated this issue")) 1.71 + slot.put(encode.html(_"Issue is delegated")) 1.72 elseif trustees[1].scope_out == "area" then 1.73 - slot.put(encode.html(_"You have delegated this area")) 1.74 + slot.put(encode.html(_"Area is delegated")) 1.75 elseif trustees[1].scope_out == "global" then 1.76 - slot.put(encode.html(_"You have delegated globally")) 1.77 + slot.put(encode.html(_"Unit wide delegated")) 1.78 end 1.79 else 1.80 if trustees[1].scope_out == "issue" then 1.81 @@ -144,14 +148,19 @@ 1.82 slot.put(" ", encode.html(_"This issue is closed")) 1.83 end } 1.84 end } 1.85 + elseif issue.fully_frozen then 1.86 + ui.container{ attr = { class = "hoverbutton noaction"}, content = function() 1.87 + ui.container{ attr = { class = "content"}, content = function() 1.88 + slot.put(" ", encode.html(_"This issue is in voting")) 1.89 + end } 1.90 + end } 1.91 else 1.92 - if #trustees > 1 then 1.93 + if #trustees > 1 and trustees[1].scope_out == "issue" then 1.94 ui.link{ 1.95 module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id }, 1.96 attr = { class = "hoverbutton red"}, content = function() 1.97 ui.container{ attr = { class = "content"}, content = function() 1.98 - ui.image{ static = "lf2/icon_delegation.png" } 1.99 - slot.put(" ", encode.html(_"Change issue delegation...")) 1.100 + slot.put(" ", encode.html(_"Change issue delegation")) 1.101 end } 1.102 end } 1.103 1.104 @@ -160,9 +169,7 @@ 1.105 module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id }, 1.106 attr = { class = "hoverbutton green"}, content = function() 1.107 ui.container{ attr = { class = "content"}, content = function() 1.108 - ui.image{ static = "lf2/icon_delegation.png" } 1.109 - slot.put(" ") 1.110 - slot.put(" ", encode.html(_"Set issue delegation...")) 1.111 + slot.put(" ", encode.html(_"Set issue delegation")) 1.112 1.113 end } 1.114 end } 1.115 @@ -178,4 +185,12 @@ 1.116 end } end } 1.117 end 1.118 1.119 + ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Initiatives in this issue" } end } 1.120 + ui.box_row{ class = "initiatives last", content = function() 1.121 + ui.box_col{ class = "scrolled", content = function() 1.122 + execute.view{ module = "lf2", view = "_issue_initiatives", params = { initiatives = alternative_initiatives, current_initiative_id = initiative_id } } 1.123 + end } 1.124 + end } 1.125 + 1.126 + 1.127 end }