diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-14 18:22:59 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-14 18:22:59 +0100 |
commit | 8317be2653b7f1aa950de11b859048efe2e829f0 (patch) | |
tree | f2dfa7faac14d191692e1cf771776f069f044a36 /sonar-server | |
parent | 9bfe1cb36e0edcb8fbca55e4871f19ca9cb4f91e (diff) | |
download | sonarqube-8317be2653b7f1aa950de11b859048efe2e829f0.tar.gz sonarqube-8317be2653b7f1aa950de11b859048efe2e829f0.zip |
SONAR-3825 Check "Favourites only" by default when added to criteria
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb index b0f8aabdf68..df581e6d3a3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb @@ -37,7 +37,10 @@ if (e.val == 'lang' || e.val == 'project') { $j("#select-" + e.val).select2("enable"); $j("#select-" + e.val).select2("focus"); + } else if (e.val=='fav') { + $j('#check-fav').attr('checked', 'checked'); } + if (e.val == 'metric') { if (hiddenConditionIndexes.length > 0) { var index = hiddenConditionIndexes.pop(); @@ -115,7 +118,7 @@ </li> <li id="criteria-fav" <%= "style='display:none'" unless @filter.criteria('onFavourites') -%> class="marginbottom5"> <img src="<%= ApplicationController.root_context -%>/images/star.png"> <%= message 'measure_filter.criteria.only_favourites' %>: - <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true' -%> + <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true', :id => 'check-fav' -%> </li> <% condition_metrics = Metric.all.select { |m| m.numeric? && !m.hidden } %> @@ -146,14 +149,28 @@ <li id="more-td" class="marginbottom5"> <select id="more-criteria"> <option value=""></option> - <option value="age"><%= message 'measure_filter.criteria.age' -%></option> - <option value="date"><%= message 'measure_filter.criteria.date' -%></option> - <option value="fav"><%= message 'measure_filter.criteria.only_favourites' -%></option> - <option value="key"><%= message 'measure_filter.criteria.key' -%></option> - <option value="lang"><%= message 'measure_filter.criteria.language' -%></option> + <% unless @filter.criteria('ageMinDays') || @filter.criteria('ageMaxDays') %> + <option value="age"><%= message 'measure_filter.criteria.age' -%></option> + <% end %> + <% unless @filter.criteria('fromDate') || @filter.criteria('toDate') %> + <option value="date"><%= message 'measure_filter.criteria.date' -%></option> + <% end %> + <% unless @filter.criteria('onFavourites') %> + <option value="fav"><%= message 'measure_filter.criteria.only_favourites' -%></option> + <% end %> + <% unless @filter.criteria('keyRegexp') %> + <option value="key"><%= message 'measure_filter.criteria.key' -%></option> + <% end %> + <% unless @filter.criteria('languages') %> + <option value="lang"><%= message 'measure_filter.criteria.language' -%></option> + <% end %> <option value="metric"><%= message 'measure_filter.criteria.metric' -%></option> - <option value="name"><%= message 'measure_filter.criteria.name' -%></option> - <option value="project"><%= message 'measure_filter.criteria.components_of_project' -%></option> + <% unless @filter.criteria('nameSearch') %> + <option value="name"><%= message 'measure_filter.criteria.name' -%></option> + <% end %> + <% unless @filter.base_resource %> + <option value="project"><%= message 'measure_filter.criteria.components_of_project' -%></option> + <% end %> </select> </li> <li> |