liquid_feedback_frontend

view app/main/delegation/new.lua @ 81:134fce4bede3

Cache for rendered wiki texts; Accountless API keys; Reverse id order for initiative API
- Support for caching html version of drafts
- Using pre-rendered html versions of help messages
- Added Support for api keys not connected to an account
- Added order option "id_desc" to initiative API
author bsw
date Sat Jul 24 17:22:05 2010 +0200 (2010-07-24)
parents 72c5e0ee7c98
children bf885faf3452
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 util.help("delegation.new.area")
5 end
7 local issue = Issue:by_id(param.get("issue_id", atom.integer))
8 if issue then
9 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)))
10 util.help("delegation.new.issue")
11 end
13 if not area and not issue then
14 slot.put_into("title", encode.html(_"Set global delegation"))
15 util.help("delegation.new.global")
16 end
18 slot.select("actions", function()
19 if issue then
20 ui.link{
21 module = "issue",
22 view = "show",
23 id = issue.id,
24 content = function()
25 ui.image{ static = "icons/16/cancel.png" }
26 slot.put(_"Cancel")
27 end,
28 }
29 elseif area then
30 ui.link{
31 module = "area",
32 view = "show",
33 id = area.id,
34 content = function()
35 ui.image{ static = "icons/16/cancel.png" }
36 slot.put(_"Cancel")
37 end,
38 }
39 else
40 ui.link{
41 module = "index",
42 view = "index",
43 content = function()
44 ui.image{ static = "icons/16/cancel.png" }
45 slot.put(_"Cancel")
46 end,
47 }
48 end
49 end)
53 local contact_members = Member:new_selector()
54 :add_where{ "contact.member_id = ?", app.session.member.id }
55 :join("contact", nil, "member.id = contact.other_member_id")
56 :add_order_by("member.name")
57 :exec()
60 ui.form{
61 attr = { class = "vertical" },
62 module = "delegation",
63 action = "update",
64 params = {
65 area_id = area and area.id or nil,
66 issue_id = issue and issue.id or nil,
67 },
68 routing = {
69 default = {
70 mode = "redirect",
71 module = area and "area" or issue and "issue" or "index",
72 view = (area or issue) and "show" or "index",
73 id = area and area.id or issue and issue.id or nil,
74 }
75 },
76 content = function()
77 local records = {
78 {
79 id = "-1",
80 name = _"No delegation"
81 }
82 }
83 for i, record in ipairs(contact_members) do
84 records[#records+1] = record
85 end
87 ui.field.select{
88 label = _"Trustee",
89 name = "trustee_id",
90 foreign_records = records,
91 foreign_id = "id",
92 foreign_name = "name",
93 }
94 ui.submit{ text = _"Save" }
95 end
96 }

Impressum / About Us