From d6fb630661af41be06531957d37f440c06d5cbb3 Mon Sep 17 00:00:00 2001 From: Ricardo Verdugo Date: Mon, 7 Dec 2020 21:00:47 +0000 Subject: [PATCH 1/5] added priority to form translations/config this avoids the fileuploader getting undefined strings when priority is low --- templates/forms/default/form.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/forms/default/form.html.twig b/templates/forms/default/form.html.twig index 31ad7ce3..2675b6c0 100644 --- a/templates/forms/default/form.html.twig +++ b/templates/forms/default/form.html.twig @@ -47,7 +47,7 @@ session_timeout: " ~ config.system.session.timeout ~ " }; window.GravForm.translations = Object.assign({}, window.GravForm.translations || {}, { PLUGIN_FORM: {} }); -", {'group': 'bottom', 'position': 'before'}) %} +", {'group': 'bottom', 'position': 'before', 'priority': 100}) %} {# Backwards Compatibility for block overrides #} {% set override_form_classes %} From cf227faf511978bf90a7bc934e9e2172f2cf445e Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 9 Dec 2020 19:56:31 +0100 Subject: [PATCH 2/5] Fix admin access check (#463) https://github.com/getgrav/grav-plugin-form/pull/459#issuecomment-738880137 --- templates/forms/fields/section/section.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/forms/fields/section/section.html.twig b/templates/forms/fields/section/section.html.twig index 9cbe615f..d3e9fe05 100644 --- a/templates/forms/fields/section/section.html.twig +++ b/templates/forms/fields/section/section.html.twig @@ -1,5 +1,5 @@ {% extends "forms/field.html.twig" %} -{% set title_level = grav.user.access.admin.login ? 'h1' : field.title_level|default('h3') %} +{% set title_level = grav['admin'] is defined ? 'h1' : field.title_level|default('h3') %} {% block field %} {% if field.security is empty or authorize(array(field.security)) %} From 395438fba8defa3d7a0a3211796fe14c558924fd Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 11 Dec 2020 18:33:19 -0700 Subject: [PATCH 3/5] =?UTF-8?q?Added=20a=20new=20=E2=80=98condition?= =?UTF-8?q?=E2=80=99=20attribute=20for=20tab=20for=20logic=20to=20process?= =?UTF-8?q?=20if=20it=20should=20display=20or=20not?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/forms/fields/tabs/tabs.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/forms/fields/tabs/tabs.html.twig b/templates/forms/fields/tabs/tabs.html.twig index 5756abd1..b85f2a16 100644 --- a/templates/forms/fields/tabs/tabs.html.twig +++ b/templates/forms/fields/tabs/tabs.html.twig @@ -43,7 +43,7 @@
{% for tab in tabs %} - {% if tab.type == 'tab' %} + {% if tab.type == 'tab' and (tab.condition is null or tab.condition == true) %} {{ tab.title|t }} {% endif %} From 29ec1f1bcb998305d43275496b3d5e06bcd525d4 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 11 Dec 2020 18:52:03 -0700 Subject: [PATCH 4/5] updated changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ac76c6e..aace2800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# v4.2.1 +## mm/dd/2020 + +1. [](#new) + * Added a new ‘condition’ attribute for tab for logic to process if it should display or not +1. [](#improved) + * Added priority to form translations/config +1. [](#bugfix) + * Fix admin access check [#463](https://github.com/getgrav/grav-plugin-form/pull/463) + + # v4.2.0 ## 12/02/2020 From 79ae3bf13cbc27d6240eb411ddcde26023586e60 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 14 Dec 2020 21:17:55 -0700 Subject: [PATCH 5/5] prepare for release --- CHANGELOG.md | 4 ++-- blueprints.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aace2800..fc69efa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -# v4.2.1 -## mm/dd/2020 +# v4.3.0 +## 12/14/2020 1. [](#new) * Added a new ‘condition’ attribute for tab for logic to process if it should display or not diff --git a/blueprints.yaml b/blueprints.yaml index 45d30520..0be6e058 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Form slug: form type: plugin -version: 4.2.0 +version: 4.3.0 testing: false description: Enables the forms handling icon: check-square