liquid_feedback_frontend

view app/main/suggestion/new.lua @ 1781:c28ff4a85ded

Removed unused views
author bsw
date Tue Oct 19 14:45:36 2021 +0200 (2021-10-19)
parents 7dcbcbf492e3
children bee9e998fa4d
line source
1 local initiative_id = param.get("initiative_id")
3 ui.grid{ content = function()
5 ui.cell_main{ content = function()
6 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
7 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
8 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Add a new suggestion for improvement" }
9 end }
10 ui.container{ attr = { class = "mdl-card__content" }, content = function()
11 ui.form{
12 module = "suggestion",
13 action = "add",
14 params = { initiative_id = initiative_id },
15 routing = {
16 default = {
17 mode = "redirect",
18 module = "initiative",
19 view = "show",
20 id = initiative_id,
21 params = { tab = "suggestions" }
22 }
23 },
24 attr = { class = "section vertical" },
25 content = function()
27 local supported = Supporter:by_pk(initiative_id, app.session.member.id) and true or false
28 if not supported then
29 ui.field.text{
30 attr = { class = "warning" },
31 value = _"You are currently not supporting this initiative directly. By adding suggestions to this initiative you will automatically become a potential supporter."
32 }
33 end
34 ui.field.text{ label = _"A short title (80 chars max)", name = "name" }
36 ui.field.text{
37 label = _"Describe how the proposal and/or the reasons of the initiative could be improved",
38 name = "content",
39 multiline = true,
40 attr = { style = "height: 50ex;" },
41 value = param.get("content")
42 }
44 ui.field.select{
45 label = _"How important is your suggestions for you?",
46 name = "degree",
47 foreign_records = {
48 { id = 1, name = _"should be implemented"},
49 { id = 2, name = _"must be implemented"},
50 },
51 foreign_id = "id",
52 foreign_name = "name"
53 }
55 ui.submit{
56 attr = { class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored mdl-js-ripple-effect" },
57 text = _"publish suggestion"
58 }
59 slot.put(" ")
60 ui.link{
61 attr = { class = "mdl-button mdl-js-button" },
62 content = _"cancel",
63 module = "initiative",
64 view = "show",
65 id = initiative_id,
66 params = { tab = "suggestions" }
67 }
69 end
70 }
71 end }
72 end }
73 end }
74 end }

Impressum / About Us