-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # CHANGELOG.md
- Loading branch information
Showing
12 changed files
with
136 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
{% if form_json_response %} | ||
{{ form_json_response|json_encode|raw }} | ||
{% else %} | ||
{} | ||
{% endif %} | ||
{% extends 'forms/ajax.json.twig' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if form_json_response %} | ||
{{ form_json_response|json_encode|raw }} | ||
{% else %} | ||
{} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
{% for index, field in form.fields %} | ||
{% set input = attribute(field, "input@") %} | ||
{% if input is null or input == true %} | ||
{% block field %} | ||
<div> | ||
{% block field_label %} | ||
<strong>{{ field.label|t|e }}</strong>: | ||
{% endblock %} | ||
{% macro render_field(form, fields) %} | ||
{% for index, field in fields %} | ||
{% set input = attribute(field, "input@") %} | ||
{% if input is null or input == true %} | ||
{% if form.value(field.name) %} | ||
{% block field %} | ||
<div> | ||
{% block field_label %} | ||
<strong>{{ field.label|t|e }}</strong>: | ||
{% endblock %} | ||
|
||
{% block field_value %} | ||
{% 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 %} | ||
{% block field_value %} | ||
{% 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 %} | ||
</div> | ||
{% endblock %} | ||
{% endif %} | ||
{% else %} | ||
{% if field.fields is iterable %} | ||
{{ _self.render_field(form, field.fields) }} | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endmacro %} | ||
|
||
{{ _self.render_field(form, form.fields) }} | ||
|
||
{% endif %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
{% autoescape false %} | ||
|
||
{% for index, field in form.fields %} | ||
{% set input = attribute(field, "input@") %} | ||
{% if input is null or input == true %} | ||
{% set value = form.value(field.name ?? index) %} | ||
{{ field.name ?? index }}: {{ string((value is iterable ? value|json_encode : value)|nl2br)|replace({"\n":' ', "\r":' '}) }} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% endautoescape %} | ||
{%- macro render_field(form, fields) %} | ||
{%- for index, field in fields %} | ||
{%- set input = attribute(field, "input@") %} | ||
{%- if input is null or input == true %} | ||
{%- set value = form.value(field.name ?? index) %} | ||
{{- field.name ?? index }}: {{ string((value is iterable ? value|json_encode : value)) ~ "\r\n" }} | ||
{%- else %} | ||
{%- if field.fields is iterable %} | ||
{{- _self.render_field(form, field.fields) }} | ||
{%- endif %} | ||
{%- endif %} | ||
{%- endfor %} | ||
{%- endmacro %} | ||
{%- autoescape false %} | ||
{{- _self.render_field(form, form.fields) ~ "\r\n" }} | ||
{%- endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if form.data.avatar %} | ||
<label><img style="max-width:200px;" src="{{ base_url_simple ~ '/' ~ (form.data.avatar|first).path }}" /></label> | ||
{% else %} | ||
<label><img src="https://www.gravatar.com/avatar/{{ form.data.email|md5 }}?s=200" /></label> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters