liquid_feedback_frontend
diff app/main/lf2/_sidebar_unit.lua @ 215:1dab81353eb1
More enhancements for second generation frontend
author | bsw |
---|---|
date | Sat Mar 05 15:34:17 2011 +0100 (2011-03-05) |
parents | 3e4ad069847a |
children | 73dbc9e2bfd4 |
line diff
1.1 --- a/app/main/lf2/_sidebar_unit.lua Thu Mar 03 23:47:35 2011 +0100 1.2 +++ b/app/main/lf2/_sidebar_unit.lua Sat Mar 05 15:34:17 2011 +0100 1.3 @@ -1,4 +1,16 @@ 1.4 -local unit = param.get("unit", "table") 1.5 +local current_area_id = param.get("current_area_id", atom.integer) 1.6 +local current_phase = param.get_all_cgi()["phase"] 1.7 + 1.8 +local member_areas_selector = Area:build_selector{ 1.9 + member_id = app.session.member_id, 1.10 + order = "name" 1.11 +} 1.12 +local other_areas_selector = Area:build_selector{ 1.13 + not_member_id = app.session.member_id, 1.14 + order = "name" 1.15 +} 1.16 + 1.17 +local unit = {} 1.18 1.19 local trustees = Member:new_selector() 1.20 :add_field("delegation_chain.*") 1.21 @@ -6,7 +18,12 @@ 1.22 :add_order_by("index") 1.23 :exec() 1.24 1.25 -ui.box{ content = function() 1.26 +local row_count = member_areas_selector:count() + other_areas_selector:count() + 4 1.27 +if #trustees > 1 then 1.28 + row_count = row_count + 1 1.29 +end 1.30 + 1.31 +ui.box{ row_count = row_count, content = function() 1.32 ui.box_row{ class = "head", content = function() 1.33 ui.box_col{ class = "head", content = _"DE / Berlin / Friedrichshain-Kreuzberg" } 1.34 end } 1.35 @@ -19,9 +36,9 @@ 1.36 1.37 ui.box_row{ content = function() ui.box_col{ content = function() 1.38 if trustees[1].scope_out == "global" then 1.39 - text = _"Change or revoke unit delegation..." 1.40 + text = _"Change or revoke unit delegation" 1.41 else 1.42 - text = _"Set unit delegation..." 1.43 + text = _"Set unit delegation" 1.44 end 1.45 ui.link{ 1.46 text = text, 1.47 @@ -29,5 +46,38 @@ 1.48 } 1.49 end } end } 1.50 1.51 + 1.52 + ui.form{ 1.53 + method = "get", 1.54 + content = function() 1.55 + 1.56 + ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = function() 1.57 + ui.link{ text = _"Areas, you are member of", module = "lf2", view = "index" } 1.58 + end } end } 1.59 + 1.60 + execute.view{ 1.61 + module = "lf2", view = "_areas", params = { 1.62 + areas_selector = member_areas_selector, 1.63 + current_area_id = current_area_id, 1.64 + current_phase = current_phase 1.65 + } 1.66 + } 1.67 + 1.68 + ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = function() 1.69 + ui.link{ content = _"Other areas", module = "lf2", view = "index" } 1.70 + end } end } 1.71 + 1.72 + execute.view{ 1.73 + module = "lf2", view = "_areas", params = { 1.74 + areas_selector = other_areas_selector, 1.75 + current_area_id = current_area_id, 1.76 + current_phase = current_phase 1.77 + } 1.78 + } 1.79 + 1.80 + end 1.81 + } 1.82 + 1.83 end } 1.84 - 1.85 \ No newline at end of file 1.86 + 1.87 +execute.view{ module = "lf2", view = "_search", params = { area = area } }