From afa6eab9f5e86cff7300f793227c8422a745e6d1 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Tue, 14 Feb 2017 17:47:57 +0100 Subject: [PATCH 1/2] Fix #121 Better default output for select, checkbox and checkboxes fields in the form destination page and in the emails sent via form submit --- CHANGELOG.md | 6 ++++++ languages.yaml | 5 +++++ templates/forms/default/data.html.twig | 20 +++++++++++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95e60ca4..8a367e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v2.1.1 +## 02/xx/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) + # v2.1.0 ## 02/10/2017 diff --git a/languages.yaml b/languages.yaml index 92de2f4d..d57ef069 100644 --- a/languages.yaml +++ b/languages.yaml @@ -33,6 +33,8 @@ en: DROPZONE_REMOVE_FILE: "Remove file" DROPZONE_REMOVE_FILE_CONFIRMATION: 'Are you sure you want to delete this file?' DROPZONE_RESPONSE_ERROR: "Server responded with {{statusCode}} code." + YES: "Yes" + NO: "No" de: PLUGIN_FORM: @@ -138,6 +140,9 @@ it: ACCEPT: "Tipi di MIME Concessi" ACCEPT_HELP: "Una lista di tipi di MIME che sono permessi per l'upload" ERROR_VALIDATING_CAPTCHA: "Errore durante la validazione del Captcha" + YES: "Si" + NO: "No" + ro: PLUGIN_FORM: NOT_VALIDATED: "Formularul nu a fost validat. Unul sau mai multe câmpuri sunt goale." diff --git a/templates/forms/default/data.html.twig b/templates/forms/default/data.html.twig index 27d87cfd..e5186082 100644 --- a/templates/forms/default/data.html.twig +++ b/templates/forms/default/data.html.twig @@ -4,12 +4,26 @@ {% block field %}
{% block field_label %} - {{ field.label|t }}: + {{ field.label|t|e }}: {% endblock %} + {% block field_value %} - {{ string(form.value(field.name ?? index))|nl2br }} + {% if field.type == 'checkboxes' %} + + {% elseif field.type == 'checkbox' %} + {{ (form.value(field.name) == 1) ? "PLUGIN_FORM.YES"|t|e : "PLUGIN_FORM.NO"|t|e }} + {% elseif field.type == 'select' %} + {{ field.options[form.value(field.name)]|e }} + {% else %} + {{ string(form.value(field.name)|e)|nl2br }} + {% endif %} {% endblock %}
{% endblock %} + {% endif %} -{% endfor %} +{% endfor %} \ No newline at end of file From 1b65660da3fe7dc88d065882f98b6b8cb9b4f000 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 17 Feb 2017 12:00:13 -0700 Subject: [PATCH 2/2] Prepare for release --- CHANGELOG.md | 2 +- blueprints.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a367e41..982f8017 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v2.1.1 -## 02/xx/2017 +## 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) diff --git a/blueprints.yaml b/blueprints.yaml index 72f03e82..f12c2aea 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Form -version: 2.1.0 +version: 2.1.1 description: Enables the forms handling icon: check-square author: