liquid_feedback_frontend
diff app/main/suggestion/new.lua @ 1843:b01d9920371b
merge
| author | jbe |
|---|---|
| date | Thu Feb 03 15:57:22 2022 +0100 (2022-02-03) |
| parents | bee9e998fa4d |
| children |
line diff
1.1 --- a/app/main/suggestion/new.lua Thu Feb 03 15:54:23 2022 +0100 1.2 +++ b/app/main/suggestion/new.lua Thu Feb 03 15:57:22 2022 +0100 1.3 @@ -19,6 +19,12 @@ 1.4 view = "show", 1.5 id = initiative_id, 1.6 params = { tab = "suggestions" } 1.7 + }, 1.8 + error = { 1.9 + mode = "forward", 1.10 + module = "suggestion", 1.11 + view = "new", 1.12 + params = { initiative_id = initiative_id } 1.13 } 1.14 }, 1.15 attr = { class = "section vertical" }, 1.16 @@ -31,48 +37,15 @@ 1.17 value = _"You are currently not supporting this initiative directly. By adding suggestions to this initiative you will automatically become a potential supporter." 1.18 } 1.19 end 1.20 - ui.field.text{ label = _"A short title (80 chars max)", name = "name" } 1.21 - 1.22 - if not config.enforce_formatting_engine then 1.23 - ui.field.select{ 1.24 - label = _"Wiki engine", 1.25 - name = "formatting_engine", 1.26 - foreign_records = config.formatting_engines, 1.27 - attr = {id = "formatting_engine"}, 1.28 - foreign_id = "id", 1.29 - foreign_name = "name", 1.30 - value = param.get("formatting_engine") 1.31 + 1.32 + ui.container{ attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label mdl-card__fullwidth" }, content = function () 1.33 + ui.field.text{ 1.34 + attr = { id = "lf-initiative__name", class = "mdl-textfield__input" }, 1.35 + label_attr = { class = "mdl-textfield__label", ["for"] = "lf-initiative__name" }, 1.36 + label = _"A short title (80 chars max)", 1.37 + name = "name" 1.38 } 1.39 - ui.tag{ 1.40 - tag = "div", 1.41 - content = function() 1.42 - ui.tag{ 1.43 - tag = "label", 1.44 - attr = { class = "ui_field_label" }, 1.45 - content = function() slot.put(" ") end, 1.46 - } 1.47 - ui.tag{ 1.48 - content = function() 1.49 - ui.link{ 1.50 - text = _"Syntax help", 1.51 - module = "help", 1.52 - view = "show", 1.53 - id = "wikisyntax", 1.54 - attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} 1.55 - } 1.56 - slot.put(" ") 1.57 - ui.link{ 1.58 - text = _"(new window)", 1.59 - module = "help", 1.60 - view = "show", 1.61 - id = "wikisyntax", 1.62 - attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} 1.63 - } 1.64 - end 1.65 - } 1.66 - end 1.67 - } 1.68 - end 1.69 + end } 1.70 1.71 ui.field.text{ 1.72 label = _"Describe how the proposal and/or the reasons of the initiative could be improved", 1.73 @@ -92,7 +65,9 @@ 1.74 foreign_id = "id", 1.75 foreign_name = "name" 1.76 } 1.77 - 1.78 + 1.79 + slot.put("<br>") 1.80 + 1.81 ui.submit{ 1.82 attr = { class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored mdl-js-ripple-effect" }, 1.83 text = _"publish suggestion"