<%
  unless defined?(show_menu_items)
    show_menu_items = true
  end

  zooms = { 'day' => 'calendar-day', 'week' => 'calendar-week', 'month' => 'calendar-month' }
%>
<span id="close_all_something">
  <a id="button_close_all_projects" title="<%= l(:close_all, scope: [:easy_gantt, :button])+' '+l(:label_project_plural) %>" class="gantt-button-symbol icon-folder" href="javascript:void(0)"></a>
  <a id="button_close_all_milestones" title="<%= l(:close_all, scope: [:easy_gantt, :button])+' '+l(:label_version_plural) %>" class="gantt-button-symbol gantt-icon-milestone" href="javascript:void(0)"></a>
  <a id="button_close_all_parent_issues" title="<%= l(:close_all, scope: [:easy_gantt, :button])+' '+l(:label_parent_issue_plural) %>" class="gantt-button-symbol gantt-icon-parent-issue" href="javascript:void(0)"></a>
</span>
<div id="supertop_panel" class="gantt-supertop-panel easy-gantt__supertop-panel clear"></div>
<div id="easy_gantt_menu" class="easy-gantt__menu clear">
  <div class="push-left">
    <% if Rails.env.development? %>
      <%= easy_gantt_js_button l(:button_test), id: 'button_test' %>
    <% end %>

    <%= easy_gantt_js_button('&#8203;'.html_safe, id: 'button_jump_today', title: l(:jump_today, scope: [:easy_gantt, :title]), icon: 'icon-calendar') %>

    <% zooms.each do |name, icon| %>
      <%= easy_gantt_js_button(:"#{name}_zoom", id: "button_#{name}_zoom", icon: "icon-#{icon}") %>
    <% end %>
  </div>

  <div class="push-right">
    <% if show_menu_items %>
      <%= easy_gantt_js_button(:problem_finder, {
          url: 'javascript:void(0)',
          id: 'button_problem_finder',
          class: 'problem-finder',
          no_button: true
      }) %>
      <div class="easy-gantt__menu-group easy-gantt__menu-group--tooltiped easy-gantt__menu-tools">
        <a href="javascript:void(0)" class="button gantt-menu-button icon icon-settings easy-gantt__menu-tools-button"><%= l(:tool_panel, :scope => [:easy_gantt, :button]) %></a>
        <ul id="easy_gantt_tool_panel" class="easy-gantt__menu-item">
          <% menu_items_for(:easy_gantt_tools, @project) do |node| %>
            <li>
              <%
                opts = node.html_options.dup
                opts[:url] = (node.url.is_a?(Proc) ? node.url.call(@project) : node.url)
                opts[:id] = "button_#{node.name}"
                opts[:no_button] = 'true'

                caption = opts[:caption].is_a?(Proc) ? opts[:caption].call(params[:gantt_type]) : node.caption
              %>
              <% if opts.delete(:trial) %>
                <%= easy_gantt_help_button(node.name, caption, opts) %>
              <% else %>
                <%= easy_gantt_js_button(caption, opts) %>
              <% end %>
            </li>
          <% end %>
        </ul>
      </div>
      <%= easy_gantt_js_button(l(:button_save), {
          url: 'javascript:void(0)',
          id: 'button_save',
          no_button: true,
          class: 'button-positive button-1 icon icon-save'
      }) %>
    <% end %>
  </div>
  <%= call_hook(:view_easy_gantts_issues_toolbars, project: @project) %>
</div>

<!-- This is container for gantt -->
<div id="gantt_cont" style="width: 100%;" class="clear"></div>
<!-- End container for gantt -->
