aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-10-28 11:37:59 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-10-28 11:37:59 +0000
commitf1c7ed956b431928cfd126342b83515dd845eefc (patch)
treed105ce3c15f81f084e7943c741a46ae4ae92f7f2 /sonar-server
parent47b94087e3c4b7b3b0f7368bc01a95840c145712 (diff)
downloadsonarqube-f1c7ed956b431928cfd126342b83515dd845eefc.tar.gz
sonarqube-f1c7ed956b431928cfd126342b83515dd845eefc.zip
SONAR-1643 manage default dashboards for anonymous users
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb12
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb7
4 files changed, 16 insertions, 11 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb
index 7824a235adc..bd97167f741 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb
@@ -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
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
index 4fc1e09562e..a2d7f67dcf0 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
@@ -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
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb
index aade1013455..3598fc416f0 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb
@@ -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>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
index 027299e3d03..913b361d6a2 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
@@ -20,7 +20,12 @@
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}) -%>