Skip to content

Commit

Permalink
Merge pull request #190 from egeloen/bootstrap-tab
Browse files Browse the repository at this point in the history
Fix tabs when using the widget more than one time on the same page
  • Loading branch information
webda2l committed Sep 9, 2015
2 parents 50ed1ed + 894e25a commit 2af32a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Resources/views/default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% set locale = translationsFields.vars.name %}

<li {% if app.request.locale == locale %}class="active"{% endif %}>
<a href="#" data-toggle="tab" data-target=".a2lix_translationsFields-{{ locale }}">
<a href="#" data-toggle="tab" data-target=".{{ translationsFields.vars.id }}_a2lix_translationsFields-{{ locale }}">
{{ locale|capitalize }}
{% if form.vars.default_locale == locale %}[Default]{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
Expand All @@ -19,7 +19,7 @@
{% for translationsFields in form %}
{% set locale = translationsFields.vars.name %}

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

<li {% if app.request.locale == locale %}class="active"{% endif %}>
<a href="#" data-toggle="tab" data-target=".a2lix_translationsFields-{{ locale }}">
<a href="#" data-toggle="tab" data-target=".{{ translationsFields.vars.id }}_a2lix_translationsFields-{{ locale }}">
{{ locale|capitalize }}
{% if form.vars.default_locale == locale %}[Default]{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
Expand All @@ -27,7 +27,7 @@ Example:
{% for translationsFields in form %}
{% set locale = translationsFields.vars.name %}

<div class="a2lix_translationsFields-{{ locale }} tab-pane {% if app.request.locale == locale %}active{% endif %}">
<div class="{{ translationsFields.vars.id }}_a2lix_translationsFields-{{ locale }} a2lix_translationsFields-{{ locale }} tab-pane {% if app.request.locale == locale %}active{% endif %}">
{% for translationsField in translationsFields if translationsField.vars.name in fieldsNames %}
{{ form_row(translationsField) }}
{% endfor %}
Expand Down

0 comments on commit 2af32a2

Please sign in to comment.