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