8000 [TwigBridge] Foundation form layout integration by totophe · Pull Request #12587 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[TwigBridge] Foundation form layout integration #12587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some indentation and whitespace control problems
  • Loading branch information
Jean-Christophe Cuvelier committed Feb 10, 2015
commit 5029b2a41cfc8382bb030e9f322f5c876f85ac58
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "form_div_layout.html.twig" %}

{# Based on Foundation 5 Doc #}
{# Widgets #}

Expand All @@ -10,7 +11,6 @@
{%- endblock form_widget_simple %}

{% block textarea_widget -%}

{% if errors|length > 0 -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
Expand Down Expand Up @@ -57,7 +57,6 @@
{{- block('form_widget_simple') -}}
{% else %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' row')|trim}) %}

<div class="row">
<div class="large-7 columns">{{ form_errors(form.date) }}</div>
<div class="large-5 columns">{{ form_errors(form.time) }}</div>
Expand All @@ -75,13 +74,13 @@
{% else %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' row')|trim}) %}
{% if datetime is not defined or not datetime %}
<div {{ block('widget_container_attributes') -}}>
<div {{ block('widget_container_attributes') }}>
{% endif %}
{{ date_pattern|replace({
'{{ year }}': '<div class="large-4 columns">' ~ form_widget(form.year) ~ '</div>',
'{{ month }}': '<div class="large-4 columns">' ~ form_widget(form.month) ~ '</div>',
'{{ day }}': '<div class="large-4 columns">' ~ form_widget(form.day) ~ '</div>',
})|raw }}
{{- date_pattern|replace({
'{{ year }}': '<div class="large-4 columns">' ~ form_widget(form.year) ~ '</div>',
'{{ month }}': '<div class="large-4 columns">' ~ form_widget(form.month) ~ '</div>',
'{{ day }}': '<div class="large-4 columns">' ~ form_widget(form.day) ~ '</div>',
})|raw -}}
{% if datetime is not defined or not datetime %}
</div>
{% endif %}
Expand Down Expand Up @@ -170,15 +169,15 @@
<ul class="inline-list">
{% for child in form %}
<li>{{ form_widget(child, {
parent_label_class: label_attr.class|default(''),
parent_label_class: label_attr.class|default(''),
}) }}</li>
{% endfor %}
</ul>
{% else %}
<div {{ block('widget_container_attributes') }}>
{% for child in form %}
{{ form_widget(child, {
parent_label_class: label_attr.class|default(''),
parent_label_class: label_attr.class|default(''),
}) }}
{% endfor %}
</div>
Expand Down Expand Up @@ -222,14 +221,14 @@
{{- parent() -}}
{%- endblock form_label %}

{% block choice_label %}
{% block choice_label -%}
{% if errors|length > 0 -%}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{# remove the checkbox-inline and radio-inline class, it's only useful for embed labels #}
{% set label_attr = label_attr|merge({class: label_attr.class|default('')|replace({'checkbox-inline': '', 'radio-inline': ''})|trim}) %}
{{- block('form_label') -}}
{% endblock %}
{%- endblock %}

{% block checkbox_label -%}
{{- block('checkbox_radio_label') -}}
Expand All @@ -239,7 +238,7 @@
{{- block('checkbox_radio_label') -}}
{%- endblock radio_label %}

{% block checkbox_radio_label %}
{% block checkbox_radio_label -%}
{% if required %}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
{% endif %}
Expand All @@ -253,10 +252,10 @@
{% set label = name|humanize %}
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{ widget|raw }}
{{ label|trans({}, translation_domain) }}
{{ widget|raw }}
{{ label|trans({}, translation_domain) }}
</label>
{% endblock checkbox_radio_label %}
{%- endblock checkbox_radio_label %}

{# Rows #}

Expand Down Expand Up @@ -313,12 +312,10 @@
{% block form_errors -%}
{% if errors|length > 0 -%}
{% if form.parent %}<small class="error">{% else %}<div data-alert class="alert-box alert">{% endif %}

{%- for error in errors -%}
{{ error.message }}
{% if not loop.last %}, {% endif %}
{%- endfor -%}

{% if form.parent %}</small>{% else %}</div>{% endif %}
{%- endif %}
{%- endblock form_errors %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing EOL

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

0