<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <title><%= title %></title>
    <%= render 'layouts/datalayer' %>
    <%= render 'layouts/google_tag_manager_head' %>
    <%= render 'layouts/default_headers' %>
    <link rel="stylesheet" href="https://unpkg.com/vue-multiselect@2.1.0/dist/vue-multiselect.min.css">
  </head>

  <body class="smart-style-2 fixed-header <%= controller_name %>">
    <%= render 'layouts/google_tag_manager_body' %>

    <div id="page-loading" class="hidden">
      <i class="fa fa-cog fa-spin"></i>
      Carregando ...
    </div>

    <header id="header" style="height: 77px; background-color: #27333B;">
      <div id="logo-group" style="margin-top: 10px; margin-left: 10px;">
        <%= link_to image_tag(
            logo_url,
            height: '57px',
            alt: current_entity_configuration.try(:entity_name),
            style: 'background-color: white; border-radius: 3px;'
          ), root_path %>
      </div>

      <%= render "layouts/profile_selection" %>

      <div class="pull-right" style="margin-top: 15px;">
        <% if user_signed_in? %>
          <div id="hide-menu" class="btn-header pull-right">
            <span>
              <a href="javascript:void(0);" data-action="toggleMenu" title="Exibir/Esconder o Menu">
                <i class="fa fa-reorder"></i>
              </a>
            </span>
          </div>
          <%= render 'layouts/system_notifications' %>
        <% end %>
      </div>
    </header>

    <%= render 'layouts/navigation' %>

    <div id="main" role="main">
      <div id="ribbon" style="padding-left: 15px; padding-top: 15px;">
        <%= breadcrumbs %>
      </div>

      <%= yield :back_link %>

      <div id="content">
        <div id="flash-messages">
          <%= bootstrap_flash %>
        </div>

        <section id="widget-grid" class="">
          <div class="row">
            <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
              <div class="jarviswidget">
                <header>
                  <h2><%= title_with_icon %></h2>
                  <%= yield(:help_button_tag) if content_for?(:help_button_tag) %>
                </header>

                <div id="content-page">
                  <%= yield %>
                </div>
              </div>
            </article>
          </div>
        </section>
      </div>
    </div>

    <div class="page-footer">
      <div class="row">
        <div class="col-xs-12 col-sm-6">
          <span class="txt-color-white"><%= entity_copyright %></span>
        </div>
      </div>
    </div>

    <script type="text/javascript">
      <% if current_user %>
         window.state = <%= raw window_state.to_json %>;
      <% end %>
    </script>

    <%= javascript_include_tag "application" %>
    <%= javascript_pack_tag 'app' %>
    <%= stylesheet_pack_tag 'app' %>

    <%= yield :js %>
  </body>
</html>
