]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1643 manage default dashboards for anonymous users
authorsimonbrandhof <simon.brandhof@gmail.com>
Thu, 28 Oct 2010 11:37:59 +0000 (11:37 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Thu, 28 Oct 2010 11:37:59 +0000 (11:37 +0000)
sonar-server/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb

index 7824a235adcfd27c074927d19d3f8607d3bc190b..bd97167f7414d1dfcaa4ee4d7e30ef7a7eedc06e 100644 (file)
@@ -23,7 +23,7 @@ class AdminDashboardsController < ApplicationController
 
   verify :method => :post, :only => [:up, :down, :remove, :add], :redirect_to => {:action => :index}
   before_filter :admin_required
-  before_filter :load_active_dashboards
+  before_filter :load_default_dashboards
 
   def index
     @default_dashboards=::Dashboard.find(:all, :conditions => {:shared => true})
@@ -95,7 +95,7 @@ class AdminDashboardsController < ApplicationController
 
   private
 
-  def load_active_dashboards
-    @actives=ActiveDashboard.default_active_dashboards
+  def load_default_dashboards
+    @actives=ActiveDashboard.default_dashboards
   end
 end
index 4fc1e09562edc1297c6b81847302cb1cef96c419..a2d7f67dcf01bf1d843319e5a794d7e04c527227 100644 (file)
@@ -75,7 +75,7 @@ class DashboardsController < ApplicationController
     else
       # TODO explicit error
     end
-    redirect :action => 'index', :resource => params[:resource]
+    redirect_to :action => 'index', :resource => params[:resource]
   end
 
   def delete
index aade1013455ad9fa9fcc52c6576d2a48165d2b7a..3598fc416f08944ea73e04f5075340c0b454a8e8 100644 (file)
@@ -1,6 +1,6 @@
 <h1>Default dashboards</h1>
-<p>These dashboards are displayed to anonymous users or users that haven't customized their dashboards.</p>
-<br/>
+<p class="marginbottom10">These dashboards are displayed to anonymous users or users who have not customized their dashboards.</p>
+
 <table class="data" id="admin_console">
   <thead>
     <tr>
@@ -41,9 +41,9 @@
 </table>
 
 <br/><br/>
-<h1>Admin dashboards</h1>
-<p>These dashboards can be added to default dashboards.</p>
-<br/>
+<h1>Shared dashboards</h1>
+<p class="marginbottom10">These dashboards can be added to default dashboards.</p>
+
 <table class="data" id="shared">
   <thead>
     <tr>
@@ -60,7 +60,7 @@
       <tr class="<%= cycle('even', 'odd') -%>">
         <td>
           <%= h(dashboard.name) -%><br>
-          <span style="font-size: 85%;font-weight: normal;"><%= dashboard.description %></span>
+          <span class="small"><%= dashboard.description %></span>
         </td>
         <td><%= h(dashboard.user.name) if dashboard.user %></td>
         <td><%= link_to 'Add to defaults', {:action => 'add', :id => dashboard.id}, :method => :post, :id => "add-#{u dashboard.name}" %></td>
index 027299e3d03f4ca4d678bec2eac7d11f575c74c6..913b361d6a2dbe8dea6edfd16fc54f1b92169187 100644 (file)
           else
             @actives.each_with_index do |active,index| %>
             <tr id="dashboard-<%= u active.name -%>" class="<%= cycle('even','odd', :name => 'dashboards') -%>">
-              <td><%= link_to active.name, {:controller => :dashboard, :action => :index, :id => active.dashboard_id, :resource => params[:resource]} -%></td>
+              <td>
+                <%= link_to active.name, {:controller => :dashboard, :action => :index, :id => active.dashboard_id, :resource => params[:resource]} -%>
+                <% if active.dashboard.description.present? %>
+                <p class="small"><%= h active.dashboard.description -%></p>
+                <% end %>
+              </td>
               <% if is_admin %>
               <td>
                 <%= boolean_icon(active.dashboard.shared, {:display_false => false}) -%>