liquid_feedback_frontend

view app/main/initiative/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 3ec1dea6eefb
children 6a12fb7e4963
line source
1 local issue
2 local area
4 local issue_id = param.get("issue_id", atom.integer)
5 if issue_id then
6 issue = Issue:new_selector():add_where{"id=?",issue_id}:single_object_mode():exec()
7 area = issue.area
9 else
10 local area_id = param.get("area_id", atom.integer)
11 area = Area:new_selector():add_where{"id=?",area_id}:single_object_mode():exec()
12 end
14 if issue_id then
15 slot.put_into("title", _"Add alternative initiative to issue")
16 else
17 slot.put_into("title", _"Create new issue")
18 end
20 ui.form{
21 module = "initiative",
22 action = "create",
23 params = {
24 area_id = area.id,
25 issue_id = issue and issue.id or nil
26 },
27 attr = { class = "vertical" },
28 content = function()
29 ui.field.text{ label = _"Area", value = area.name }
30 slot.put("<br />")
31 if issue_id then
32 ui.field.text{ label = _"Issue", value = issue_id }
33 else
34 tmp = { { id = -1, name = _"Please choose a policy" } }
35 for i, allowed_policy in ipairs(area.allowed_policies) do
36 tmp[#tmp+1] = allowed_policy
37 end
38 ui.field.select{
39 label = _"Policy",
40 name = "policy_id",
41 foreign_records = tmp,
42 foreign_id = "id",
43 foreign_name = "name",
44 value = (area.default_policy or {}).id
45 }
46 ui.tag{
47 tag = "div",
48 content = function()
49 ui.tag{
50 tag = "label",
51 attr = { class = "ui_field_label" },
52 content = function() slot.put("&nbsp;") end,
53 }
54 ui.tag{
55 content = function()
56 ui.link{
57 text = _"Information about the available policies",
58 module = "policy",
59 view = "list"
60 }
61 slot.put(" ")
62 ui.link{
63 attr = { target = "_blank" },
64 text = _"(new window)",
65 module = "policy",
66 view = "list"
67 }
68 end
69 }
70 end
71 }
72 end
73 slot.put("<br />")
74 ui.field.text{ label = _"Title of initiative", name = "name" }
75 ui.field.text{ label = _"Discussion URL", name = "discussion_url" }
76 ui.field.select{
77 label = _"Wiki engine",
78 name = "formatting_engine",
79 foreign_records = {
80 { id = "rocketwiki", name = "RocketWiki" },
81 { id = "compat", name = _"Traditional wiki syntax" }
82 },
83 foreign_id = "id",
84 foreign_name = "name"
85 }
86 ui.field.text{ label = _"Draft", name = "draft", multiline = true, attr = { style = "height: 50ex;" } }
87 ui.submit{ text = _"Save" }
88 end
89 }

Impressum / About Us