<div class="page">
  <header class="page-header">
    <h1 class="page-title"><%= message('dashboard.global_dashboards') -%></h1>
    <p class="page-description"><%= message('dashboard.global_dashboards.description') -%></p>
  </header>

  <%= render :partial => 'list', :locals => {:active_dashboards => @actives.select(&:global?), :group => 'activeGlobal'} %>

  <header class="page-header">
    <h1 class="page-title"><%= message('dashboard.project_dashboards') -%></h1>
    <p class="page-description"><%= message('dashboard.project_dashboards.description') -%></p>
  </header>

  <%= render :partial => 'list', :locals => {:active_dashboards => @actives.reject(&:global?), :group => 'activeProject'} %>

  <header class="page-header">
    <h1 class="page-title"><%= message('dashboard.shared_dashboards') -%></h1>
    <p class="page-description"><%= message('dashboard.shared_dashboards.description') -%></p>
  </header>

  <table class="data" id="shared">
    <thead>
    <tr>
      <th class="name"><%= message('name') -%></th>
      <th class="owner"><%= message('shared_by') -%></th>
      <th class="global"><%= message('global') -%></th>
      <th class="text-right"><%= message('operations') -%></th>
    </tr>
    </thead>
    <tbody>
    <% if @shared_dashboards.empty? %>
      <tr class="even">
        <td colspan="4"><%= message('dashboard.no_dashboard') -%></td>
      </tr>
    <% else %>
      <% @shared_dashboards.each do |dashboard| %>
        <tr class="<%= cycle('even', 'odd') -%>">
          <td>
            <div><%= h(dashboard.name(true)) -%></div>
            <div class="description"><%= dashboard.description -%></div>
          </td>
          <td class="owner">
            <%= h(dashboard.user_name || message('dashboard.username.default')) -%>
          </td>
          <td class="global">
            <%= boolean_icon(dashboard.global) -%>
          </td>
          <td class="thin nowrap text-right">
            <%= link_to 'Add to defaults', {:action => 'add', :id => dashboard.id}, {:method => :post, :id => "add-#{u dashboard.name}", :class => 'link-action'} %>
          </td>
        </tr>
      <% end %>
    <% end %>
    </tbody>
  </table>
</div>

