diff 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
line wrap: on
line diff
--- a/sat_templates/templates/default/input/xmlui.html	Sun May 26 22:09:49 2019 +0200
+++ b/sat_templates/templates/default/input/xmlui.html	Wed Jun 12 09:13:42 2019 +0200
@@ -198,7 +198,8 @@
 
 {% macro string_widget(wid, config, id=none) %}
     {% if config.form %}
-        <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 }}>
+        <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 }}
+         {{ "readonly" if wid.read_only }} >
     {% else %}
         <div class="xmlui_widget xmlui_string"  {{ {'id':id}|xmlattr }}>
             {{- wid|item_filter(config.filters)|default('\u00A0',true) -}}