<!DOCTYPE html>
<html lang="<%= current_language %>">
<head>
<meta charset="utf-8" />
<title><%= html_title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.13.2', 'tribute-5.1.3', 'application', 'responsive', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_importmap_tags %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= heads_for_i18n %>
<%= heads_for_auto_complete(@project) %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<body class="<%= body_css_classes %>" data-text-formatting="<%= Setting.text_formatting %>">
<%= call_hook :view_layouts_base_body_top %>
<div id="wrapper">

<div class="flyout-menu js-flyout-menu">

    <% if User.current.logged? || !Setting.login_required? %>
        <div class="flyout-menu__search">
            <%= form_tag(search_path(id: @project), :method => :get ) do %>
            <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
            <%= label_tag 'flyout-search', sprite_icon('search', l(:label_search), icon_only: true), :class => 'search-magnifier search-magnifier--flyout' %>
            <%= text_field_tag 'q', @question, :id => 'flyout-search', :class => 'small js-search-input', :placeholder => l(:label_search) %>
            <% end %>
        </div>
    <% end %>

    <% if User.current.logged? %>
        <div class="flyout-menu__avatar">
          <%= link_to(avatar(User.current, :size => "40"), user_path(User.current)) %>
          <%= link_to_user(User.current, :format => :username) %>
        </div>
    <% end %>

    <% if display_main_menu?(@project) %>
        <h3><%= l(:label_project) %></h3>
        <span class="js-project-menu"></span>
    <% end %>

    <h3><%= l(:label_general) %></h3>
    <span class="js-general-menu"></span>

    <span class="js-sidebar flyout-menu__sidebar"></span>

    <h3><%= l(:label_profile) %></h3>
    <span class="js-profile-menu"></span>

</div>


<div id="top-menu">
    <div id="account">
        <%= render_menu :account_menu -%>
    </div>
    <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
    <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
</div>

<div id="header">

    <a href="#" class="mobile-toggle-button js-flyout-menu-toggle-button"></a>

    <% if User.current.logged? || !Setting.login_required? %>
    <div id="quick-search">
        <%= form_tag(search_path(id: @project), :method => :get ) do %>
        <%= hidden_field_tag 'scope', default_search_project_scope, :id => nil %>
        <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
        <label for='q'>
          <%= link_to l(:label_search), search_path(id: @project, :scope => default_search_project_scope), :accesskey => accesskey(:search) %>:
        </label>
        <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search),
                            :data => {
                                :auto_complete => true
                            } %>
        <% end %>
        <%= render_project_jump_box %>
    </div>
    <% end %>

    <h1><%= page_header_title %></h1>

    <% if display_main_menu?(@project) %>
    <div id="main-menu" class="tabs">
        <%= render_main_menu(@project) %>
        <div class="tabs-buttons" style="display:none;">
            <button class="tab-left icon-only" onclick="moveTabLeft(this); return false;">
              <%= sprite_icon("angle-left", rtl: true) %>
            </button>
            <button class="tab-right icon-only" onclick="moveTabRight(this); return false;">
              <%= sprite_icon("angle-right", rtl: true) %>
            </button>
        </div>
    </div>
    <% end %>
</div>

<div id="main" class="<%= sidebar_content? ? 'collapsiblesidebar' : 'nosidebar' %>">
  <%= javascript_tag "$('#main.collapsiblesidebar').collapsibleSidebar();" if sidebar_content? %>
    <div id="sidebar">
        <% if sidebar_content? %>
          <div id="sidebar-switch-panel" style="visibility: hidden;">
            <a id="sidebar-switch-button" class="" href="#">
              <%= sprite_icon("chevrons-right", size: 20, rtl: true) %></a>
          </div>
          <%= javascript_tag "$('#sidebar-switch-panel').css('visibility', 'visible');" %>
        <% end %>
        <div id="sidebar-wrapper">
          <%= yield :sidebar %>
          <%= view_layouts_base_sidebar_hook_response %>
        </div>
    </div>

    <div id="content">
        <%= render_flash_messages %>
        <%= yield %>
        <%= call_hook :view_layouts_base_content %>
        <div style="clear:both;"></div>
    </div>
</div>
<div id="footer">
    Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url, :target => '_blank', :rel => 'noopener' %> &copy; 2006-2026 Jean-Philippe Lang
</div>

<div id="ajax-indicator" style="display:none;">
  <span class="icon">
    <%= sprite_icon 'loader', l(:label_loading), css_class: 'svg-loader' %>
  </span>
</div>
<div id="ajax-modal" style="display:none;"></div>
<div id="icon-copy-source" style="display: none;"><%= sprite_icon('') %></div>

</div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>
