From 0b329c3d79a10960c1eb77d495643ee4b76d8925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Roux?= Date: Thu, 23 Feb 2017 18:56:59 +0100 Subject: [PATCH 01/10] Extend buttons to support outerclasses (#124) --- templates/forms/default/form.html.twig | 34 ++++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/templates/forms/default/form.html.twig b/templates/forms/default/form.html.twig index 481d3923..8e6dd09a 100644 --- a/templates/forms/default/form.html.twig +++ b/templates/forms/default/form.html.twig @@ -49,22 +49,24 @@ {% endblock %} {% for button in form.buttons %} - {% if button.url %} - - {% endif %} - - {% if button.url %} - - {% endif %} +
+ {% if button.url %} + + {% endif %} + + {% if button.url %} + + {% endif %} +
{% endfor %} {% block inner_markup_buttons_end %} From 1a99030fe7ece1b1216c798aaeba43c7a1fc107f Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Sun, 26 Feb 2017 09:49:28 +0100 Subject: [PATCH 02/10] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 982f8017..8595fefa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#improved) * Better default output for select, checkbox and checkboxes fields in the form destination page and in the emails sent via form submit [#121](https://github.com/getgrav/grav-plugin-form/issues/121) + * Added the option to have outerclasses on buttons [#124](https://github.com/getgrav/grav-plugin-form/issues/124) # v2.1.0 ## 02/10/2017 From 597d9b74bd2d8455cc19983ffa94ad0aaecc06a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Roux?= Date: Tue, 28 Feb 2017 14:16:33 +0100 Subject: [PATCH 03/10] Added the ability to disable fields label (#126) --- templates/forms/default/field.html.twig | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/templates/forms/default/field.html.twig b/templates/forms/default/field.html.twig index 5b818898..b8d8d98f 100644 --- a/templates/forms/default/field.html.twig +++ b/templates/forms/default/field.html.twig @@ -7,18 +7,20 @@ {% block field %}
{% block contents %} -
- -
+ {% if field.label is not same as(false) %} +
+ +
+ {% endif %}
Date: Tue, 28 Feb 2017 14:17:51 +0100 Subject: [PATCH 04/10] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8595fefa..45606d89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#improved) * Better default output for select, checkbox and checkboxes fields in the form destination page and in the emails sent via form submit [#121](https://github.com/getgrav/grav-plugin-form/issues/121) * Added the option to have outerclasses on buttons [#124](https://github.com/getgrav/grav-plugin-form/issues/124) + * Added the option to disable fields label if not defined [#126](https://github.com/getgrav/grav-plugin-form/issues/126) # v2.1.0 ## 02/10/2017 From c9e67d309602af2874449a97e266f6e2e1a57368 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 8 Mar 2017 16:54:09 -0700 Subject: [PATCH 05/10] Added fieldset field #125 --- CHANGELOG.md | 6 ++++++ templates/forms/fields/fieldset/fieldset.html.twig | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 templates/forms/fields/fieldset/fieldset.html.twig diff --git a/CHANGELOG.md b/CHANGELOG.md index 45606d89..93080f59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v2.2.0 +## 03/xx/2017 + +1. [](#new) + * Added new `fieldset` form field [#125](https://github.com/getgrav/grav-plugin-form/issues/125) + # v2.1.1 ## 02/17/2017 diff --git a/templates/forms/fields/fieldset/fieldset.html.twig b/templates/forms/fields/fieldset/fieldset.html.twig new file mode 100644 index 00000000..36a30517 --- /dev/null +++ b/templates/forms/fields/fieldset/fieldset.html.twig @@ -0,0 +1,14 @@ +
+{% if field.legend %} + {% if grav.twig.twig.filters['tu'] is defined %}{{ field.legend|tu }}{% else %}{{ field.legend|t }}{% endif %} +{% endif %} + +{% if field.fields %} + {% for field in field.fields %} + {% if field.type %} + {% set value = data.value(field.name) %} + {% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %} + {% endif %} + {% endfor %} +{% endif %} +
\ No newline at end of file From 4d5e41aee731c3c35382a5df2fd5c7b57dbc4804 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 12 Mar 2017 16:18:54 -0600 Subject: [PATCH 06/10] New conditional field --- CHANGELOG.md | 1 + .../forms/fields/conditional/conditional.html.twig | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 templates/forms/fields/conditional/conditional.html.twig diff --git a/CHANGELOG.md b/CHANGELOG.md index 93080f59..8fb69b4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#new) * Added new `fieldset` form field [#125](https://github.com/getgrav/grav-plugin-form/issues/125) + * Added new `conditional form field` to show fields only if some `condition` is set # v2.1.1 ## 02/17/2017 diff --git a/templates/forms/fields/conditional/conditional.html.twig b/templates/forms/fields/conditional/conditional.html.twig new file mode 100644 index 00000000..25e83378 --- /dev/null +++ b/templates/forms/fields/conditional/conditional.html.twig @@ -0,0 +1,10 @@ +{% if evaluate(field.condition) == 'true' %} + {% if field.fields %} + {% for field in field.fields %} + {% if field.type %} + {% set value = data.value(field.name) %} + {% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} From f871d55338d0eb2d4cea7614852c559ef4aaa6d0 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 13 Mar 2017 11:13:25 -0600 Subject: [PATCH 07/10] Add 'inline' class --- templates/forms/fields/checkbox/checkbox.html.twig | 2 +- templates/forms/fields/radio/radio.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/forms/fields/checkbox/checkbox.html.twig b/templates/forms/fields/checkbox/checkbox.html.twig index e2270f0a..f7b53ce5 100644 --- a/templates/forms/fields/checkbox/checkbox.html.twig +++ b/templates/forms/fields/checkbox/checkbox.html.twig @@ -24,6 +24,6 @@ {% endblock %} /> - +
{% endblock %} diff --git a/templates/forms/fields/radio/radio.html.twig b/templates/forms/fields/radio/radio.html.twig index b4381d0a..5abf2630 100644 --- a/templates/forms/fields/radio/radio.html.twig +++ b/templates/forms/fields/radio/radio.html.twig @@ -16,7 +16,7 @@ {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %} {% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %} /> - + {% endfor %} {% endblock %} From 8af24fee1e4ac84e96d94a3ac35cfa82280e4ca0 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 13 Mar 2017 11:13:42 -0600 Subject: [PATCH 08/10] Added classes to conditional field --- templates/forms/fields/conditional/conditional.html.twig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/forms/fields/conditional/conditional.html.twig b/templates/forms/fields/conditional/conditional.html.twig index 25e83378..5cd861c2 100644 --- a/templates/forms/fields/conditional/conditional.html.twig +++ b/templates/forms/fields/conditional/conditional.html.twig @@ -1,4 +1,8 @@ {% if evaluate(field.condition) == 'true' %} + {% if field.classes %} +
+ {% endif %} + {% if field.fields %} {% for field in field.fields %} {% if field.type %} @@ -7,4 +11,8 @@ {% endif %} {% endfor %} {% endif %} + + {% if field.classes %} +
+ {% endif %} {% endif %} From 95bddef0d366f1ccec0811714b35d494c3d393b9 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 13 Mar 2017 18:19:09 -0600 Subject: [PATCH 09/10] updated changelog --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fb69b4e..3567f7d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,19 @@ # v2.2.0 -## 03/xx/2017 +## 03/13/2017 1. [](#new) * Added new `fieldset` form field [#125](https://github.com/getgrav/grav-plugin-form/issues/125) * Added new `conditional form field` to show fields only if some `condition` is set +1. [](#improved) + * Added the option to have outerclasses on buttons [#124](https://github.com/getgrav/grav-plugin-form/issues/124) + * Added the option to disable fields label if not defined [#126](https://github.com/getgrav/grav-plugin-form/issues/126) # v2.1.1 ## 02/17/2017 1. [](#improved) * Better default output for select, checkbox and checkboxes fields in the form destination page and in the emails sent via form submit [#121](https://github.com/getgrav/grav-plugin-form/issues/121) - * Added the option to have outerclasses on buttons [#124](https://github.com/getgrav/grav-plugin-form/issues/124) - * Added the option to disable fields label if not defined [#126](https://github.com/getgrav/grav-plugin-form/issues/126) + # v2.1.0 ## 02/10/2017 From 8f66393817b0d8b4d55f5dc03da38021ddcaca67 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 13 Mar 2017 18:19:46 -0600 Subject: [PATCH 10/10] Prepare for release --- blueprints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints.yaml b/blueprints.yaml index f12c2aea..192aef1a 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Form -version: 2.1.1 +version: 2.2.0 description: Enables the forms handling icon: check-square author: