liquid_feedback_frontend

view app/main/draft/new.lua @ 1142:eb1786614c5f

Removed not used files
author bsw
date Sat Mar 21 14:29:18 2015 +0100 (2015-03-21)
parents c6690fe0427d
children 904f6807f7fa
line source
1 local initiative = Initiative:by_id(param.get("initiative_id"))
2 initiative:load_everything_for_member_id(app.session.member_id)
3 initiative.issue:load_everything_for_member_id(app.session.member_id)
5 if initiative.issue.closed then
6 slot.put_into("error", _"This issue is already closed.")
7 return
8 elseif initiative.issue.half_frozen then
9 slot.put_into("error", _"This issue is already frozen.")
10 return
11 elseif initiative.issue.phase_finished then
12 slot.put_into("error", _"Current phase is already closed.")
13 return
14 end
17 execute.view{
18 module = "issue", view = "_head", params = {
19 issue = initiative.issue,
20 initiative = initiative
21 }
22 }
24 execute.view {
25 module = "issue", view = "_sidebar_issue",
26 params = {
27 issue = initiative.issue,
28 }
29 }
33 ui.form{
34 record = initiative.current_draft,
35 attr = { class = "vertical section" },
36 module = "draft",
37 action = "add",
38 params = { initiative_id = initiative.id },
39 routing = {
40 ok = {
41 mode = "redirect",
42 module = "initiative",
43 view = "show",
44 id = initiative.id
45 }
46 },
47 content = function()
49 ui.sectionHead( function()
50 ui.heading { level = 1, content = initiative.display_name }
51 end)
53 if param.get("preview") then
54 ui.sectionRow( function()
55 ui.field.hidden{ name = "formatting_engine", value = param.get("formatting_engine") }
56 ui.field.hidden{ name = "content", value = param.get("content") }
57 if config.enforce_formatting_engine then
58 formatting_engine = config.enforce_formatting_engine
59 else
60 formatting_engine = param.get("formatting_engine")
61 end
62 ui.container{
63 attr = { class = "draft" },
64 content = function()
65 slot.put(format.wiki_text(param.get("content"), formatting_engine))
66 end
67 }
69 slot.put("<br />")
70 ui.tag{
71 tag = "input",
72 attr = {
73 type = "submit",
74 class = "btn btn-default",
75 value = _'Publish now'
76 },
77 content = ""
78 }
79 slot.put("<br />")
80 slot.put("<br />")
82 ui.tag{
83 tag = "input",
84 attr = {
85 type = "submit",
86 name = "edit",
87 class = "btn-link",
88 value = _'Edit again'
89 },
90 content = ""
91 }
92 slot.put(" | ")
93 ui.link{
94 content = _"Cancel",
95 module = "initiative",
96 view = "show",
97 id = initiative.id
98 }
99 end )
101 else
102 ui.sectionRow( function()
103 execute.view{ module = "initiative", view = "_sidebar_wikisyntax" }
105 if not config.enforce_formatting_engine then
106 ui.field.select{
107 label = _"Wiki engine",
108 name = "formatting_engine",
109 foreign_records = config.formatting_engines,
110 attr = {id = "formatting_engine"},
111 foreign_id = "id",
112 foreign_name = "name"
113 }
114 end
116 ui.heading{ level = 2, content = _"Enter your proposal and/or reasons" }
118 ui.field.text{
119 name = "content",
120 multiline = true,
121 attr = { style = "height: 50ex; width: 100%;" },
122 value = param.get("content")
123 }
124 ui.tag{
125 tag = "input",
126 attr = {
127 type = "submit",
128 name = "preview",
129 class = "btn btn-default",
130 value = _'Preview'
131 },
132 content = ""
133 }
134 slot.put("<br />")
135 slot.put("<br />")
137 ui.link{
138 content = _"Cancel",
139 module = "initiative",
140 view = "show",
141 id = initiative.id
142 }
144 end )
145 end
146 end
147 }

Impressum / About Us