view_step.html

 1   <#--   ^																	-->
 2   <#--  / \ 																	-->
 3   <#-- / ! \  WARNING ! current_step_index error						        -->
 4   <#-- ----- 																	-->
 5   <#-- Please check that the module module-forms-breadcrumbaccordion 			-->
 6   <#-- is installed and active. Forms with the Theme paris.fr must 			-->
 7   <#-- have "module-forms-breadcrumbaccordion" selected in breadcrumb type 	-->
 8   <#assign hasSteps=true />
 9   <#assign doPrevAction='' />
 10   <#assign doNextAction='' />
 11   <#assign doSaveAction='' />
 12   <#assign labelNextAction='' />
 13   <#assign labelPrevAction='' />
 14   <#assign labelSaveAction='' />
 15   <#assign doSaveForBackUpAction='' />
 16   <#assign labelForBackUpAction='' />
 17   <#assign doResetBackUpAction='' />
 18   <#assign labelResetBackupAction='' />
 19   <input name="page" value="forms" type="hidden">
 20   <input name="id_form" value="${step.idForm}" type="hidden">
 21   <input type="hidden" name="token" value = "${token}">
 22   <#if step.initial && step.final >
 23   	<#assign hasSteps=false>
 24   </#if>
 25   <#if !step.initial >
 26   	<#assign doPrevAction='action_doReturnStep'>
 27   	<#assign labelPrevAction>#i18n{forms.step.previous}</#assign>
 28   </#if>
 29   <#if step.final>
 30   	<#assign labelSaveAction>#i18n{forms.step.save}</#assign>
 31   	<#if form.labelFinalButton?has_content>
 32   		<#assign labelSaveAction=form.labelFinalButton />
 33   	</#if>
 34   	<#if form.displaySummary>
 35   		<#assign doSaveAction='action_formResponseSummary' />
 36   		<#assign labelSaveAction>#i18n{forms.step.see.summary}</#assign>
 37   	<#else>
 38   		<#assign doSaveAction='action_doSaveResponse' />
 39   	</#if>
 40   <#else>
 41   	<#assign doNextAction='action_doSaveStep' />
 42   	<#assign labelNextAction>#i18n{forms.step.next}</#assign>
 43   </#if>
 44   <#if user?? >
 45   	<#assign doSaveForBackUpAction='action_doSaveForBackup' />
 46   	<#assign doResetBackUpAction='action_doResetBackup' />
 47   </#if>
 48   <#assign stepParams></#assign>
 49   <@cStepCurrent step=current_step_index title=step.title actionNextStep=doNextAction labelNextStep=labelNextAction actionPrevStep=doPrevAction labelPrevStep=labelPrevAction actionSaveStep=doSaveAction labelSaveStep=labelSaveAction actionSaveForBackUpStep=doSaveForBackUpAction labelForBackUpStep=labelForBackUpAction actionResetBackUpStep=doResetBackUpAction labelResetBackUpStep=labelResetBackUpAction showPrevStep=false hasSteps=hasSteps params=stepParams >
 50   ${stepContent}
 51   <#if display_captcha>
 52   	<@cCol class='12' class='step-group'>
 53   		<@input type='hidden' name='validate_captcha' value='1' />
 54   		<@cRow>
 55   			<@cCol class='col-12 col-sm-10 offset-sm-1 col-md-6 offset-md-3'>	
 56   				${captcha}
 57   			</@cCol>
 58   		</@cRow>
 59   	</@cCol>
 60   </#if>
 61   </@cStepCurrent>
 62   <script>
 63   $( function() {
 64   	$('.banner h1').html( '${form.title?js_string}' );
 65   	$('.breadcrumb-item.active').html('<span class="form-title">${form.title?js_string}</span> <span class="fas fa-angle-right mx-4"></span> ${step.title?js_string}');
 66   	<#if current_step_index gt 1 >
 67   	var current = document.querySelector('#current_step');
 68   	var y = current.offsetTop - 220;
 69   	window.scrollBy(0, y);
 70   	</#if>
 71   
 72   
 73   	/* Check if step-group has all field hidden due to conditionnal beahvior */
 74   	$(".step-group").each( function(){
 75   		var count_field = $(this).find( '.form-group').length,
 76   			count_cond =  $(this).find( 'div[class*="display_field_"]' ).length,
 77   			count_cond_visible = $(this).find( 'div[class*="display_field_"]:visible' ).length;
 78   		if( count_field == count_cond &&  count_cond > 0 &&  count_cond_visible==0 ){
 79   			$(this).toggle();
 80   			$(this).addClass('step-group-collapsible');
 81   		}
 82   	});
 83   });
 84   </script>