<header class="page-header">
  <h1 class="page-title"><%= h @dashboard.name(true) -%></h1>


  <div class="page-actions operations noprint">
    <% if @snapshot %>
      <% if @snapshot.project_snapshot.periods? %>
        <% period_options = period_select_option_tags(@snapshot, 'small') %>
        <% if period_options %>
          <form method="GET" action="<%= url_for :controller => :dashboard, :action => :index, :id => @resource.id -%>" style="display: inline" class="spacer-left">
            <input type="hidden" name="did" value="<%= @dashboard.id -%>"/>
            <%= dropdown_tag 'period', period_options, {:width => '250px'}, {:id => 'select-comparison', :onchange => 'submit()'} -%>
          </form>
        <% end %>
      <% end %>
    <% end %>

    <% if logged_in? %>
      <div class="button-group">
        <% if back %>
          <%= link_to message('dashboard.back_to_dashboard'), dashboard_action(:index), :class => 'button' -%>
        <% else %>
          <% if @dashboard.editable_by?(current_user) %>
            <%= link_to message('dashboard.configure_widgets'), dashboard_action(:configure), :class => 'button' -%>
          <% end %>
        <% end %>
      </div>
    <% end %>
  </div>
</header>
