liquid_feedback_frontend

view app/main/delegation/new.lua @ 75:733f65c0c0a0

Bugfixes, feature enhancements, code-cleanup, and major work on API

Details:
- API
-- Allow relation name to be passed to helper function util.autoapi{...}
-- Added area API
-- Bugfixes in API
--- Correctly return initiatives (bug #162)
--- Correctly process "id" parameter for initiative API
--- Bugfix related to "state" parameter (bug #165)
--- Changed constant "discussion" to "accepted" (in model/issue.lua, used by API)
--- Fixed JSON encoding in auto_api (bug #181)
--- Ignore list filter "voted" in case of public access
--- Enable access to API without session
- Work on RSS feed (incomplete yet)
- Other bugfixes
-- Handle empty browser identification string
-- Handle invalid date in member/update.lua (bugs #24 #109 #115 #136)
-- Better handle errors while converting uploaded images. (bug #79 +5 duplicates)
-- Don't display revoked initiatives in list of new drafts (bug #134)
-- Fixed syntax error in app/main/member/_action/update_name.lua throwing unexpected error, when new name was too short
-- Do not display refresh support button for revoked initiatives
-- Repaired issue search (bug #150)
-- Fixed typos in german translation files
--- "initi(i)erte"
--- "Er(g)eignisse" (bug #161)
- Code cleanup
-- Removed deprecated motd files locale/motd/de.txt and locale/motd/de_public.txt
-- Removed redundant code in app/main/index/_updated_drafts.lua
- New features and (optical) enhancements
-- Support change of notify email; notification of not approved address added to start page
-- Settings dialog splitted into single pages
-- Mark deactivated members
-- Calendar for birthday selection in profile
-- Policy list public readable when public access is enabled
author bsw
date Thu Jul 08 18:44:02 2010 +0200 (2010-07-08)
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