From 6e4673da917b31c5f74f1ee002ea02014ef12a8a Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 28 Nov 2012 17:45:24 +0100 Subject: [PATCH] SONAR-3825 add sidebar "filters" --- .../app/controllers/measures_controller.rb | 6 + .../app/views/layouts/_layout.html.erb | 10 +- .../app/views/measures/_filters.html.erb | 21 ++ .../app/views/measures/manage.html.erb | 210 ++++++++++-------- .../app/views/measures/search.html.erb | 56 ++--- .../src/main/webapp/stylesheets/style.css | 87 ++++---- 6 files changed, 222 insertions(+), 168 deletions(-) create mode 100644 sonar-server/src/main/webapp/WEB-INF/app/views/measures/_filters.html.erb diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb index bca19f33bed..53fc617c245 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb @@ -175,6 +175,12 @@ class MeasuresController < ApplicationController render :text => is_favourite.to_s, :status => 200 end + # GET /measures/filters + def filters + verify_ajax_request + render :partial => 'measures/filters' + end + private def find_filter(id) filter = MeasureFilter.find(id) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index 0ab7c92f1a9..90b62d1f25c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -223,11 +223,11 @@ <% end %> <% end %> + + + + + + + + + + + - <% end %> - <% end %> - - diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb index a1f56543664..870e0f8ab9c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb @@ -1,17 +1,17 @@ <% content_for :style do %> @@ -20,7 +20,7 @@ <% end %>
-
+ + + <% if @filter.id %> <% end %> @@ -141,27 +166,6 @@
- -
-
    - <% MeasureFilter.find(:all, :select => ['id,name'], :conditions => ['system=?', true]).each do |system_filter| %> -
  • - <%= h system_filter.name -%> -
  • - <% end %> -
- - <% if logged_in? %> -
- - Manage - <% end %>
<% if @filter.results && @filter.display %> diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index b6c02a430f7..9a8640bc37a 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -1721,33 +1721,6 @@ ul.bullet li { border-top: 0; padding: 5px; } - -#time_machine { - margin: 10px 0; -} - -#time_machine #selected { - background-image: url("../images/timemachine.png"); - background-repeat: repeat-x; - background-position: left; - background-color: #9D9D9D; - border: 2px solid #ccc; - color: #fff; -} - -#time_machine #selected a { - border-bottom: 1px dotted #fff; -} - -#time_machine #selected a.nolink { - border-bottom: 0; -} - -#time_machine #selector { - background-color: #EFEFEF; - border: 1px solid #DDD; -} - .comments { color: #777; font-size: 12px; @@ -2007,11 +1980,11 @@ table.without-header { border-top: 1px solid #ddd; } -.hoverable.selected a, #time_machine #selected h3, #time_machine #selected a { +.hoverable.selected a { color: #fff; } -#time_machine td, .gwt-SourcePanel .sources td { +.gwt-SourcePanel .sources td { vertical-align: top; } @@ -2293,6 +2266,10 @@ td.spacer-top { border-top: 1px solid #DDD; } +select:not([multiple]) { + padding: 2px 5px; +} + select.small-width { max-width: 120px; } @@ -2301,23 +2278,6 @@ select.medium-width { max-width: 175px; width: 175px; } - -.pipe-left { - background-image: url('../images/sep12.png'); - background-position: left center; - background-repeat: no-repeat; - padding-left: 8px; - margin-left: 8px; -} - -.pipe-right { - background-image: url('../images/sep12.png'); - background-position: right center; - background-repeat: no-repeat; - margin-right: 8px; - padding-right: 8px; -} - /* Dependencies */ #dependencies { padding: 10px; @@ -2425,4 +2385,39 @@ textarea.width100 { .property table.data > thead > tr > th { vertical-align: top; +} + +.nav-pills:before, .nav-pills:after { + content: ""; + display: table; + line-height: 0; +} + +.nav-pills:after { + clear: both; +} + +.nav-pills > li { + float: left; +} + +.nav-pills > li > a { + line-height: 14px; + margin-right: 2px; + padding-left: 10px; + padding-right: 10px; + display: block; +} + +.nav-pills > li > a { + border-radius: 5px 5px 5px 5px; + margin-bottom: 2px; + margin-top: 2px; + padding-bottom: 6px; + padding-top: 6px; +} + +.nav-pills > .active > a, .nav-pills > .active > a:hover { + background-color: #4b9fd5; + color: #FFFFFF; } \ No newline at end of file -- 2.39.5