{% extends "base.html" %}
{% load static %}

{% block additionnal_css %}
<link rel="stylesheet" href="{% static 'css/datatables/datatables.min.css' %}">
<link rel="stylesheet" href="{% static 'css/datatables/responsive.min.css' %}">
<link rel="stylesheet" href="{% static 'css/shelfs_admin.css' %}">

{% endblock %}

{% block additionnal_scripts %}
  <script type="text/javascript" src="{% static 'js/download.js' %}"></script>
  <script type="text/javascript" src="{% static 'js/datatables/datatables.min.js' %}"></script>
  <script type="text/javascript" src="{% static 'js/datatables/datatables.customized_cellEdit.js' %}"></script>
  <script type="text/javascript" src="{% static 'js/datatables/datatables.responsive.min.js' %}"></script>
  <script type="text/javascript" src="{% static 'js/datatables/datatables.buttons.min.js' %}"></script>
  <script type="text/javascript" src="{% static 'js/datatables/dom_sort.js' %}"></script>
  <script type="text/javascript" src="{% static 'js/datatables/buttons.html5.min.js' %}"></script>
  <script type="text/javascript" src="{% static 'js/jquery.pos.js' %}"></script>

{% endblock %}

{% block content %}
  {% include "common/conn_admin.html" %}

  <div class="header txtcenter">
  <h1>Gestion des rayons</h1>
  </div>
  <div id="need_connect">Vous devez vous connecter avec un compte Odoo pour accéder à la gestion des rayons</div>
  <div id="content_wrapper" style="display:none;">
      <div id="main-content">

      </div>

  </div>


  <div id="templates" style="display:none;">
   <div id="create_form">
        <input type="text" name="shelf_id" value="" hidden>
        <p><label for="sort_order">Numéro : </label> <input type="text" name="sort_order" value="" placeholder="Numéro"></p>
        <p><label for="name">Nom : </label> <input type="text" name="name" value="" placeholder="Nom"></p>
        <p><label for="description">Description : </label> <textarea name="description" placeholder="Description/Remarque"></textarea></p>
   </div>
   <div id="destroy-shelf-msg">
        Vous avez demandé de détruire le rayon <span class="shelf"></span>.<br/>
        Si vous le confirmez, l'action sera irreversible.
   </div>
   <div id="adding-products">
      <button type="button" onclick="backToMain()">Retour</button>
      <div class="fr add-search" style="display: none;">
        Ajout par recherche <span class="open"><i class="fas fa-eye"></i></span><span class="close"><i class="fas fa-eye-slash" style="display: none;"></i></span>
        <div class="input-search-wrapper" style="display: none;">
          <input type="text" name="kw" /> <button type="button" class="btn--primary">Ok</button>
        </div>
      </div>
      <h1>Ajout de produits dans <span class="shelf"></span></h1>

      <table id="added_products">
        <thead>
          <tr>
            <th>Code-barre lu</th>
            <th>Code-barre Odoo</th>
            <th>Article</th>
            <th>Action</th>
          </tr>
        </thead>
        <tbody>

        </tbody>
      </table>
      <button type="button" class="btn--primary add-products"></button>
   </div>
   <div id="main-table-wrap">
    <table class="display shelfs" width="99%" cellspacing="0" ></table>
    <button type="button" class="btn--primary create">CRÉER</button>
   </div>
  </div>

  <input type="hidden" name="barcode"/>
  <script type="text/javascript">
    try {
    var admin_ids = {{ADMINS}}
    } catch(e) {

    }
  </script>
  <script src='{% static "js/all_common.js" %}?v='></script>
  <script src='{% static "js/barcodes.js" %}?v='></script>
  <script src='{% static "js/shelfs_admin.js" %}?v='></script>


{% endblock %}
