liquid_feedback_frontend

view app/main/initiative/new.lua @ 57:4f39f0a0d5b5

Listing of updated drafts on start page; Code cleanup; Minor bugfix

MOTD, initiator invite, issues to vote and listing of updated drafts shown as tabs on start page;
Bugfix: Initiator icon only shown when initiatorship has been accepted
author bsw
date Sat Apr 17 21:59:02 2010 +0200 (2010-04-17)
parents 88ac7798b562
children 3ec1dea6eefb
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 end
47 ui.tag{
48 tag = "div",
49 content = function()
50 ui.tag{
51 tag = "label",
52 attr = { class = "ui_field_label" },
53 content = function() slot.put("&nbsp;") end,
54 }
55 ui.tag{
56 content = function()
57 ui.link{
58 text = _"Information about the available policies",
59 module = "policy",
60 view = "list"
61 }
62 slot.put(" ")
63 ui.link{
64 attr = { target = "_blank" },
65 text = _"(new window)",
66 module = "policy",
67 view = "list"
68 }
69 end
70 }
71 end
72 }
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