Commit 16387e04 by Damien Moulard Committed by Alexis Aoun

sync with couchdb to keep data

parent 2063ad4f
...@@ -2,16 +2,56 @@ ...@@ -2,16 +2,56 @@
position: relative; position: relative;
} }
#form_container { .page_content {
margin-top: 30px; position: absolute;
top: 0;
left: 0;
right: 0;
} }
#products_table_filter{ /* - Common */
text-align: right !important;
/* - Order selection screen */
#new_order_form {
margin-top: 20px;
margin-bottom: 30px;
} }
#products_table_filter input{ #existing_orders {
height: 40px; display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
width: 80%;
margin: 0 auto;
padding-top: 20px;
}
.order_pill {
border-radius: 30px;
min-width: 200px;
min-height: 40px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 8px;
margin: 0 10px 5px 0;
}
/* - Main screen */
/* -- Top right action button(s) */
#actions_buttons_area {
position: absolute;
top: 0;
right: 0;
}
/* -- Supplier form */
#supplier_form_container {
margin-top: 30px;
} }
#supplier_input { #supplier_input {
...@@ -20,17 +60,13 @@ ...@@ -20,17 +60,13 @@
border-radius: 5px; border-radius: 5px;
} }
.product_qty_input { /* -- Table */
width: 100px; #products_table_filter{
} text-align: right !important;
.product_not_from_supplier {
background-color: #e7e9ed;
cursor: pointer;
} }
.product_name, .supplier_name { #products_table_filter input{
font-weight: bold; height: 40px;
} }
#table_header_select_all{ #table_header_select_all{
...@@ -44,10 +80,24 @@ ...@@ -44,10 +80,24 @@
margin-left: 5px; margin-left: 5px;
} }
.product_qty_input {
width: 100px;
}
.product_not_from_supplier {
background-color: #e7e9ed;
cursor: pointer;
}
.product_name, .supplier_name {
font-weight: bold;
}
.select_product_cb { .select_product_cb {
cursor: pointer; cursor: pointer;
} }
/* -- Suppliers list */
#suppliers_container { #suppliers_container {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -74,9 +124,3 @@ ...@@ -74,9 +124,3 @@
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
} }
\ No newline at end of file
#actions_buttons_area {
position: absolute;
top: 0;
right: 0;
}
...@@ -16,6 +16,8 @@ def index(request): ...@@ -16,6 +16,8 @@ def index(request):
def helper(request): def helper(request):
context = { context = {
'title': 'Aide à la commande', 'title': 'Aide à la commande',
'couchdb_server': settings.COUCHDB['url'],
'db': settings.COUCHDB['dbs']['orders']
} }
template = loader.get_template('orders/helper.html') template = loader.get_template('orders/helper.html')
......
...@@ -19,7 +19,8 @@ COUCHDB = { ...@@ -19,7 +19,8 @@ COUCHDB = {
'member': 'coops', 'member': 'coops',
'inventory': 'inventory', 'inventory': 'inventory',
'envelops': 'envelop', 'envelops': 'envelop',
'shop': 'shopping_carts' 'shop': 'shopping_carts',
'orders': 'orders_test'
} }
} }
......
...@@ -15,6 +15,20 @@ ...@@ -15,6 +15,20 @@
{% block content %} {% block content %}
<div class="page_body"> <div class="page_body">
<div id="select_order_content" class="page_content txtcenter">
<h2>Créer une nouvelle commande</h2>
<form id="new_order_form">
<input type="text" id="new_order_name" placeholder="Nom de la commande...">
<button type="submit" class="btn btn--primary">Valider</button>
</form>
<h2>Ou, continuer une commande existante</h2>
<div id="existing_orders"></div>
</div>
<div id="main_content" class="page_content" style="display:none;">
<div id="back_to_order_selection">
<button type="button" class="btn--danger"><i class="fas fa-arrow-left"></i>&nbsp; Retour</button>
</div>
<div id="actions_buttons_area"> <div id="actions_buttons_area">
<button type="button" class='btn--primary' id="do_inventory">Faire un inventaire</button> <button type="button" class='btn--primary' id="do_inventory">Faire un inventaire</button>
</div> </div>
...@@ -23,7 +37,7 @@ ...@@ -23,7 +37,7 @@
<h1>Aide à la commande</h1> <h1>Aide à la commande</h1>
</div> </div>
<div class="txtcenter" id="form_container"> <div class="txtcenter" id="supplier_form_container">
<form action="javascript:;" id="supplier_form"> <form action="javascript:;" id="supplier_form">
<input type="text" name="supplier" id="supplier_input" placeholder="Rechercher un fournisseur par son nom"> <input type="text" name="supplier" id="supplier_input" placeholder="Rechercher un fournisseur par son nom">
<button type="submit" class='btn--primary'>Ajouter le fournisseur</button> <button type="submit" class='btn--primary'>Ajouter le fournisseur</button>
...@@ -37,10 +51,10 @@ ...@@ -37,10 +51,10 @@
<table id="products_table" class="display" cellspacing="0" width="100%"></table> <table id="products_table" class="display" cellspacing="0" width="100%"></table>
</div> </div>
</div> </div>
</div> </div>
<div id="templates" style="display:none;"> <div id="templates" style="display:none;">
<div id="supplier_pill"> <div id="supplier_pill_template">
<div class="supplier_pill"> <div class="supplier_pill">
<div class="supplier_name_container"> <div class="supplier_name_container">
<span class="pill_supplier_name"></span> <span class="pill_supplier_name"></span>
...@@ -49,6 +63,12 @@ ...@@ -49,6 +63,12 @@
</div> </div>
</div> </div>
<div id="order_pill_template">
<div class="pill order_pill btn btn--primary">
<span class="pill_order_name"></span>
</div>
</div>
<div id="modal_remove_supplier"> <div id="modal_remove_supplier">
<h3>Attention !</h3> <h3>Attention !</h3>
<p> <p>
...@@ -77,8 +97,15 @@ ...@@ -77,8 +97,15 @@
<p>Êtez-vous sûr ?</p> <p>Êtez-vous sûr ?</p>
<hr/> <hr/>
</div> </div>
</div>
</div> </div>
<script src="{% static "js/pouchdb.min.js" %}"></script>
<script type="text/javascript">
var couchdb_dbname = '{{db}}';
var couchdb_server = '{{couchdb_server}}' + couchdb_dbname;
</script>
<script src="{% static "js/all_common.js" %}?v="></script> <script src="{% static "js/all_common.js" %}?v="></script>
<script type="text/javascript" src="{% static 'js/orders_helper.js' %}?v="></script> <script type="text/javascript" src="{% static 'js/orders_helper.js' %}?v="></script>
{% endblock %} {% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment