liquid_feedback_frontend

view app/main/delegation/new.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children 80c215dbf076
line source
1 local area = Area:by_id(param.get("area_id", atom.integer))
2 if area then
3 slot.put_into("title", encode.html(_"Set delegation for Area '#{name}'":gsub("#{name}", area.name)))
4 end
6 local issue = Issue:by_id(param.get("issue_id", atom.integer))
7 if issue then
8 slot.put_into("title", encode.html(_"Set delegation for Issue ##{number} in Area '#{area_name}'":gsub("#{number}", issue.id):gsub("#{area_name}", issue.area.name)))
9 end
12 local contact_members = Member:new_selector()
13 :add_where{ "contact.member_id = ?", app.session.member.id }
14 :join("contact", nil, "member.id = contact.other_member_id")
15 :add_order_by("member.login")
16 :exec()
19 ui.form{
20 attr = { class = "vertical" },
21 module = "delegation",
22 action = "update",
23 params = {
24 area_id = area and area.id or nil,
25 issue_id = issue and issue.id or nil,
26 },
27 routing = {
28 default = {
29 mode = "redirect",
30 module = area and "area" or "issue",
31 view = "show",
32 id = area and area.id or issue.id,
33 }
34 },
35 content = function()
36 ui.field.select{
37 label = _"Trustee",
38 name = "trustee_id",
39 foreign_records = contact_members,
40 foreign_id = "id",
41 foreign_name = "name"
42 }
43 ui.submit{ text = _"Save" }
44 end
45 }

Impressum / About Us