Updated templates
authorThierry Florac <thierry.florac@onf.fr>
Mon, 02 Jul 2018 08:48:46 +0200
changeset 124 61bc5e1a5aa0
parent 123 003340c016f2
child 125 3defe3953276
Updated templates
src/pyams_form/widget/templates/orderedselect-display.pt
src/pyams_form/widget/templates/orderedselect-input.pt
src/pyams_form/widget/templates/select-input.pt
--- a/src/pyams_form/widget/templates/orderedselect-display.pt	Thu Jun 28 08:35:56 2018 +0200
+++ b/src/pyams_form/widget/templates/orderedselect-display.pt	Mon Jul 02 08:48:46 2018 +0200
@@ -1,5 +1,5 @@
 <label class="input"
-	   tal:omit-tag="view/required" i18n:domain="pyams_security">
+	   tal:omit-tag="view/required" i18n:domain="pyams_form">
 	<div class="select2-parent"
 		 tal:omit-tag="view/required">
 		<select class="select2 ordered" disabled="disabled"
--- a/src/pyams_form/widget/templates/orderedselect-input.pt	Thu Jun 28 08:35:56 2018 +0200
+++ b/src/pyams_form/widget/templates/orderedselect-input.pt	Mon Jul 02 08:48:46 2018 +0200
@@ -1,5 +1,5 @@
 <label class="input bordered with-icon"
-	   tal:omit-tag="view/required" i18n:domain="pyams_security">
+	   tal:omit-tag="view/required" i18n:domain="pyams_form">
 	<i class="icon-append fa fa-trash-o text-primary hint opaque"
 		title="Clear selected values" i18n:attributes="title"
 		tal:omit-tag="view/required"
--- a/src/pyams_form/widget/templates/select-input.pt	Thu Jun 28 08:35:56 2018 +0200
+++ b/src/pyams_form/widget/templates/select-input.pt	Mon Jul 02 08:48:46 2018 +0200
@@ -1,30 +1,42 @@
-<select class="select2"
-		tal:attributes='id view/id;
-						name string:${view/name}:list;
-						class string:${view/klass} select2;
-						style view/style;
-						title view/title;
-						lang view/lang;
-						onclick view/onclick;
-						ondblclick view/ondblclick;
-						onmousedown view/onmousedown;
-						onmouseup view/onmouseup;
-						onmouseover view/onmouseover;
-						onmousemove view/onmousemove;
-						onmouseout view/onmouseout;
-						onkeypress view/onkeypress;
-						onkeydown view/onkeydown;
-						onkeyup view/onkeyup;
-						disabled view/disabled;
-						tabindex view/tabindex;
-						onfocus view/onfocus;
-						onblur view/onblur;
-						onchange view/onchange;
-						multiple view/multiple;
-						size view/size;
-						data-ams-data extension:object_data(view);'>
-	<option tal:repeat="entry view/items"
-			tal:attributes="value entry/value;
-						    selected python:entry['value'] in view.value;"
-			tal:content="python:view.get_content(entry) if hasattr(view, 'get_content') else entry['content']"></option>
-</select>
+<label class="input bordered with-icon"
+	   tal:omit-tag="view/required" i18n:domain="pyams_form">
+	<i class="icon-append fa fa-trash-o text-primary hint opaque"
+		title="Clear selected values" i18n:attributes="title"
+		tal:omit-tag="view/required"
+		data-ams-hint-gravity="se"
+		data-ams-click-handler="MyAMS.helpers.select2ClearSelection"
+		tal:attributes="data-ams-select2-target string:${view/name}:list"></i>
+	<div class="select2-parent"
+		 tal:omit-tag="view/required">
+		<select class="select2"
+				tal:attributes='id view/id;
+								name string:${view/name}:list;
+								class string:${view/klass} select2;
+								style view/style;
+								title view/title;
+								lang view/lang;
+								onclick view/onclick;
+								ondblclick view/ondblclick;
+								onmousedown view/onmousedown;
+								onmouseup view/onmouseup;
+								onmouseover view/onmouseover;
+								onmousemove view/onmousemove;
+								onmouseout view/onmouseout;
+								onkeypress view/onkeypress;
+								onkeydown view/onkeydown;
+								onkeyup view/onkeyup;
+								disabled view/disabled;
+								tabindex view/tabindex;
+								onfocus view/onfocus;
+								onblur view/onblur;
+								onchange view/onchange;
+								multiple view/multiple;
+								size view/size;
+								data-ams-data extension:object_data(view);'>
+			<option tal:repeat="entry view/items"
+					tal:attributes="value entry/value;
+									selected python:entry['value'] in view.value;"
+					tal:content="python:view.get_content(entry) if hasattr(view, 'get_content') else entry['content']"></option>
+		</select>
+	</div>
+</label>