liquid_feedback_frontend
changeset 599:5dc5f923797b
Show link to unit in unit delegation entries in delegation list
author | bsw |
---|---|
date | Sun Jun 24 22:38:03 2012 +0200 (2012-06-24) |
parents | 9df26b41ace0 |
children | 2d2cd7c79372 |
files | app/main/delegation/_list.lua model/delegation.lua |
line diff
1.1 --- a/app/main/delegation/_list.lua Sun Jun 24 22:30:29 2012 +0200 1.2 +++ b/app/main/delegation/_list.lua Sun Jun 24 22:38:03 2012 +0200 1.3 @@ -7,13 +7,21 @@ 1.4 attr = { class = "delegation_scope" }, 1.5 content = function() 1.6 local area 1.7 + local unit 1.8 if delegation.issue then 1.9 area = delegation.issue.area 1.10 + elseif delegation.area then 1.11 + area = delegation.area 1.12 else 1.13 - area = delegation.area 1.14 + unit = delegation.unit 1.15 end 1.16 - if not area then 1.17 - ui.field.text{ value = _"Unit delegation" } 1.18 + if unit then 1.19 + ui.link{ 1.20 + content = _"Unit '#{name}'":gsub("#{name}", unit.name), 1.21 + module = "unit", 1.22 + view = "show", 1.23 + id = unit.id 1.24 + } 1.25 end 1.26 if area then 1.27 ui.link{
2.1 --- a/model/delegation.lua Sun Jun 24 22:30:29 2012 +0200 2.2 +++ b/model/delegation.lua Sun Jun 24 22:38:03 2012 +0200 2.3 @@ -19,6 +19,14 @@ 2.4 2.5 Delegation:add_reference{ 2.6 mode = 'm1', 2.7 + to = "Unit", 2.8 + this_key = 'unit_id', 2.9 + that_key = 'id', 2.10 + ref = 'unit', 2.11 +} 2.12 + 2.13 +Delegation:add_reference{ 2.14 + mode = 'm1', 2.15 to = "Area", 2.16 this_key = 'area_id', 2.17 that_key = 'id',