aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-09-24 14:47:58 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-09-24 16:19:32 +0200
commit3ce3844db8566721459e8773e88ba7d915be4750 (patch)
tree2080ba8ae156e70e93010ede1f9c7799f0fc84f5
parentd6305974248cfb34b00d57d96fddadb030e4aee9 (diff)
downloadsonarqube-3ce3844db8566721459e8773e88ba7d915be4750.tar.gz
sonarqube-3ce3844db8566721459e8773e88ba7d915be4750.zip
SONAR-2376 Add an extension point to define a HTML banner
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java20
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb2
2 files changed, 21 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java
index 3c89d1aa238..3ea32cf0621 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java
@@ -22,6 +22,26 @@ package org.sonar.api.web;
import org.sonar.api.ServerExtension;
/**
+ * Adds content to HTML pages. A PageDecoration is a Rails template (html.erb file) that executes content_for blocks on predefined locations :
+ * <ul>
+ * <li><code>script</code> : javascript header</li>
+ * <li><code>style</code> : CSS header</li>
+ * <li><code>header</code> : area over the black top navigation bar</li>
+ * <li><code>footer</code> : area below the main page</li>
+ * <li><code>sidebar</code> : area in the sidebar between the menu and the sonar logo</li>
+ * </ul>
+ *
+ * <p>Example of template: </p>
+<pre>
+ <% content_for :script do %>
+ <script>alert('page loaded')</script>
+ <% end %>
+
+ <% content_for :footer do %>
+ <div>this is <b>my footer</b></div>
+<% end %>
+</pre>
+ *
* @since 3.3
*/
public abstract class PageDecoration extends AbstractRubyTemplate implements ServerExtension {
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 e64ca8eab87..73c87158d5c 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
@@ -30,7 +30,7 @@
<% if ENV['RAILS_ENV'] == 'production'
%>
<%= stylesheet_link_tag 'sonar', :media => 'all' -%>
- <%= yield :css -%>
+ <%= yield :style -%>
<%= javascript_include_tag 'sonar' -%>
<% else %>
<%= stylesheet_link_tag 'yui-reset-font', :media => 'all' %>