clean big tables forms

This commit is contained in:
Aurélien Delobelle 2017-05-19 16:42:26 +02:00
parent 4344b7d537
commit c11c3f84ed
12 changed files with 67 additions and 55 deletions

View file

@ -539,11 +539,7 @@ class OrderArticleForm(forms.Form):
self.category = kwargs['initial']['category']
self.category_name = kwargs['initial']['category__name']
self.box_capacity = kwargs['initial']['box_capacity']
self.v_s1 = kwargs['initial']['v_s1']
self.v_s2 = kwargs['initial']['v_s2']
self.v_s3 = kwargs['initial']['v_s3']
self.v_s4 = kwargs['initial']['v_s4']
self.v_s5 = kwargs['initial']['v_s5']
self.v_all = kwargs['initial']['v_all']
self.v_moy = kwargs['initial']['v_moy']
self.v_et = kwargs['initial']['v_et']
self.v_prev = kwargs['initial']['v_prev']

View file

@ -33,10 +33,8 @@ textarea {
.table {
margin-bottom:0;
border-bottom:1px solid #ddd;
}
.table {
width:100%;
background-color: #FFF;
}
.table td {
@ -70,6 +68,11 @@ textarea {
padding:8px 30px;
}
.table-responsive {
border: 0;
margin-bottom: 0;
}
.btn {
transition: background-color, color;
transition-duration: 0.15s;

View file

@ -51,6 +51,15 @@
box-shadow: inset 0 5px 5px -5px #000;
}
@media (max-width: 767px) {
.navbar-nav > li:hover > a,
.navbar-nav > li > a:focus,
.nav .open > a:hover,
.nav .open > a:focus {
box-shadow: inset 0 5px 5px -5px #000, inset 0 -5px 5px -5px #000;
}
}
.navbar-nav .dropdown .dropdown-menu {
padding: 0;
border: 0;

View file

@ -11,10 +11,9 @@
{% block content %}
{% include 'kfet/base_messages.html' %}
<div class="row">
<div class="col-sm-12 col-md-8 col-md-offset-2 nopadding">
{% include 'kfet/base_messages.html' %}
<div class="content-center content-form">
<form action="" method="post" class="account_create">
{% csrf_token %}

View file

@ -12,10 +12,9 @@
{% block content %}
{% include "kfet/base_messages.html" %}
<div class="row">
<div class="col-sm-12 col-md-8 col-md-offset-2 nopadding">
{% include "kfet/base_messages.html" %}
<div class="content-center content-form">
<form action="" method="post" class="form-horizontal">
{% csrf_token %}

View file

@ -22,10 +22,9 @@
{% block content %}
{% include "kfet/base_messages.html" %}
<div class="row">
<div class="col-sm-12 col-md-8 col-md-offset-2 nopadding">
{% include "kfet/base_messages.html" %}
<div class="content-center content-form">
<form action="" method="post" class="form-horizontal">
{% csrf_token %}

View file

@ -1,7 +1,6 @@
{% include "kfet/base_messages.html" %}
<div class="row">
<div class="col-sm-12 col-md-8 col-md-offset-2 nopadding">
{% include "kfet/base_messages.html" %}
<div class="content-center content-form">
<form action="" method="post" class="form-horizontal">
{% csrf_token %}

View file

@ -15,7 +15,7 @@
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<li class="hidden-xs">
<a href="{% url 'kfet.home' %}">
<span class="glyphicon glyphicon-home"></span>
</a>

View file

@ -10,9 +10,9 @@
{% block content %}
{% include 'kfet/base_messages.html' %}
<div class="row">
<div class="col-sm-12 col-md-8 col-md-offset-2 nopadding">
<div class="col-sm-12 col-md-10 col-md-offset-1 nopadding">
{% include 'kfet/base_messages.html' %}
<div class="content-center">
<div class="content-right-block">
<h2>Carte</h2>

View file

@ -12,11 +12,12 @@
{% block content %}
{% include 'kfet/base_messages.html' %}
<div class="row">
<div class="col-sm-12 col-md-8 col-md-offset-2 nopadding">
<div class="col-sm-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 nopadding">
{% include 'kfet/base_messages.html' %}
<div class="content-center">
<form id='inventoryform' action="" method="post">
<div class="table-responsive">
<table class="table table-condensed text-center">
<thead>
<tr>
@ -76,6 +77,7 @@
</tr>
</tbody>
</table>
</div>
{{ formset.management_form }}
{% if not perms.kfet.add_inventory %}
<div class='auth-form form-horizontal'>

View file

@ -6,28 +6,31 @@
{% block content %}
<div class="content-center">
<div>
<div class="row">
<div class="col-sm-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 nopadding">
{% include "kfet/base_messages.html" %}
<div class="content-center">
<form action="" method="post">
{% csrf_token %}
<table class="table text-center">
<div class="table-responsive">
<table class="table table-condensed text-center">
<thead>
<tr>
<td rowspan="2">Article</td>
<td colspan="5">Ventes
<span class='glyphicon glyphicon-question-sign' title="Ventes des 5 dernières semaines" data-placement="bottom"></span>
</td>
<td rowspan="2">V. moy.
<td rowspan="2">V. moy.<br>
<span class='glyphicon glyphicon-question-sign' title="Moyenne des ventes" data-placement="bottom"></span>
</td>
<td rowspan="2">E.T.
<td rowspan="2">E.T.<br>
<span class='glyphicon glyphicon-question-sign' title="Écart-type des ventes" data-placement="bottom"></span>
</td>
<td rowspan="2">Prév.
<td rowspan="2">Prév.<br>
<span class='glyphicon glyphicon-question-sign' title="Prévision de ventes" data-placement="bottom"></span>
</td>
<td rowspan="2">Stock</td>
<td rowspan="2">Rec.
<td rowspan="2">Rec.<br>
<span class='glyphicon glyphicon-question-sign' title="Quantité conseillée" data-placement="bottom"></span>
</td>
<td rowspan="2">Commande</td>
@ -51,21 +54,20 @@
<tr>
{{ form.article }}
<td>{{ form.name }}</td>
<td>{{ form.v_s1 }}</td>
<td>{{ form.v_s2 }}</td>
<td>{{ form.v_s3 }}</td>
<td>{{ form.v_s4 }}</td>
<td>{{ form.v_s5 }}</td>
{% for v_chunk in form.v_all %}
<td>{{ v_chunk }}</td>
{% endfor %}
<td>{{ form.v_moy }}</td>
<td>{{ form.v_et }}</td>
<td>{{ form.v_prev }}</td>
<td>{{ form.stock }}</td>
<td>{{ form.c_rec }}</td>
<td>{{ form.quantity_ordered | add_class:"form-control" }}</td>
<td class="nopadding">{{ form.quantity_ordered | add_class:"form-control" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{{ formset.management_form }}
{% if not perms.kfet.add_inventory %}
<div class='auth-form form-horizontal'>
@ -75,6 +77,7 @@
<input type="submit" value="Enregistrer" class="btn btn-primary btn-lg btn-block">
</form>
</div>
</div>
</div>
<script type='text/javascript'>

View file

@ -1,18 +1,19 @@
{% extends 'kfet/base.html' %}
{% load widget_tweaks %}
{% block title %}{% endblock %}
{% block content-header-title %}{% endblock %}
{% block title %}Nouvel inventaire{% endblock %}
{% block content-header-title %}Création d'inventaire depuis une commande{% endblock %}
{% block content %}
{% include 'kfet/base_messages.html' %}
<div class="content-center">
<div>
<div class="row">
<div class="col-sm-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 nopadding">
{% include "kfet/base_messages.html" %}
<div class="content-center">
<form action="" method="post">
{% csrf_token %}
<table class='table text-center'>
<div class="table-responsive">
<table class='table table-condensed text-center'>
<thead>
<tr>
<td style="width:25%">Article</td>
@ -25,23 +26,24 @@
</thead>
<tbody>
{% for form in formset %}
{% ifchanged form.category %}
<tr class='section'>
<td>{{ form.category_name }}</td>
<td colspan="5"></td>
</tr>
{% endifchanged %}
<tr>
{{ form.article }}
<td>{{ form.name }}</td>
<td>{{ form.price_HT | add_class:"form-control" }}</td>
<td>{{ form.TVA | add_class:"form-control" }}</td>
<td>{{ form.rights | add_class:"form-control" }}</td>
<td>{{ form.quantity_ordered }}</td>
<td>{{ form.quantity_received | add_class:"form-control" }}</td>
{% ifchanged form.category %}
<tr class='section'>
<td>{{ form.category_name }}</td>
<td colspan="5"></td>
</tr>
{% endifchanged %}
<tr>
<td>{{ form.name }}</td>
<td class="nopadding">{{ form.price_HT | add_class:"form-control" }}</td>
<td class="nopadding">{{ form.TVA | add_class:"form-control" }}</td>
<td class="nopadding">{{ form.rights | add_class:"form-control" }}</td>
<td>{{ form.quantity_ordered }}</td>
<td class="nopadding">{{ form.quantity_received | add_class:"form-control" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{{ formset.management_form }}
{% if not perms.kfet.add_inventory %}
<div class='auth-form form-horizontal'>
@ -51,6 +53,7 @@
<input type="submit" value="Enregistrer" class="btn btn-primary btn-lg btn-block">
</form>
</div>
</div>
</div>
{% endblock %}