Skip to content

Commit

Permalink
Merge branch 'release/2.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 17, 2017
2 parents 470425e + 1b65660 commit 01030a9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 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)

# v2.1.0
## 02/10/2017

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Form
version: 2.1.0
version: 2.1.1
description: Enables the forms handling
icon: check-square
author:
Expand Down
5 changes: 5 additions & 0 deletions languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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."
Expand Down
20 changes: 17 additions & 3 deletions templates/forms/default/data.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@
{% block field %}
<div>
{% block field_label %}
<strong>{{ field.label|t }}</strong>:
<strong>{{ field.label|t|e }}</strong>:
{% endblock %}

{% block field_value %}
{{ string(form.value(field.name ?? index))|nl2br }}
{% if field.type == 'checkboxes' %}
<ul>
{% for value in form.value(field.name) %}
<li>{{ field.options[value]|e }}</li>
{% endfor %}
</ul>
{% 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 %}
</div>
{% endblock %}

{% endif %}
{% endfor %}
{% endfor %}

0 comments on commit 01030a9

Please sign in to comment.