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})
private
- def load_active_dashboards
- @actives=ActiveDashboard.default_active_dashboards
+ def load_default_dashboards
+ @actives=ActiveDashboard.default_dashboards
end
end
else
# TODO explicit error
end
- redirect :action => 'index', :resource => params[:resource]
+ redirect_to :action => 'index', :resource => params[:resource]
end
def delete
<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>
</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>
<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>
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}) -%>