liquid_feedback_frontend

view app/main/initiative/new.lua @ 5:afd9f769c7ae

Version beta1

Final voting with Schulze-Method is now possible

Many bug fixes and code cleanup

Registration with invite codes

More sort and filter options

Seperated display of "supporters" and "potential supporters"

Optical changes

Flood limit / initiative contigent is now checked by frontend

Neccessary changes to access core beta11
author bsw/jbe
date Fri Dec 25 12:00:00 2009 +0100 (2009-12-25)
parents 80c215dbf076
children 3941792e8be6
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 new 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 if issue_id then
31 ui.field.text{ label = _"Issue", value = issue_id }
32 else
33 ui.field.select{
34 label = _"Policy",
35 name = "policy_id",
36 foreign_records = Policy:new_selector():add_order_by("index"):exec(),
37 foreign_id = "id",
38 foreign_name = "name"
39 }
40 end
41 ui.field.text{ label = _"Name", name = "name" }
42 ui.field.text{ label = _"Discussion URL", name = "discussion_url" }
43 ui.field.select{
44 label = _"Wiki engine",
45 name = "formatting_engine",
46 foreign_records = {
47 { id = "rocketwiki", name = "RocketWiki" },
48 { id = "compat", name = _"Traditional wiki syntax" }
49 },
50 foreign_id = "id",
51 foreign_name = "name"
52 }
53 ui.field.text{ label = _"Draft", name = "draft", multiline = true, attr = { style = "height: 50ex;" } }
54 ui.submit{ text = _"Save" }
55 end
56 }

Impressum / About Us