Skip to content

Commit

Permalink
feature #26398 [WebProfilerBundle] Display the missing translation pa…
Browse files Browse the repository at this point in the history
…nel by default (javiereguiluz)

This PR was squashed before being merged into the 4.1-dev branch (closes #26398).

Discussion
----------

[WebProfilerBundle] Display the missing translation panel by default

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Display the "Missing Translations" panel by default ... except if there are no missing translations.

Commits
-------

15fe686 [WebProfilerBundle] Display the missing translation panel by default
  • Loading branch information
fabpot committed Mar 10, 2018
2 parents febc096 + 15fe686 commit 009b4d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@
var tabNavigation = document.createElement('ul');
tabNavigation.className = 'tab-navigation';
var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
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) { addClass(tabNavigationItem, 'active'); }
if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
tabNavigationItem.innerHTML = tabTitle;
tabNavigation.appendChild(tabNavigationItem);
Expand All @@ -61,6 +62,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
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
{% endfor %}

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

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

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

<div class="tab-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,14 @@
var tabNavigation = document.createElement('ul');
tabNavigation.className = 'tab-navigation';
var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
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) { addClass(tabNavigationItem, 'active'); }
if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
tabNavigationItem.innerHTML = tabTitle;
tabNavigation.appendChild(tabNavigationItem);
Expand All @@ -422,6 +423,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 comments on commit 009b4d2

Please sign in to comment.