bsw/jbe@19: local initiative_id = param.get("initiative_id") bsw/jbe@19: bsw@1479: ui.grid{ content = function() bsw@1479: bsw@1479: ui.cell_main{ content = function() bsw@1479: ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() bsw@1479: ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() bsw@1479: ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Add a new suggestion for improvement" } bsw@1479: end } bsw@1479: ui.container{ attr = { class = "mdl-card__content" }, content = function() bsw@1479: ui.form{ bsw@1479: module = "suggestion", bsw@1479: action = "add", bsw@1479: params = { initiative_id = initiative_id }, bsw@1479: routing = { bsw@1479: default = { bsw@1479: mode = "redirect", bsw@1479: module = "initiative", bsw@1479: view = "show", bsw@1479: id = initiative_id, bsw@1479: params = { tab = "suggestions" } bsw@1479: } bsw@1479: }, bsw@1479: attr = { class = "section vertical" }, bsw@279: content = function() bsw@1479: bsw@1479: local supported = Supporter:by_pk(initiative_id, app.session.member.id) and true or false bsw@1479: if not supported then bsw@1479: ui.field.text{ bsw@1479: attr = { class = "warning" }, bsw@1479: value = _"You are currently not supporting this initiative directly. By adding suggestions to this initiative you will automatically become a potential supporter." bsw@1479: } bsw@1479: end bsw@1479: ui.field.text{ label = _"A short title (80 chars max)", name = "name" } bsw@1479: bsw@1479: if not config.enforce_formatting_engine then bsw@1479: ui.field.select{ bsw@1479: label = _"Wiki engine", bsw@1479: name = "formatting_engine", bsw@1479: foreign_records = config.formatting_engines, bsw@1479: attr = {id = "formatting_engine"}, bsw@1479: foreign_id = "id", bsw@1479: foreign_name = "name", bsw@1479: value = param.get("formatting_engine") bsw@1479: } bsw@1479: ui.tag{ bsw@1479: tag = "div", bsw@1479: content = function() bsw@1479: ui.tag{ bsw@1479: tag = "label", bsw@1479: attr = { class = "ui_field_label" }, bsw@1479: content = function() slot.put(" ") end, bsw@1479: } bsw@1479: ui.tag{ bsw@1479: content = function() bsw@1479: ui.link{ bsw@1479: text = _"Syntax help", bsw@1479: module = "help", bsw@1479: view = "show", bsw@1479: id = "wikisyntax", bsw@1479: attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} bsw@1479: } bsw@1479: slot.put(" ") bsw@1479: ui.link{ bsw@1479: text = _"(new window)", bsw@1479: module = "help", bsw@1479: view = "show", bsw@1479: id = "wikisyntax", bsw@1479: attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} bsw@1479: } bsw@1479: end bsw@1479: } bsw@1479: end bsw@1479: } bsw@1479: end bsw@1479: bsw@1479: ui.field.text{ bsw@1479: label = _"Describe how the proposal and/or the reasons of the initiative could be improved", bsw@1479: name = "content", bsw@1479: multiline = true, bsw@1479: attr = { style = "height: 50ex;" }, bsw@1479: value = param.get("content") bsw@279: } bsw@1479: bsw@1479: ui.field.select{ bsw@1479: label = _"How important is your suggestions for you?", bsw@1479: name = "degree", bsw@1479: foreign_records = { bsw@1479: { id = 1, name = _"should be implemented"}, bsw@1479: { id = 2, name = _"must be implemented"}, bsw@1479: }, bsw@1479: foreign_id = "id", bsw@1479: foreign_name = "name" bsw@279: } bsw@1479: bsw@1480: ui.submit{ bsw@1480: attr = { class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored mdl-js-ripple-effect" }, bsw@1480: text = _"publish suggestion" bsw@1480: } bsw@1479: slot.put(" ") bsw@1479: ui.link{ bsw@1480: attr = { class = "mdl-button mdl-js-button" }, bsw@1479: content = _"cancel", bsw@1479: module = "initiative", bsw@1479: view = "show", bsw@1479: id = initiative_id, bsw@1479: params = { tab = "suggestions" } bsw@1479: } bsw@1479: bsw@279: end bsw@279: } bsw@1479: end } bsw@1479: end } bsw@1479: end } bsw@1479: end }