liquid_feedback_frontend
diff app/main/admin/area_show.lua @ 0:3bfb2fcf7ab9
Version alpha1
author | bsw/jbe |
---|---|
date | Wed Nov 18 12:00:00 2009 +0100 (2009-11-18) |
parents | |
children | afd9f769c7ae |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/admin/area_show.lua Wed Nov 18 12:00:00 2009 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +local id = param.get_id() 1.5 + 1.6 +local area 1.7 +if id then 1.8 + area = Area:new_selector():add_where{ "id = ?", id }:single_object_mode():exec() 1.9 +end 1.10 + 1.11 +slot.put_into("title", _"Create new area") 1.12 + 1.13 +ui.form{ 1.14 + attr = { class = "vertical" }, 1.15 + record = area, 1.16 + module = "area", 1.17 + action = "update", 1.18 + routing = { 1.19 + default = { 1.20 + mode = "redirect", 1.21 + module = "admin", 1.22 + view = "area_list" 1.23 + } 1.24 + }, 1.25 + id = area and area.id or nil, 1.26 + content = function() 1.27 + ui.field.text{ label = _"Name", name = "name" } 1.28 + ui.field.boolean{ label = _"Active?", name = "active" } 1.29 + ui.field.text{ label = _"Description", name = "description", multiline = true } 1.30 + ui.submit{ text = _"Save" } 1.31 + end 1.32 +}