liquid_feedback_frontend
changeset 513:dbfde3c56790
Fixed error in admin/member_edit view
author | bsw |
---|---|
date | Thu Apr 12 00:10:54 2012 +0200 (2012-04-12) |
parents | d0e12e1b8761 |
children | 976d493106a1 |
files | app/main/admin/member_edit.lua app/main/admin/unit_list.lua |
line diff
1.1 --- a/app/main/admin/member_edit.lua Wed Apr 11 19:03:50 2012 +0200 1.2 +++ b/app/main/admin/member_edit.lua Thu Apr 12 00:10:54 2012 +0200 1.3 @@ -8,11 +8,15 @@ 1.4 slot.put_into("title", encode.html(_"Register new member")) 1.5 end 1.6 1.7 -local units = Unit:new_selector() 1.8 - :add_field("privilege.voting_right", "voting_right") 1.9 - :left_join("privilege", nil, { "privilege.member_id = ? AND privilege.unit_id = unit.id", member.id }) 1.10 - :exec() 1.11 +local units_selector = Unit:new_selector() 1.12 1.13 +if member then 1.14 + units_selector 1.15 + :left_join("privilege", nil, { "privilege.member_id = ? AND privilege.unit_id = unit.id", member.id }) 1.16 + :add_field("privilege.voting_right", "voting_right") 1.17 +end 1.18 + 1.19 +local units = units_selector:exec() 1.20 1.21 ui.form{ 1.22 attr = { class = "vertical" },
2.1 --- a/app/main/admin/unit_list.lua Wed Apr 11 19:03:50 2012 +0200 2.2 +++ b/app/main/admin/unit_list.lua Thu Apr 12 00:10:54 2012 +0200 2.3 @@ -16,8 +16,20 @@ 2.4 columns = { 2.5 { 2.6 label = "name", 2.7 + name = "name" 2.8 + }, 2.9 + { 2.10 content = function(unit) 2.11 - ui.link{ text = unit.name, module = "admin", view = "area_list", params = { unit_id = unit.id } } 2.12 + ui.link{ 2.13 + attr = { class = "action admin_only" }, 2.14 + text = _"Edit unit", 2.15 + module = "admin", view = "unit_edit", id = unit.id 2.16 + } 2.17 + ui.link{ 2.18 + attr = { class = "action admin_only" }, 2.19 + text = _"Edit areas", 2.20 + module = "admin", view = "area_list", params = { unit_id = unit.id } 2.21 + } 2.22 end 2.23 } 2.24 }