8000 [WebProfilerBundle] Display the Missing translations tab by default if there are missing translations by javiereguiluz · Pull Request #26394 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WebProfilerBundle] Display the Missing translations tab by default if there are missing translations #26394

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
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
{% endfor %}

<div class="sf-tabs">
<div class="tab">
<div class="tab {{ collector.countMissings == 0 ? 'tab-active' }}">
<h3 class="tab-title">Defined <span class="badge">{{ messages_defined|length }}</span></h3>

<div class="tab-content">
Expand Down Expand Up @@ -132,7 +132,7 @@
</div>
</div>

<div class="tab">
<div class="tab {{ collector.countMissings > 0 ? 'tab-active' }}">
<h3 class="tab-title">Missing <span class="badge">{{ messages_missing|length }}</span></h3>

<div class="tab-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,14 @@
var tabNavigation = document.createElement('ul');
tabNavigation.className = 'tab-navigation';

var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
Copy link
Contributor
@ro0NL ro0NL Mar 4, 2018

Choose a reason for hiding this comment

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

does twigbundle need the same fix? file not found in 2.8... but dont forget to update it upon merge i guess ;-)

{# This file is partially duplicated in TwigBundle/Resources/views/base_js.html.twig. If you
make any change in this file, verify the same change is needed in the other file. #}

also the reason im a bit skeptical about 2.8... it's new behavior and things have changed as of 3.4. Not sure if the merge will be conflicting.. but tend to prefer 3.4 at least somehow :)

for (var j = 0; j < tabs.length; j++) {
var tabId = 'tab-' + i + '-' + j;
var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;

var tabNavigationItem = document.createElement('li');
tabNavigationItem.setAttribute('data-tab-id', tabId);
if (j == 0) { Sfjs.addClass(tabNavigationItem, 'active'); }
if (hasClass(tabs[j], 'tab-active')) { selectedTabId = tabId; }
if (Sfjs.hasClass(tabs[j], 'disabled')) { Sfjs.addClass(tabNavigationItem, 'disabled'); }
tabNavigationItem.innerHTML = tabTitle;
tabNavigation.appendChild(tabNavigationItem);
Expand All @@ -354,6 +355,7 @@
}

tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
addClass(document.querySelector('[data-tab-id="' + selectedTabId + '"]'), 'active');
}

/* display the active tab and add the 'click' event listeners */
Expand Down
0