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@1838: }, bsw@1838: error = { bsw@1838: mode = "forward", bsw@1838: module = "suggestion", bsw@1838: view = "new", bsw@1838: params = { initiative_id = initiative_id } 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@1838: bsw@1838: ui.container{ attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label mdl-card__fullwidth" }, content = function () bsw@1838: ui.field.text{ bsw@1838: attr = { id = "lf-initiative__name", class = "mdl-textfield__input" }, bsw@1838: label_attr = { class = "mdl-textfield__label", ["for"] = "lf-initiative__name" }, bsw@1838: label = _"A short title (80 chars max)", bsw@1838: name = "name" bsw@1838: } bsw@1838: end } bsw@1838: 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@1838: bsw@1838: slot.put("
") bsw@1838: 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 }