From 13ecd43d57a3f09a8006c3fb10c3628ea018b08f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 14 Sep 2012 18:08:16 +0200 Subject: [PATCH] SONAR-3802 various improvements in the top nav bar * Upgrade YUI reset/font CSS * New URLs /dev/layout and /dev/empty for performance tests * Rename the link "Home" with the name of the main global dashboard * Extract layout.css from style.css --- sonar-application/pom.xml | 2 +- sonar-server/pom.xml | 3 +- .../WEB-INF/app/controllers/dev_controller.rb | 32 ++ .../app/views/layouts/_breadcrumb.html.erb | 5 +- .../WEB-INF/app/views/layouts/_head.html.erb | 21 +- .../app/views/layouts/_layout.html.erb | 328 ++++++++++-------- .../src/main/webapp/stylesheets/layout.css | 198 +++++++++++ .../src/main/webapp/stylesheets/style.css | 217 ------------ .../src/main/webapp/stylesheets/yui-2.6.0.css | 7 - .../webapp/stylesheets/yui-reset-font.css | 12 + 10 files changed, 432 insertions(+), 393 deletions(-) create mode 100644 sonar-server/src/main/webapp/WEB-INF/app/controllers/dev_controller.rb create mode 100644 sonar-server/src/main/webapp/stylesheets/layout.css delete mode 100644 sonar-server/src/main/webapp/stylesheets/yui-2.6.0.css create mode 100644 sonar-server/src/main/webapp/stylesheets/yui-reset-font.css diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index c9b948077f4..4f8085530e9 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -216,7 +216,7 @@ - 53200000 + 54000000 52000000 ${project.build.directory}/sonar-${project.version}.zip diff --git a/sonar-server/pom.xml b/sonar-server/pom.xml index dd7285e6981..bd63405e017 100644 --- a/sonar-server/pom.xml +++ b/sonar-server/pom.xml @@ -254,7 +254,8 @@ - **/yui-2.6.0-min.css + **/yui-reset-font-min.css + **/layout-min.css **/style-min.css **/sonar-colorizer-min.css **/dashboard-min.css diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dev_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dev_controller.rb new file mode 100644 index 00000000000..2fb2e7d6b5a --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dev_controller.rb @@ -0,0 +1,32 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2012 SonarSource +# mailto:contact AT sonarsource DOT com +# +# Sonar is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Sonar is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with Sonar; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 +# +class DevController < ApplicationController + + SECTION=Navigation::SECTION_HOME + + def layout + render :text => '', :layout => true + end + + def empty + render :text => '' + end + +end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb index 6d85c456e27..526601cef6d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb @@ -1,5 +1,3 @@ -
    -
  1. <%= message('layout.home') -%>
  2. <% resource_link = {} only_resource = true @@ -47,5 +45,4 @@ if @review <% end -%> -
\ No newline at end of file +%> \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb index 89d6e219f5a..91ef035e22c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb @@ -2,7 +2,15 @@ + +<% + if @project +%> <% + else +%><% + end + if @page_title title="Sonar - #{h(@page_title)}" elsif @project @@ -13,11 +21,12 @@ title='Sonar' end %> -<%= title %> +<%= title -%> <% if ENV['RAILS_ENV'] == 'production' %><%= stylesheet_link_tag 'sonar', :media => 'all' -%><%= javascript_include_tag 'sonar' -%><% else %> -<%= stylesheet_link_tag 'yui-2.6.0.css', :media => 'all' %> +<%= stylesheet_link_tag 'yui-reset-font.css', :media => 'all' %> +<%= stylesheet_link_tag 'layout.css', :media => 'all' %> <%= stylesheet_link_tag 'style', :media => 'all' %> <%= stylesheet_link_tag 'sonar-colorizer', :media => 'all' %> <%= stylesheet_link_tag 'dashboard', :media => 'all' %> @@ -33,11 +42,5 @@ <%= javascript_include_tag 'resource' %> <% end %> - -<% -if @project %> - -<% else -%><% -end %> + \ No newline at end of file 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 345fb8176b9..d131b7c45de 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 @@ -7,9 +7,26 @@ period_param = "period=#{params[:period]}" if params[:period] %>
-
- <%= render :partial => 'layouts/breadcrumb' %> - - +
-
- -
- +
+ +
+ - <% if @sidebar %> -
<%= render :partial => @sidebar %>
- <% else %> - - <% end %> + <% if @sidebar %> +
<%= render :partial => @sidebar %>
+ <% else %> + + <% end %> +
+
+ <% if @project %> +

<%= @project.name(true) %>

+ <% end %> + -
- <% if @project %> -

<%= @project.name(true) %>

- <% end %> - - - - <%= yield %> + + + <%= yield %>
+
<% unless params[:hd]=='false' %>