From 26b1bbe323c97809fe10f21d733e577a1bdbec41 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 26 Jan 2015 09:44:58 +0100 Subject: [PATCH] SONAR-6041 update search categories --- server/sonar-web/src/main/hbs/nav/nav-search-item.hbs | 8 +++++--- server/sonar-web/src/main/js/nav/search-view.js | 10 ++++++---- .../src/main/resources/org/sonar/l10n/core.properties | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs b/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs index 7aa6c557080..e1b4bed6f00 100644 --- a/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs +++ b/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs @@ -1,9 +1,11 @@ -{{#if extra}} +{{#notNull extra}} {{#gt index 0}}
{{/gt}} - -{{/if}} + {{#if extra}} + + {{/if}} +{{/notNull}} {{#if q}}{{qualifierIcon q}}{{/if}} diff --git a/server/sonar-web/src/main/js/nav/search-view.js b/server/sonar-web/src/main/js/nav/search-view.js index 2ccc6b62df1..ac0332a0b9d 100644 --- a/server/sonar-web/src/main/js/nav/search-view.js +++ b/server/sonar-web/src/main/js/nav/search-view.js @@ -105,17 +105,19 @@ define([ resetResultsToDefault: function () { var recentHistory = JSON.parse(localStorage.getItem('sonar_recent_history')), - history = (recentHistory || []).map(function (historyItem) { + history = (recentHistory || []).map(function (historyItem, index) { return { url: baseUrl + '/dashboard/index?id=' + encodeURIComponent(historyItem.key) + dashboardParameters(true), name: historyItem.name, - q: historyItem.icon + q: historyItem.icon, + extra: index === 0 ? t('recent_history') : null }; }), - qualifiers = this.model.get('qualifiers').map(function (q) { + qualifiers = this.model.get('qualifiers').map(function (q, index) { return { url: baseUrl + '/all_projects?qualifier=' + encodeURIComponent(q), - name: t('qualifiers.all', q) + name: t('qualifiers.all', q), + extra: index === 0 ? '' : null }; }); this.results.reset(history.concat(qualifiers)); diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index f46f1678ff1..cb1fa3c7634 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -116,6 +116,7 @@ plugin=Plugin project=Project projects=Projects raw=Raw +recent_history=Recent History refresh=Refresh reload=Reload remove=Remove -- 2.39.5