Updated Select2 display widget
authorThierry Florac <tflorac@ulthar.net>
Tue, 19 Nov 2019 16:19:23 +0100
changeset 202 8a57f86f2d3f
parent 201 360cd5cb5e5d
child 203 ba372884335f
Updated Select2 display widget
src/pyams_form/widget/templates/select-display.pt
--- a/src/pyams_form/widget/templates/select-display.pt	Tue Oct 08 17:18:53 2019 +0200
+++ b/src/pyams_form/widget/templates/select-display.pt	Tue Nov 19 16:19:23 2019 +0100
@@ -1,7 +1,8 @@
 <label class="input bordered"
-	   tal:omit-tag="view/required" i18n:domain="pyams_form">
+	   tal:define="display_mode python:view.required or (view.mode == 'display')"
+	   tal:omit-tag="display_mode" i18n:domain="pyams_form">
 	<div class="select2-parent"
-		 tal:omit-tag="view/required">
+		 tal:omit-tag="display_mode">
 		<select class="select2" disabled="disabled"
 				tal:attributes='id view/id;
 								name string:${view/name}:list;