<!DOCTYPE html>
<html>
  <head>
    <title><%= @page.blank? ? 'Kaktusiarnia' : "Kakrusiarnia: #{@page.title}" %></title>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <%= csrf_meta_tags %>
    <link rel="shortcut icon" type="image/x-icon" href="/assets/favicon.ico">
    <%= stylesheet_link_tag 'application', 'bootstrap_lte', 'font-awesome' , media: 'all', 'data-turbolinks-track': 'reload' %>
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900,900i&subset=cyrillic,cyrillic-ext,latin-ext" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Dosis:200,300,400,500,600,700,800&amp;subset=latin-ext" rel="stylesheet">
    <%= stylesheet_link_tag 'owl.carousel.min', 'owl.theme.default.min', 'animate', 'swiper', 'default' %>
    <%= javascript_include_tag 'application', 'jquery', 'whcookies', 'data-turbolinks-track': 'reload' %>
    <%= yield :header_scripts %>
  </head>

  <body>
    <div id="undefined-sticky-wrapper" class="sticky-wrapper" style="height: 72px;">
      <div class="navbar yamm navbar-default">
        <div class="container">
          <div class="navbar-header">
            <button type="button" data-toggle="collapse" data-target="#navbar-collapse-3" class="navbar-toggle">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <%= link_to(image_tag('logo_kaktusiarnia.png', width: '160'), 'javascript:void(0);', class: 'navbar-brand') %>
          </div>
          <div id="navbar-collapse-3" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
              <li <%= raw (controller_path.to_s.include?('category') || controller_path.to_s.include?('product') || current_page?(root_url)) ? 'class="active"' : '' %>>
                <a href="/">Home</a>
              </li>
              <!-- Home -->
              <li class="dropdown <%= raw (controller_path.to_s.include?('site') && !current_page?(root_url)) ? ' active' : '' %>">
                <a href="#" data-toggle="dropdown" class="dropdown-toggle">Informacje<i class="fa fa-angle-down ml-5"></i>
                </a>
                <ul role="menu" class="dropdown-menu">
                  <%= raw menu_top(@pages) %>
                </ul>
                <!-- end ul dropdown-menu -->
              </li>
              <!-- end li dropdown -->
              <li>
            </ul>
            <!-- end navbar-nav -->
            <ul class="nav navbar-nav" style="width: 300px;">
              <li>
                <span style="display:block;margin-top: 19px;">
                  <%= form_tag({controller: 'product', action: 'index'}, method: 'get', remote: true) do %>
                  <div class="form-group" style="margin-bottom:0;margin-left:14px;">
                    <div class="input-group">
                      <span class="input-group-addon">
                        <i class="fa fa-search"></i>
                      </span>
                      <%= text_field_tag(:search, params[:search], placeholder: 'Szukaj', class: 'form-control input-md') %>
                    </div>
                  </div>
                <% end %>
              </span>
            </li>
            <!-- end dropdown -->
          </ul>
          <!-- end navbar-right -->

          <ul class="nav navbar-nav navbar-right">
            <li class="right linkdown">
              <a href="javascript:void(0);">
                <i class="fa fa-shopping-basket mr-5"></i>
                <span class="hidden-xs">
                  Koszyk<sup class="text-primary" id="ps_cart_size">(<%= @cart ? @cart.cart_products.size : 0 %>)</sup>
                  <i class="fa fa-angle-down ml-5"></i>
                </span>
              </a>
              <ul class="cart w-300" id="ps_cart_items">
                <%= render '/cart/partials/cart_products' %>
              </ul>
            </li>
          </ul>
        </div>
        <!-- end navbar collapse -->
      </div>
      <!-- end container -->
    </div>
    <!-- end navbar -->
  </div>
  <div class="breadcrumbs">
    <div class="container">
      <div class="row">
        <div class="col-sm-12">
          <ul>
            <%= render_breadcrumbs tag: :li, separator: '' %>
          </ul>
          <!-- end breadcrumb -->
        </div>
        <!-- end col -->
      </div>
      <!-- end row -->
    </div>
    <!-- end container -->
  </div>

  <!-- start section -->
  <section class="section light-backgorund" style="padding: 0;">
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3">
          <div class="navbar-vertical">
            <ul class="nav nav-stacked">
              <li class="header">
                <h6 class="text-uppercase">Kategorie
                  <i class="fa fa-navicon pull-right"></i>
                </h6>
              </li>
                <%= raw render_list_for_categories(@categories_for_menu) %>
              </ul>
            </div>
            <!-- end navbar-vertical -->

            <hr class="spacer-20 no-border">

          </div>
          <!-- end col -->
          <div class="col-sm-9">
            <div class="row">
              <div class="col-sm-12">
                <div id="main_container">
                  <%= yield %>
                </div>
                <hr class="spacer-20 no-border">
              </div>
              <!-- end col -->
            </div>
            <!-- end row -->
          </div>
          <!-- end col -->
        </div>
        <!-- end row -->
      </div>
      <!-- end container -->
    </section>
    <!-- end section -->
    <!-- start footer -->
    <footer class="footer">
      <div class="container">
        <hr class="spacer-30">
        <div class="row text-center">
          <div class="col-sm-12">
            <p class="text-sm">
              <strong>Copyright &copy;
                <%= Date.today.year %>
                <a href="https://firestorm.pl" target="_blank">FireStorm</a>.</strong>
              Wszystkie prawa zastrzeżone</p>
          </div>
          <!-- end col -->
        </div>
        <!-- end row -->
      </div>
      <!-- end container -->
    </footer>
    <%= javascript_include_tag 'bootstrap.min', 'notify', 'jquery.sticky', 'pace.min', 'wow.min', 'owl.carousel.min', 'swiper.min', 'main', 'cart' %>
    <%= yield :footer_scripts %>
  </body>
</html>
