Skip to content

Commit

Permalink
Template with id (#313)
Browse files Browse the repository at this point in the history
* Template with id
* Fix cs
  • Loading branch information
webda2l authored Jul 2, 2018
1 parent 96db1c0 commit ca5bf77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Resources/views/bootstrap_4_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% set locale = translationsFields.vars.name %}

<li class="nav-item">
<a href="#" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" data-target=".{{ translationsFields.vars.id }}_a2lix_translationsFields-{{ locale }}" role="tab">
<a href="#{{ translationsFields.vars.id }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" role="tab">
{{ translationsFields.vars.label|default(locale|humanize)|trans }}
{% if form.vars.default_locale == locale %}{{ '[Default]'|trans }}{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
Expand All @@ -20,7 +20,7 @@
{% for translationsFields in form %}
{% set locale = translationsFields.vars.name %}

<div class="{{ translationsFields.vars.id }}_a2lix_translationsFields-{{ locale }} tab-pane {% if app.request.locale == locale %}show active{% endif %} {% if not form.vars.valid %}sonata-ba-field-error{% endif %}" role="tabpanel">
<div id="{{ translationsFields.vars.id }}_a2lix_translations-fields" class="tab-pane {% if app.request.locale == locale %}show active{% endif %} {% if not form.vars.valid %}sonata-ba-field-error{% endif %}" role="tabpanel">
{{ form_errors(translationsFields) }}
{{ form_widget(translationsFields) }}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/macros.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Example:
{% set locale = translationsFields.vars.name %}

<li class="nav-item">
<a href="#" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" data-target=".{{ translationsFields.vars.id }}_a2lix_translationsFields-{{ locale }}" role="tab">
<a href="#{{ translationsFields.vars.id }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" role="tab">
{{ translationsFields.vars.label|default(locale|humanize)|trans }}
{% if form.vars.default_locale == locale %}{{ '[Default]'|trans }}{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
Expand All @@ -29,7 +29,7 @@ Example:
{% for translationsFields in form %}
{% set locale = translationsFields.vars.name %}

<div class="{{ translationsFields.vars.id }}_a2lix_translationsFields-{{ locale }} tab-pane {% if app.request.locale == locale %}show active{% endif %} {% if not form.vars.valid %}sonata-ba-field-error{% endif %}" role="tabpanel">
<div id="{{ translationsFields.vars.id }}_a2lix_translations-fields" class="tab-pane {% if app.request.locale == locale %}show active{% endif %} {% if not form.vars.valid %}sonata-ba-field-error{% endif %}" role="tabpanel">
{% for translationsField in translationsFields if translationsField.vars.name in fieldsNames %}
{{ form_errors(translationsFields) }}
{{ form_widget(translationsFields) }}
Expand Down
1 change: 0 additions & 1 deletion tests/Form/Type/TranslationsTypeAdvancedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use A2lix\TranslationFormBundle\Form\Type\TranslationsType;
use A2lix\TranslationFormBundle\Tests\Fixtures\Entity\Product;
use A2lix\TranslationFormBundle\Tests\Fixtures\Entity\ProductTranslation;
use A2lix\TranslationFormBundle\Tests\Form\TypeTestCase;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
Expand Down

0 comments on commit ca5bf77

Please sign in to comment.