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