liquid_feedback_frontend
diff app/main/delegation/new.lua @ 264:1b8d51e21614
More unit support added
author | bsw |
---|---|
date | Tue Feb 07 18:32:18 2012 +0100 (2012-02-07) |
parents | e3613831cd1e |
children | 7196685f9dd7 |
line diff
1.1 --- a/app/main/delegation/new.lua Tue Feb 07 18:13:00 2012 +0100 1.2 +++ b/app/main/delegation/new.lua Tue Feb 07 18:32:18 2012 +0100 1.3 @@ -1,6 +1,6 @@ 1.4 local unit = Unit:by_id(param.get("unit_id", atom.integer)) 1.5 if unit then 1.6 - slot.put_into("title", encode.html(_"Set unit delegation")) 1.7 + slot.put_into("title", encode.html(config.single_unit_id and _"Set global delegation" or _"Set unit delegation")) 1.8 util.help("delegation.new.unit") 1.9 end 1.10 1.11 @@ -88,19 +88,21 @@ 1.12 local unit_delegation = Delegation:by_pk(app.session.member_id, issue.area.unit_id) 1.13 if unit_delegation then 1.14 delegate_name = unit_delegation.trustee.name 1.15 - scope = _"unit" 1.16 + scope = config.single_unit_id and _"global" or _"unit" 1.17 end 1.18 end 1.19 + local text_apply 1.20 + local text_abandon 1.21 + if config.single_unit_id then 1.22 + text_apply = _("Apply global or area delegation for this issue (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.23 + text_abandon = _"Abandon unit and area delegations for this issue" 1.24 + else 1.25 + text_apply = _("Apply unit or area delegation for this issue (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.26 + text_abandon = _"Abandon unit and area delegations for this issue" 1.27 + end 1.28 records = { 1.29 - { 1.30 - id = -1, 1.31 - name = _("Apply unit or area delegation for this issue (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.32 - }, 1.33 - { 1.34 - id = 0, 1.35 - name = _"Abandon unit and area delegations for this issue" 1.36 - }, 1.37 - 1.38 + { id = -1, name = text_apply }, 1.39 + { id = 0, name = text_abandom } 1.40 } 1.41 elseif area then 1.42 local delegate_name = "" 1.43 @@ -108,16 +110,25 @@ 1.44 local unit_delegation = Delegation:by_pk(app.session.member_id, area.unit_id) 1.45 if unit_delegation then 1.46 delegate_name = unit_delegation.trustee.name 1.47 - scope = _"unit" 1.48 + scope = config.single_unit_id and _"global" or _"unit" 1.49 + end 1.50 + local text_apply 1.51 + local text_abandon 1.52 + if config.single_unit_id then 1.53 + text_apply = _("Apply global delegation for this area (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.54 + text_abandon = _"Abandon global delegation for this area" 1.55 + else 1.56 + text_apply = _("Apply unit delegation for this area (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.57 + text_abandon = _"Abandon unit delegation for this area" 1.58 end 1.59 records = { 1.60 { 1.61 id = -1, 1.62 - name = _("Apply unit delegation for this area (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.63 + name = text_apply 1.64 }, 1.65 { 1.66 id = 0, 1.67 - name = _"Abandon unit delegation for this area" 1.68 + name = text_abandon 1.69 } 1.70 } 1.71