Allow multiline text for group help
authorThierry Florac <thierry.florac@onf.fr>
Wed, 28 Jun 2017 16:43:10 +0200
changeset 54 08ac02a87bcd
parent 53 cbc14b9e67af
child 55 4cbe2708a397
Allow multiline text for group help
src/pyams_form/interfaces/form.py
src/pyams_form/templates/form.pt
src/pyams_form/templates/inner-form.pt
src/pyams_form/templates/widget-form.pt
--- a/src/pyams_form/interfaces/form.py	Tue Jun 27 13:30:32 2017 +0200
+++ b/src/pyams_form/interfaces/form.py	Wed Jun 28 16:43:10 2017 +0200
@@ -196,8 +196,8 @@
     legend = TextLine(title="Group legend",
                       required=False)
 
-    help = TextLine(title="Group help",
-                    required=False)
+    help = Text(title="Group help",
+                required=False)
 
     css_class = TextLine(title="CSS class",
                          required=False,
--- a/src/pyams_form/templates/form.pt	Tue Jun 27 13:30:32 2017 +0200
+++ b/src/pyams_form/templates/form.pt	Wed Jun 28 16:43:10 2017 +0200
@@ -76,9 +76,8 @@
 							</tal:if>
 							<tal:var define="help group.help" condition="help">
 								<div class="alert alert-info padding-5"
-									 tal:define="html import:pyams_utils.text.text_to_html;
-												 i18n_help html(request.localizer.translate(help));"
-									 tal:content="structure i18n_help"></div>
+									 tal:define="i18n_help request.localizer.translate(help);"
+									 tal:content="structure extension:html(i18n_help)"></div>
 							</tal:var>
 							<tal:loop repeat="widget group.visible_widgets">
 								<input type="hidden"
--- a/src/pyams_form/templates/inner-form.pt	Tue Jun 27 13:30:32 2017 +0200
+++ b/src/pyams_form/templates/inner-form.pt	Wed Jun 28 16:43:10 2017 +0200
@@ -59,9 +59,8 @@
 					</tal:if>
 					<tal:var define="help group.help" condition="help">
 						<div class="alert alert-info padding-5"
-							 tal:define="html import:pyams_utils.text.text_to_html;
-										 i18n_help html(request.localizer.translate(help));"
-							 tal:content="structure i18n_help"></div>
+							 tal:define="i18n_help request.localizer.translate(help);"
+							 tal:content="structure extension:html(i18n_help)"></div>
 					</tal:var>
 					<tal:loop repeat="widget group.visible_widgets">
 						<input type="hidden"
--- a/src/pyams_form/templates/widget-form.pt	Tue Jun 27 13:30:32 2017 +0200
+++ b/src/pyams_form/templates/widget-form.pt	Wed Jun 28 16:43:10 2017 +0200
@@ -58,9 +58,8 @@
 							</tal:if>
 							<tal:var define="help group.help" condition="help">
 								<div class="alert alert-info padding-5"
-									 tal:define="html import:pyams_utils.text.text_to_html;
-												 i18n_help html(request.localizer.translate(help));"
-									 tal:content="structure i18n_help"></div>
+									 tal:define="i18n_help request.localizer.translate(help);"
+									 tal:content="structure extension:html(i18n_help)"></div>
 							</tal:var>
 							<tal:loop repeat="widget group.visible_widgets">
 								<input type="hidden"