liquid_feedback_frontend
diff app/main/delegation/new.lua @ 183:02197b85ca3b
Better texts for new delegation dialog
| author | bsw |
|---|---|
| date | Mon Nov 01 22:06:36 2010 +0100 (2010-11-01) |
| parents | 02aacb3dffe0 |
| children | 19fbc5c758b5 |
line diff
1.1 --- a/app/main/delegation/new.lua Mon Nov 01 22:01:45 2010 +0100 1.2 +++ b/app/main/delegation/new.lua Mon Nov 01 22:06:36 2010 +0100 1.3 @@ -79,26 +79,46 @@ 1.4 local records 1.5 1.6 if issue then 1.7 + local delegate_name = "" 1.8 + local scope = "no delegation set" 1.9 + local area_delegation = Delegation:by_pk(app.session.member_id, issue.area_id) 1.10 + if area_delegation then 1.11 + delegate_name = area_delegation.trustee.name 1.12 + scope = _"area" 1.13 + else 1.14 + local global_delegation = Delegation:by_pk(app.session.member_id) 1.15 + if global_delegation then 1.16 + delegate_name = global_delegation.trustee.name 1.17 + scope = _"global" 1.18 + end 1.19 + end 1.20 records = { 1.21 { 1.22 id = -1, 1.23 - name = _"Inherit delegation from area" 1.24 + name = _("Apply global or area delegation for this issue (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.25 }, 1.26 { 1.27 id = 0, 1.28 - name = _"No delegation (override area delegation)" 1.29 + name = _"Abandon global and area delegations for this issue" 1.30 }, 1.31 1.32 } 1.33 elseif area then 1.34 + local delegate_name = "" 1.35 + local scope = "no delegation set" 1.36 + local global_delegation = Delegation:by_pk(app.session.member_id) 1.37 + if global_delegation then 1.38 + delegate_name = global_delegation.trustee.name 1.39 + scope = _"global" 1.40 + end 1.41 records = { 1.42 { 1.43 id = -1, 1.44 - name = _"Inherit global delegation" 1.45 + name = _("Apply global delegation for this area (Currently: #{delegate_name} [#{scope}])", { delegate_name = delegate_name, scope = scope }) 1.46 }, 1.47 { 1.48 id = 0, 1.49 - name = _"No delegation (override global delegation)" 1.50 + name = _"Abandon global delegation for this area" 1.51 } 1.52 } 1.53 1.54 @@ -111,22 +131,22 @@ 1.55 } 1.56 1.57 end 1.58 - 1.59 + -- add saved members 1.60 + records[#records+1] = {id="_", name= "--- " .. _"Saved contacts" .. " ---"} 1.61 for i, record in ipairs(contact_members) do 1.62 records[#records+1] = record 1.63 end 1.64 - disabled_records = {} 1.65 -- add initiative authors 1.66 if initiative then 1.67 - records[#records+1] = {id="_", name=_"--- Initiators ---"} 1.68 - disabled_records["_"] = true 1.69 + records[#records+1] = {id="_", name= "--- " .. _"Initiators" .. " ---"} 1.70 for i,record in ipairs(initiative.initiators) do 1.71 - trace.debug(record) 1.72 - trace.debug(record.member.name) 1.73 records[#records+1] = record.member 1.74 end 1.75 end 1.76 1.77 + disabled_records = {} 1.78 + disabled_records["_"] = true 1.79 + 1.80 ui.field.select{ 1.81 label = _"Trustee", 1.82 name = "trustee_id",