Added CSS class for form's help block
authorThierry Florac <thierry.florac@onf.fr>
Wed, 01 Jul 2015 10:11:48 +0200
changeset 21 47af200bdaf4
parent 20 e421b7c4281a
child 22 37a759137db5
Added CSS class for form's help block
src/pyams_form/templates/form.pt
src/pyams_form/templates/inner-form.pt
src/pyams_form/templates/widget-form.pt
--- a/src/pyams_form/templates/form.pt	Wed Jul 01 10:11:16 2015 +0200
+++ b/src/pyams_form/templates/form.pt	Wed Jul 01 10:11:48 2015 +0200
@@ -63,7 +63,7 @@
 														data-ams-switcher-state group.switcher_state;">Legend</legend>
 							</tal:if>
 							<tal:var define="help group.help" condition="help">
-								<div class=""
+								<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>
@@ -97,6 +97,16 @@
 								</tal:if>
 							</tal:loop>
 						</fieldset>
+						<div class="subforms"
+							 tal:condition="group.subforms">
+							<fieldset tal:define="title group.subforms_legend"
+									  tal:omit-tag="not:title">
+								<legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+								<tal:loop repeat="subform group.subforms">
+									<tal:var replace="structure subform.render()" />
+								</tal:loop>
+							</fieldset>
+						</div>
 					</tal:loop>
 					<div class="widgets-suffix"
 						 tal:define="suffix provider:widgets_suffix"
--- a/src/pyams_form/templates/inner-form.pt	Wed Jul 01 10:11:16 2015 +0200
+++ b/src/pyams_form/templates/inner-form.pt	Wed Jul 01 10:11:48 2015 +0200
@@ -23,7 +23,7 @@
 						  data-ams-warn-on-change view.warn_on_change;">
 		<fieldset tal:define="legend view.legend"
 				  tal:omit-tag="not:legend">
-			<legend tal:condition="legend">
+			<legend class="inner" tal:condition="legend">
 				<i tal:attributes="class view.icon_css_class | nothing"></i>
 				<tal:var content="legend">Legend</tal:var>
 			</legend>
@@ -54,7 +54,7 @@
 												data-ams-switcher-state group.switcher_state;">Legend</legend>
 					</tal:if>
 					<tal:var define="help group.help" condition="help">
-						<div class=""
+						<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>
@@ -88,6 +88,16 @@
 						</tal:if>
 					</tal:loop>
 				</fieldset>
+				<div class="subforms"
+					 tal:condition="group.subforms">
+					<fieldset tal:define="title group.subforms_legend"
+							  tal:omit-tag="not:title">
+						<legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+						<tal:loop repeat="subform group.subforms">
+							<tal:var replace="structure subform.render()" />
+						</tal:loop>
+					</fieldset>
+				</div>
 			</tal:loop>
 			<div class="widgets-suffix"
 				 tal:define="suffix provider:widgets_suffix"
--- a/src/pyams_form/templates/widget-form.pt	Wed Jul 01 10:11:16 2015 +0200
+++ b/src/pyams_form/templates/widget-form.pt	Wed Jul 01 10:11:48 2015 +0200
@@ -56,7 +56,7 @@
 														data-ams-switcher-state group.switcher_state;">Legend</legend>
 							</tal:if>
 							<tal:var define="help group.help" condition="help">
-								<div class=""
+								<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>
@@ -89,6 +89,16 @@
 									</div>
 								</tal:if>
 							</tal:loop>
+							<div class="subforms"
+								 tal:condition="group.subforms">
+								<fieldset tal:define="title group.subforms_legend"
+										  tal:omit-tag="not:title">
+									<legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+									<tal:loop repeat="subform group.subforms">
+										<tal:var replace="structure subform.render()" />
+									</tal:loop>
+								</fieldset>
+							</div>
 						</fieldset>
 					</tal:loop>
 					<div class="widgets-suffix"