diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2013-12-04 19:11:14 +0600 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2013-12-04 19:11:20 +0600 |
commit | 87ee9d0d2f4eff8653b1f3cd1d4318c80460312d (patch) | |
tree | ed96e4a63fb527d41ffc05491228ea52116fc8ac | |
parent | 74b0ef103fb42842cc047d4847e9b2033ef9d6d0 (diff) | |
download | sonarqube-87ee9d0d2f4eff8653b1f3cd1d4318c80460312d.tar.gz sonarqube-87ee9d0d2f4eff8653b1f3cd1d4318c80460312d.zip |
Components of filter supports multiple categories
4 files changed, 43 insertions, 8 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb index 501e1713a82..5db4bb73e9a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb @@ -20,7 +20,13 @@ {[ if (item.icon) { ]} <img src="{{ item.icon }}" alt="{{ item.text }}"> {[ } ]} - <span>{{ item.text }}</span> + <span> + {{ item.text }} + {[ if (item.category) { ]} + <br> + <span class="subtitle">{{ item.category }}</span> + {[ } ]} + </span> </label> </li> </script> diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js b/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js index bf6442131d9..dff04ba4b28 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js +++ b/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js @@ -69,6 +69,24 @@ window.SS = typeof window.SS === 'object' ? window.SS : {}; url: function() { return baseUrl + '/api/resources/search?f=s2&qp=supportsGlobalDashboards&display_key=true'; + }, + + parse: function(r) { + this.more = r.more; + + // If results are divided into categories + if (r.results.length > 0 && r.results[0].children) { + var results = []; + _.each(r.results, function(category) { + _.each(category.children, function(child) { + child.category = category.text; + results.push(child); + }); + }); + return results; + } else { + return r.results; + } } }); diff --git a/sonar-server/src/main/webapp/stylesheets/navigator.css b/sonar-server/src/main/webapp/stylesheets/navigator.css index acfe6ad6fb4..b6f27f7e95e 100644 --- a/sonar-server/src/main/webapp/stylesheets/navigator.css +++ b/sonar-server/src/main/webapp/stylesheets/navigator.css @@ -154,11 +154,16 @@ .navigator-filter-select-list label.current { background-color: #ededed; } -.navigator-filter-select-list label img { +.navigator-filter-select-list label > input[type=checkbox] { + vertical-align: baseline; + cursor: pointer; +} +.navigator-filter-select-list label > img { vertical-align: text-bottom; } -.navigator-filter-select-list input[type=checkbox] { - cursor: pointer; +.navigator-filter-select-list label > span { + display: inline-block; + vertical-align: top; } .navigator-filter-select-list .single { padding: 5px 10px; diff --git a/sonar-server/src/main/webapp/stylesheets/navigator.less b/sonar-server/src/main/webapp/stylesheets/navigator.less index 54148227bfa..d6d6a34b710 100644 --- a/sonar-server/src/main/webapp/stylesheets/navigator.less +++ b/sonar-server/src/main/webapp/stylesheets/navigator.less @@ -178,13 +178,19 @@ background-color: darken(#fff, 7%); } - img { + & > input[type=checkbox] { + vertical-align: baseline; + cursor: pointer; + } + + & > img { vertical-align: text-bottom; } - } - input[type=checkbox] { - cursor: pointer; + & > span { + display: inline-block; + vertical-align: top; + } } .single { |