Mercurial > libervia-templates
diff sat_templates/templates/default/input/xmlui.html @ 169:4b5ad18f6ece
input (xmlui): added support for XHTMLBox
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 19 Jan 2019 11:46:13 +0100 |
parents | e9f0a4215e46 |
children | e03e085bf7e8 |
line wrap: on
line diff
--- a/sat_templates/templates/default/input/xmlui.html Fri Jan 11 21:49:55 2019 +0100 +++ b/sat_templates/templates/default/input/xmlui.html Sat Jan 19 11:46:13 2019 +0100 @@ -24,6 +24,8 @@ {{ string_widget(wid, config, id=id) }} {% elif wid.type == 'textbox' %} {{ textbox_widget(wid, config, id=id) }} + {% elif wid.type == 'xhtmlbox' %} + {{ xhtmlbox_widget(wid, config, id=id) }} {% elif wid.type == 'list' %} {{ list_widget(wid, config, id=id) }} {% endif %} @@ -216,6 +218,18 @@ {% endif %} {% endmacro%} +{% macro xhtmlbox_widget(wid, config, id=none) %} + {% if wid.read_only %} + <div class="xmlui_widget xmlui_xhtmlbox" {{ {'id':id}|xmlattr }}> + {{- wid|item_filter(config.filters) -}} + </div> + {% else %} + <textarea class="xmlui_widget xmlui_xhtmlbox" rows="10" cols="50" {{ {'name':wid.name, 'id':id}|dict_ext(config.attrs, wid.name)|xmlattr }}> + {{- wid|item_filter(config.filters) -}} + </textarea> + {% endif %} +{% endmacro%} + {% macro list_widget(wid, config, id=none) %} {% if config.form %} <select class="xmlui_widget xmlui_list" {{ {'name':wid.name, 'id':id}|dict_ext(config.attrs, wid.name)|xmlattr }}>