]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2376 Add an extension point to define a HTML banner
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 24 Sep 2012 12:47:58 +0000 (14:47 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 24 Sep 2012 14:19:32 +0000 (16:19 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb

index 3c89d1aa23838c748b9ccb84498b44a0c54af0d9..3ea32cf06212a749431e55685530fc57b0b97be1 100644 (file)
@@ -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 {
index e64ca8eab87b429608f956a900087b9e8189081f..73c87158d5c5db1fba374ac29b9b38b5c59cd727 100644 (file)
@@ -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' %>