comparison sat_templates/templates/default/input/xmlui.html @ 205:e03e085bf7e8

input (xmlui): add "readonly" attribute in string_widget when suitable.
author Goffi <goffi@goffi.org>
date Wed, 12 Jun 2019 09:13:42 +0200
parents 4b5ad18f6ece
children 15db910a957a
comparison
equal deleted inserted replaced
204:e9bbf4462ea8 205:e03e085bf7e8
196 {% endif %} 196 {% endif %}
197 {% endmacro%} 197 {% endmacro%}
198 198
199 {% macro string_widget(wid, config, id=none) %} 199 {% macro string_widget(wid, config, id=none) %}
200 {% if config.form %} 200 {% if config.form %}
201 <input class="xmlui_widget xmlui_string" type="text" {{ {'name':wid.name, 'id':id, 'value':wid|item_filter(config.filters)}|dict_ext(config.attrs, wid.name)|xmlattr }}> 201 <input class="xmlui_widget xmlui_string" type="text" {{ {'name':wid.name, 'id':id, 'value':wid|item_filter(config.filters)}|dict_ext(config.attrs, wid.name)|xmlattr }}
202 {{ "readonly" if wid.read_only }} >
202 {% else %} 203 {% else %}
203 <div class="xmlui_widget xmlui_string" {{ {'id':id}|xmlattr }}> 204 <div class="xmlui_widget xmlui_string" {{ {'id':id}|xmlattr }}>
204 {{- wid|item_filter(config.filters)|default('\u00A0',true) -}} 205 {{- wid|item_filter(config.filters)|default('\u00A0',true) -}}
205 </div> 206 </div>
206 {% endif %} 207 {% endif %}