diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-02-15 15:52:33 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-02-15 15:53:03 +0100 |
commit | f70fa4fad61122154df66dbd12a58c92fd13cf2e (patch) | |
tree | 05eaa1a8176da37826da64ff91318487a8f91a98 | |
parent | 05c796bc1a858973103f038c9678583afa37aaea (diff) | |
download | sonarqube-f70fa4fad61122154df66dbd12a58c92fd13cf2e.tar.gz sonarqube-f70fa4fad61122154df66dbd12a58c92fd13cf2e.zip |
Fix some CSS issues in resource viewers
5 files changed, 76 insertions, 92 deletions
diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/dependencies/dependencies_viewer.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/dependencies/dependencies_viewer.html.erb index 4ff8389a161..97bcd6ca045 100644 --- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/dependencies/dependencies_viewer.html.erb +++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/dependencies/dependencies_viewer.html.erb @@ -1,46 +1,62 @@ -<div id="dependencies" class="drilldown_col"> +<style> + .dependenciesCol { + float: left; + margin: 10px; + border: 1px solid #ccc; + } + .dependenciesColTitle { + padding: 3px 10px; + text-align: center; + background-color: #efefef; + } + .dependenciesColBody { + padding: 3px; + border-top: 1px solid #ccc; + } + .dependenciesColBody > div { + padding: 3px; + } +</style> +<div> + <% + ca = @snapshot.measure('ca') + ce = @snapshot.measure('ce') + dependencies = Dependency.find(:all, + :include => ['from', 'to'], + :conditions => ['(dependencies.from_snapshot_id=? OR dependencies.to_snapshot_id=?)', @snapshot.id, @snapshot.id]) -<% - ca = @snapshot.measure('ca') - ce = @snapshot.measure('ce') - dependencies = Dependency.find(:all, - :include => ['from','to'], - :conditions => ['(dependencies.from_snapshot_id=? OR dependencies.to_snapshot_id=?)', @snapshot.id, @snapshot.id]) - - resource_id = @resource.id - dependencies_by_measure = [] - dependencies_by_measure << {:metric => 'ca', :measure => ca, - :dependencies => dependencies.select {|dep| dep.to_resource_id == resource_id}} - dependencies_by_measure << {:metric => 'ce', :measure => ce, - :dependencies => dependencies.select {|dep| dep.from_resource_id == resource_id}} + resource_id = @resource.id + dependencies_by_measure = [] + dependencies_by_measure << {:metric => 'ca', :measure => ca, + :dependencies => dependencies.select { |dep| dep.to_resource_id == resource_id }} + dependencies_by_measure << {:metric => 'ce', :measure => ce, + :dependencies => dependencies.select { |dep| dep.from_resource_id == resource_id }} - dependencies_by_measure.each do |deps_by_m| - metric_name = deps_by_m[:metric] - measure = deps_by_m[:measure] - deps = deps_by_m[:dependencies] -%> + dependencies_by_measure.each do |deps_by_m| + metric_name = deps_by_m[:metric] + measure = deps_by_m[:measure] + deps = deps_by_m[:dependencies] + %> - <div id="<%= metric_name -%>-deps" class="col"> - - <div class="coltitle"> - <%= message('dependencies.' + metric_name) -%>: <b><%= format_measure(measure) -%></b> - </div> - - <% unless deps.empty? %> - <div class="colbody"> - <% - deps.each do |dep| - resource = metric_name=='ca' ? dep.from : dep.to - %> - <div> - <%= image_tag 'q/CLA.png'-%> - <%= link_to_resource resource, resource.long_name, {:tab => 'dependencies'} -%> (<%= dep.weight -%>) + <div id="<%= @resource.key.parameterize -%>-<%= metric_name -%>" class="dependenciesCol"> + <div class="dependenciesColTitle"> + <%= message('dependencies.' + metric_name) -%>: <b><%= format_measure(measure) -%></b> + </div> + + <% unless deps.empty? %> + <div class="dependenciesColBody"> + <% + deps.each do |dep| + resource = metric_name=='ca' ? dep.from : dep.to + %> + <div> + <%= image_tag 'q/CLA.png' -%> + <%= link_to_resource resource, resource.long_name, {:tab => 'dependencies'} -%> (<%= dep.weight -%>) + </div> + <% end %> </div> <% end %> </div> - <% end %> - - </div> -<% end %> - + <% end %> + <div class="clear"></div> </div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications.html.erb index e4c8d88f514..a9cf8d75b52 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications.html.erb @@ -4,15 +4,15 @@ warning_message = @duplication_group_warning if @duplication_group_warning %> - <div id="duplications-message"><%= warning_message -%></div> + <div class="duplicationsMessage"><%= warning_message -%></div> <% else %> <% if @duplication_group_warning %> - <div id="duplications-message"><%= @duplication_group_warning -%></div> + <div class="duplicationsMessage"><%= @duplication_group_warning -%></div> <% end %> - <table id="duplications" class="data"> + <table class="data duplications"> <thead> <tr> <th class="thin nowrap"><%= message('duplications.blocks') -%></th> @@ -79,16 +79,10 @@ </div> </td> </tr> - - - <tr> - <td colspan="5" style="border-bottom: 1px solid #DDD;height: 10px"></td> - </tr> <% end %> </tbody> </table> - <% end %>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb index 8be3444791c..185a8f16daf 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb @@ -148,7 +148,7 @@ </table> <% if @filtered && !has_displayed_lines %> - <p><%= message('no_lines_match_your_filter_criteria') -%></p> + <p style="padding: 10px"><%= message('no_lines_match_your_filter_criteria') -%></p> <% end %> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/source/_source.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/source/_source.html.erb index 22ec14dd12e..690513754ff 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/source/_source.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/source/_source.html.erb @@ -58,6 +58,6 @@ </table> <% if panel.filtered && !has_displayed_lines %> - <p><%= message('no_lines_match_your_filter_criteria') -%></p> + <p style="padding: 10px"><%= message('no_lines_match_your_filter_criteria') -%></p> <% end %> <% end %>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 0c6b053a2d4..4a3ebabb9b7 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -883,53 +883,57 @@ span.rulename a:hover { /* DUPLICATIONS */ -#duplications { +.duplications { max-width: 100%; } -#duplications td.item { +.duplications td.item { text-align: right; vertical-align: top; padding: 0; } -#duplications td.item p { +.duplications td.item p { padding: 3px 10px; } -#duplications td.fileItem { +.duplications td.fileItem { text-align: left; vertical-align: top; padding: 0; white-space: nowrap; } -#duplications td.fileItem p { - padding: 3px 10px; +.duplications td.fileItem p { + padding: 3px 5px; } -#duplications td.item p.selected, #duplications td.fileItem p.selected { +.duplications td.item p.selected, .duplications td.fileItem p.selected { background-color: #EFEFEF; border-top: 1px solid #DDD; border-bottom: 1px solid #DDD; - padding: 3px 10px; + padding: 3px 5px; } -#duplications td.fileItem p.selected a { +.duplications td.fileItem p.selected a { text-decoration: none; } -#duplications td.sourceItem { - padding: 0 10px; +.duplications td.sourceItem { + padding: 0; background-color: #EFEFEF; border: 1px solid #DDD; border-left: none; } -#duplications td.sourceItem p { +.duplications td.sourceItem p { padding: 3px; } +.duplicationsMessage { + padding: 10px; +} + /* REVIEWS */ div.reviewTitle { background-color: #E4ECF3; @@ -2296,35 +2300,6 @@ select.medium-width { max-width: 175px; width: 175px; } -/* Dependencies */ -#dependencies { - padding: 10px; -} - -#dependencies .col { - float: left; - margin: 0 10px 0 0; - border: 1px solid #ccc; -} - -#dependencies .coltitle { - padding: 3px 10px; - text-align: center; - background-color: #efefef; -} - -#dependencies .colbody { - padding: 3px; - border-top: 1px solid #ccc; -} - -#dependencies .colbody > div { - padding: 3px; -} - -#dependencies .colbody > div > img { -/ / vertical-align : baseline; -} .form-head { padding: 2px 10px; @@ -2413,6 +2388,5 @@ textarea.width100 { .accordion-item-body-medium { max-height: 200px; overflow: auto; - overflow-x:hidden; } |