From 465cd35a9eb25b3a535374826bd882eaa6e75ee7 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 24 Mar 2017 11:38:42 +0100 Subject: [PATCH] mvc: work around Phalcon volt scoping issue PR: https://forum.opnsense.org/index.php?topic=4860 See: https://github.com/phalcon/cphalcon/issues/12648 --- .../views/layout_partials/base_dialog.volt | 40 +++++++++--------- .../app/views/layout_partials/base_form.volt | 41 +++++++++---------- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt b/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt index 8226061ed..2d959e398 100644 --- a/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt +++ b/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt @@ -34,25 +34,6 @@ label : dialog label #} -{%- macro base_dialog_header(field) %} - - - -
- - - - - - - - - - - - -{%- endmacro %} - {# Volt templates in php7 have issues with scope sometimes, copy input values to make them more unique #} {% set base_dialog_id=id %} {% set base_dialog_fields=fields %} @@ -111,7 +92,26 @@ label : dialog label {% set allownew=false %} {% if field['type'] == 'header' %} {# close table and start new one with header #} - {{ base_dialog_header(field) }} + +{#- macro base_dialog_header(field) #} + +

{{field['label']}}

+
+
+ + + + + + + + + + + + +{#- endmacro #} + {% else %} {{ partial("layout_partials/form_input_tr",field)}} {% endif %} diff --git a/src/opnsense/mvc/app/views/layout_partials/base_form.volt b/src/opnsense/mvc/app/views/layout_partials/base_form.volt index 04b2e3e05..3194074c4 100644 --- a/src/opnsense/mvc/app/views/layout_partials/base_form.volt +++ b/src/opnsense/mvc/app/views/layout_partials/base_form.volt @@ -34,26 +34,6 @@ data_title : data-title to set on form #} -{# close table and reopen for new header#} -{%- macro base_dialog_header(field) %} - -

{{field['label']}}

-
-
- - - - - - - - - - - - -{%- endmacro %} - {# Find if there are help supported or advanced field on this page #} {% set base_form_id=id %} {% set help=false %} @@ -97,7 +77,26 @@ data_title : data-title to set on form {% for field in fields|default({})%} {% if field['type'] == 'header' %} {# close table and start new one with header #} - {{ base_dialog_header(field) }} + +{#- macro base_dialog_header(field) #} + +

{{field['label']}}

+
+
+ + + + + + + + + + + + +{#- endmacro #} + {% else %} {{ partial("layout_partials/form_input_tr",field)}} {% endif %}

{{field['label']}}