comparison 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
comparison
equal deleted inserted replaced
168:9e9ce1ae8b53 169:4b5ad18f6ece
22 {% elif wid.type == 'jid' %} 22 {% elif wid.type == 'jid' %}
23 {# TODO: proper JID widget #} 23 {# TODO: proper JID widget #}
24 {{ string_widget(wid, config, id=id) }} 24 {{ string_widget(wid, config, id=id) }}
25 {% elif wid.type == 'textbox' %} 25 {% elif wid.type == 'textbox' %}
26 {{ textbox_widget(wid, config, id=id) }} 26 {{ textbox_widget(wid, config, id=id) }}
27 {% elif wid.type == 'xhtmlbox' %}
28 {{ xhtmlbox_widget(wid, config, id=id) }}
27 {% elif wid.type == 'list' %} 29 {% elif wid.type == 'list' %}
28 {{ list_widget(wid, config, id=id) }} 30 {{ list_widget(wid, config, id=id) }}
29 {% endif %} 31 {% endif %}
30 {% endmacro %} 32 {% endmacro %}
31 33
214 {{- wid|item_filter(config.filters) -}} 216 {{- wid|item_filter(config.filters) -}}
215 </p> 217 </p>
216 {% endif %} 218 {% endif %}
217 {% endmacro%} 219 {% endmacro%}
218 220
221 {% macro xhtmlbox_widget(wid, config, id=none) %}
222 {% if wid.read_only %}
223 <div class="xmlui_widget xmlui_xhtmlbox" {{ {'id':id}|xmlattr }}>
224 {{- wid|item_filter(config.filters) -}}
225 </div>
226 {% else %}
227 <textarea class="xmlui_widget xmlui_xhtmlbox" rows="10" cols="50" {{ {'name':wid.name, 'id':id}|dict_ext(config.attrs, wid.name)|xmlattr }}>
228 {{- wid|item_filter(config.filters) -}}
229 </textarea>
230 {% endif %}
231 {% endmacro%}
232
219 {% macro list_widget(wid, config, id=none) %} 233 {% macro list_widget(wid, config, id=none) %}
220 {% if config.form %} 234 {% if config.form %}
221 <select class="xmlui_widget xmlui_list" {{ {'name':wid.name, 'id':id}|dict_ext(config.attrs, wid.name)|xmlattr }}> 235 <select class="xmlui_widget xmlui_list" {{ {'name':wid.name, 'id':id}|dict_ext(config.attrs, wid.name)|xmlattr }}>
222 {% for value,label in wid.options %} 236 {% for value,label in wid.options %}
223 <option {{ {'value':value}|xmlattr }} {{ 'selected' if value in wid.selected }}> 237 <option {{ {'value':value}|xmlattr }} {{ 'selected' if value in wid.selected }}>