!!!
%html{:lang => "fr"}
  %head
    %meta{:charset => "utf-8"}/
    %meta{:content => "IE=Edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
    %title= @title || "Admin"
    = csrf_meta_tags
    = stylesheet_link_tag :admin, :media => :all
    = javascript_include_tag "admin"
    = javascript_include_tag "https://maps.google.com/maps/api/js?sensor=false&region=FR"

  





%body.admin
  %nav#admin_nav.navbar.navbar-default.navbar-inverse{role: "navigation"}
    .container-fluid

      .navbar-header
        %button.navbar-toggle{"data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", type: "button"}
          %span.sr-only Toggle navigation
          %span.icon-bar
          %span.icon-bar
          %span.icon-bar
        %a.navbar-brand{href: "/admin"}
          =ic :home

      #bs-example-navbar-collapse-1.collapse.navbar-collapse
        %ul.nav.navbar-nav






          - customers_to_validate = Customer.where('account_validated IS NULL ').count
          - if customers_to_validate > 0
            %li= link_to content_tag(:span,customers_to_validate , style:"background-color:#D9534F", class: 'badge') + " Clients", admin_customers_path
          -else
            %li= link_to "Clients", admin_customers_path
          - unvalidated_need_count = Need.where(state: 'created').count
          -if unvalidated_need_count > 0
            %li= link_to content_tag(:span,unvalidated_need_count , style:"background-color:#D9534F", class: 'badge') + " Besoins", admin_needs_path
          -else
            %li= link_to " Besoins", admin_needs_path

          %li= link_to " Catégories", admin_need_categories_path
          %li= link_to " Domaines", admin_domains_path
          %li= link_to " Offres", admin_offers_path
          - unread_messages = ContactMessage.where(read_by_admin: false).count
          -if unread_messages > 0
            %li=link_to content_tag(:span,unread_messages , style:"background-color:#D9534F", class: 'badge') + " Contacts", admin_conversations_path
          -else
            %li= link_to " Contacts", admin_conversations_path
          %li= link_to "Moniteur d'activité", admin_connected_customers_path
          %li= link_to "Réseaux", admin_reseauxes_path
          
          %li.dropdown
            %a{:href => "#", :class => "dropdown-toggle", :data => {:toggle => "dropdown"}}
              Boutique
              %b.caret
            %ul.dropdown-menu
              %li= link_to "Catégories", admin_product_categories_path
              %li= link_to "Produits", admin_products_path
              %li= link_to "Tailles", admin_product_sizes_path
              %li= link_to "Commandes", admin_product_orders_path
              %li= link_to "Fournisseurs", admin_fournisseurs_path
              %li= link_to "Type de documents", admin_product_order_document_types_path
              %li=# link_to "Codes de reduction", admin_vourcher_codes_path
          
          
        %ul.nav.navbar-nav.navbar-right
          %li.dropdown
            %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
              =current_admin.firstname
              =current_admin.name
              %b.caret

            %ul.dropdown-menu
              %li= link_to "Gestion des admins", admin_admins_path
              %li.divider
              %li=link_to "Se déconnecter", logout_admin_admin_auths_path






  .container-fluid

    = yield



  #flashs= bootstrap_flash
