diff --git a/kfet/forms.py b/kfet/forms.py index 09c3a4d0..95e97d56 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -8,7 +8,7 @@ from django.core.exceptions import ValidationError from django.core.validators import MinLengthValidator from django.contrib.auth.models import User, Group, Permission from django.contrib.contenttypes.models import ContentType -from django.forms import modelformset_factory +from django.forms import modelformset_factory, widgets from django.utils import timezone from djconfig.forms import ConfigForm @@ -151,10 +151,24 @@ class UserGroupForm(forms.ModelForm): fields = ['groups'] +class KFetPermissionsField(forms.ModelMultipleChoiceField): + + def __init__(self, *args, **kwargs): + queryset = Permission.objects.filter( + content_type__in=ContentType.objects.filter(app_label="kfet"), + ) + super().__init__( + queryset=queryset, + widget=widgets.CheckboxSelectMultiple, + *args, **kwargs + ) + + def label_from_instance(self, obj): + return obj.name + + class GroupForm(forms.ModelForm): - permissions = forms.ModelMultipleChoiceField( - queryset= Permission.objects.filter(content_type__in= - ContentType.objects.filter(app_label='kfet'))) + permissions = KFetPermissionsField() def clean_name(self): name = self.cleaned_data['name'] @@ -525,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'] diff --git a/kfet/signals.py b/kfet/signals.py index 3dd4d677..e81f264a 100644 --- a/kfet/signals.py +++ b/kfet/signals.py @@ -1,16 +1,18 @@ # -*- coding: utf-8 -*- -from __future__ import (absolute_import, division, - print_function, unicode_literals) -from builtins import * - from django.contrib import messages from django.contrib.auth.signals import user_logged_in from django.core.urlresolvers import reverse from django.dispatch import receiver + @receiver(user_logged_in) def messages_on_login(sender, request, user, **kwargs): - if (not user.username == 'kfet_genericteam' - and user.has_perm('kfet.is_team')): - messages.info(request, 'Connexion en utilisateur partagé ?' % reverse('kfet.login.genericteam'), extra_tags='safe') + if (not user.username == 'kfet_genericteam' and + user.has_perm('kfet.is_team') and + 'k-fet' in request.GET.get('next', '')): + messages.info( + request, + ('Connexion en utilisateur partagé ?' + .format(reverse('kfet.login.genericteam'))), + extra_tags='safe') diff --git a/kfet/static/kfet/css/history.css b/kfet/static/kfet/css/history.css index 976f5782..dff7a455 100644 --- a/kfet/static/kfet/css/history.css +++ b/kfet/static/kfet/css/history.css @@ -9,17 +9,20 @@ #history .day { height:40px; line-height:40px; - background-color:#c8102e; + background-color:rgba(200,16,46,0.9); color:#fff; padding-left:20px; font-size:16px; font-weight:bold; + position:sticky; + top:50px; + z-index:10; } #history .opegroup { height:30px; line-height:30px; - background-color:rgba(200,16,46,0.85); + background-color:rgba(200,16,46,0.75); color:#fff; font-weight:bold; padding-left:20px; diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 0244a57b..15b425e2 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -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,16 @@ textarea { padding:8px 30px; } +.table-responsive { + border: 0; + margin-bottom: 0; +} + +.btn { + transition: background-color, color; + transition-duration: 0.15s; +} + .btn, .btn-lg, .btn-group-lg>.btn { border-radius:0; } @@ -81,19 +89,30 @@ textarea { border:0; } -.btn-primary:hover, .btn-primary.focus, .btn-primary:focus { - background-color:#000; +.btn-primary:hover, +.btn-primary.focus, .btn-primary:focus, +.btn-primary.active.focus, .btn-primary.active:focus, .btn-primary.active:hover, +.btn-primary:active.focus, .btn-primary:active:focus, .btn-primary:active:hover, +.nav-pills>li.active>a, .nav-pills>li.active>a:focus, .nav-pills>li.active>a:hover { + outline: 0; + background-color:rgba(200,16,46,1); color:#FFF; } -.buttons .nav-pills > li > a { - border-radius:0; - border:1px solid rgba(200,16,46,0.9); +.btn-primary[disabled]:hover, +.btn-primary[disabled]:focus { + background-color: #000; + color: #666; } -.buttons .nav-pills > li.active > a { - background-color:rgba(200,16,46,0.9); - background-clip:padding-box; +.nav-pills>li>a { + border-radius:0; +} + +.nav-pills>li>a:focus, .nav-pills>li>a:hover { + outline: 0; + background-color:rgba(200,16,46,1); + color:#FFF; } .row-page-header { @@ -114,26 +133,17 @@ textarea { padding: 0 !important; } -.panel-md-margin{ - background-color: white; - overflow:hidden; - padding-left: 15px; - padding-right: 15px; - padding-bottom: 15px; - padding-top: 1px; -} - -@media (min-width: 992px) { - .panel-md-margin{ - margin:8px; - background-color: white; - } -} - .col-content-left, .col-content-right { padding:0; } +@media (min-width: 768px) { + .col-content-left { + position: sticky; + top:50px; + } +} + .content-left-top { background:#fff; padding:10px 30px; @@ -147,6 +157,14 @@ textarea { display:block; } +.content-left .buttons ul.nav-pills { + margin-bottom:5px; +} + +.content-left .buttons ul.nav-pills li { + margin:0 0 -5px; +} + .content-left-top.frozen-account { background:#000FBA; color:#fff; @@ -179,25 +197,22 @@ textarea { text-align:center; } -.content-right { - margin:0 15px; +@media (min-width: 768px) { + .content-right { + margin: 15px; + } } .content-right-block { - padding-bottom:5px; position:relative; } -.content-right-block:last-child { - padding-bottom:15px; +.content-right-block > *:not(.buttons-title) { + background: #fff; } -.content-right-block > div:not(.buttons-title) { - background:#fff; -} - -.content-right-block-transparent > div:not(.buttons-title) { - background-color: transparent; +.content-right-block > h2 { + background: transparent !important; } .content-right-block .buttons-title { @@ -219,9 +234,8 @@ textarea { .content-right-block h3 { border-bottom: 1px solid #c8102e; - margin: 20px 15px 15px; - padding-bottom: 10px; - padding-left: 20px; + margin: 0px 15px 15px; + padding: 20px 20px 10px; font-size:25px; } @@ -229,20 +243,34 @@ textarea { * Pages tableaux seuls */ -.content-center > div { - background:#fff; +.content-center > *:not(.content-right-block) { + background: #fff; +} + +@media (min-width: 992px) { + .content-center { + margin: 15px 0; + } } .content-center tbody tr:not(.section) td { - padding:0px 5px !important; + padding:0px 5px; } -.content-center .table .form-control { +.table .form-control { padding: 1px 12px ; height:28px; margin:3px 0px; } - .content-center .auth-form { + +.table-condensed input.form-control { + margin: 0 !important; + border-top: 0; + border-bottom: 0; + border-radius: 0; +} + +.content-center .auth-form { margin:15px; } @@ -250,15 +278,12 @@ textarea { * Pages formulaires seuls */ -.form-only .content-form { - margin:15px; - - background:#fff; - - padding:15px; +.content-form { + background-color: #fff; + padding: 15px; } -.form-only .account_create #id_trigramme { +.account_create #id_trigramme { display:block; width:200px; height:80px; @@ -324,6 +349,10 @@ textarea { * Messages */ +.messages { + margin: 0; +} + .messages .alert { padding:10px 15px; margin:0; @@ -561,21 +590,67 @@ thead .tooltip { } } -.help-block { - padding-top: 15px; -} - /* Inventaires */ +#inventoryform input[type=number] { + text-align: center; +} + .inventory_modified { background:rgba(236,100,0,0.15); } .stock_diff { padding-left: 5px; - color:#C8102E; + color:#C8102E; } .inventory_update { - display:none; + display: none; + width: 50px; + margin: 0 auto; +} + +/* Multiple select customizations */ + +.ms-choice { + height: 34px !important; + line-height: 34px !important; + border: 1px solid #ccc !important; + box-shadow: inset 0 1px 1px rgba(0,0,0,.075) !important; +} + +.ms-choice > div { + top: 4px !important; +} + +/* Checkbox select multiple */ + +.checkbox-select-multiple label { + font-weight: normal; + margin-bottom: 0; +} + +/* Statement creation */ + +.statement-create-summary table { + margin: 0 auto; +} + +.statement-create-summary tr td { + text-align: right; +} + +.statement-create-summary tr td:first-child { + padding-right: 15px; + font-weight: bold; +} + +.statement-create-summary tr td:last-child { + width: 80px; +} + +#detail_taken table td, +#detail_balance table td { + padding: 0; } diff --git a/kfet/static/kfet/css/kpsul.css b/kfet/static/kfet/css/kpsul.css index ba88e433..4b60aa7b 100644 --- a/kfet/static/kfet/css/kpsul.css +++ b/kfet/static/kfet/css/kpsul.css @@ -143,7 +143,7 @@ input[type=number]::-webkit-outer-spin-button { height:50px; padding:0 15px; - background:#c8102e; + background:rgba(200,16,46,0.9); color:#fff; font-weight:bold; @@ -232,16 +232,21 @@ input[type=number]::-webkit-outer-spin-button { float:left; - background:#c8102e; + background: rgba(200,16,46,0.9); color:#FFF; font-size:18px; font-weight:bold; + + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } -#special_operations button:focus, #special_operations button:hover { +#special_operations button:focus, +#special_operations button:hover { outline:none; - background:#000; + background: rgba(200,16,46,1); color:#fff; } @@ -256,15 +261,14 @@ input[type=number]::-webkit-outer-spin-button { height:100%; float:left; border:0; - border-right:1px solid #c8102e; - border-bottom:1px solid #c8102e; border-radius:0; + border-bottom: 1px solid rgba(200,16,46,0.9); font-size:16px; font-weight:bold; } -#article_selection input+input #article_selection input+span { - border-right:0; +#article_selection input:first-child { + border-right: 1px dashed rgba(200,16,46,0.9); } #article_autocomplete { @@ -319,7 +323,7 @@ input[type=number]::-webkit-outer-spin-button { #articles_data table tr.category { height:35px; - background-color:#c8102e; + background-color:rgba(200,16,46,0.9); font-size:16px; color:#FFF; font-weight:bold; @@ -423,3 +427,7 @@ input[type=number]::-webkit-outer-spin-button { .kpsul_middle_right_col { overflow:auto; } + +.kpsul_middle_right_col #history .day { + top: 0; +} diff --git a/kfet/static/kfet/css/nav.css b/kfet/static/kfet/css/nav.css index 5ffc7b24..a4dabed2 100644 --- a/kfet/static/kfet/css/nav.css +++ b/kfet/static/kfet/css/nav.css @@ -1,67 +1,88 @@ -nav { - background:#000; - color:#DDD; - font-family:Oswald; +.navbar { + background: #000; + color: #DDD; + font-family: Oswald; + border: 0; } -.navbar-nav > li > .dropdown-menu { - border:0; - border-radius:0; +.navbar .navbar-brand { + padding: 3px 25px; } -.navbar-fixed-top { - border:0; +.navbar .navbar-brand img { + height: 44px; } -nav .navbar-brand { - padding:3px 25px; -} - -nav .navbar-brand img { - height:44px; -} - -nav .navbar-toggle .icon-bar { - background-color:#FFF; -} - -nav a { - color:#DDD; +.navbar .navbar-toggle .icon-bar { + background-color: #FFF; } .navbar-nav { - font-weight:bold; - font-size:14px; - text-transform:uppercase; + font-weight: bold; + font-size: 14px; + text-transform: uppercase; + margin: 0 -15px; } -.nav>li>a:focus, .nav>li>a:hover { - background-color:#C8102E; - color:#FFF; -} - -.nav .open>a, .nav .open>a:focus, .nav .open>a:hover { - background-color:#C8102E; -} - -.dropdown-menu { - padding:0; -} - -.dropdown-menu>li>a { - padding:8px 20px; -} - -.dropdown-menu .divider { - margin:0; -} - -@media (max-width: 767px) { - .navbar-nav .open .dropdown-menu { - background-color:#FFF; - } - +@media (min-width: 768px) { .navbar-nav { - margin:0 -15px; + margin: 0px; + } + .navbar-right { + margin-right: -15px; + } +} + +.navbar-nav a { + transition: background-color, box-shadow, color; + transition-duration: 0.15s; +} + +.navbar-nav > li > a { + color: #FFF; +} + +.navbar-nav > li:hover > a, +.navbar-nav > li > a:focus, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #C8102E; + color: #FFF; + box-shadow: inset 0 5px 5px -5px #000; +} + +.navbar-nav .dropdown .dropdown-menu { + padding: 0; + border: 0; + border-radius: 0; + background-color: #FFF; +} + +.navbar-nav .dropdown .dropdown-menu > li > a { + padding: 8px 20px; + color: #000; +} + +.navbar-nav .dropdown .dropdown-menu > li > a:hover, +.navbar-nav .dropdown .dropdown-meny > li > a:focus { + color: #c8102e; + background-color: transparent; +} + +.navbar-nav .dropdown .dropdown-menu .divider { + margin: 0; +} + +@media (min-width: 768px) { + .navbar-nav .dropdown .dropdown-menu { + display: block; + visibility: hidden; + opacity: 0; + transition: opacity 0.15s; + } + + .nav .dropdown:hover .dropdown-menu { + visibility: visible; + opacity: 1; } } diff --git a/kfet/static/kfet/js/kfet.js b/kfet/static/kfet/js/kfet.js index cc369e32..72ae675a 100644 --- a/kfet/static/kfet/js/kfet.js +++ b/kfet/static/kfet/js/kfet.js @@ -1,14 +1,4 @@ $(document).ready(function() { - $(window).scroll(function() { - if ($(window).width() >= 768 && $(this).scrollTop() > 72.6) { - $('.col-content-left').css({'position':'fixed', 'top':'50px'}); - $('.col-content-right').addClass('col-sm-offset-4 col-md-offset-3'); - } else { - $('.col-content-left').css({'position':'relative', 'top':'0'}); - $('.col-content-right').removeClass('col-sm-offset-4 col-md-offset-3'); - } - }); - if (typeof Cookies !== 'undefined') { // Retrieving csrf token csrftoken = Cookies.get('csrftoken'); diff --git a/kfet/statistic.py b/kfet/statistic.py index 8ffb7db5..3f32807e 100644 --- a/kfet/statistic.py +++ b/kfet/statistic.py @@ -86,7 +86,10 @@ class Scale(object): def get_labels(self, label_fmt=None): if label_fmt is None: label_fmt = self.label_fmt - return [begin.strftime(label_fmt) for begin, end in self] + return [ + begin.strftime(label_fmt.format(i=i, rev_i=len(self)-i)) + for i, (begin, end) in enumerate(self) + ] def chunkify_qs(self, qs, field=None): if field is None: diff --git a/kfet/templates/kfet/account.html b/kfet/templates/kfet/account.html index 76445e73..c8d9b4f9 100644 --- a/kfet/templates/kfet/account.html +++ b/kfet/templates/kfet/account.html @@ -1,67 +1,61 @@ -{% extends "kfet/base.html" %} +{% extends "kfet/base_col_2.html" %} {% block title %}Liste des comptes{% endblock %} -{% block content-header-title %}Comptes{% endblock %} +{% block header-title %}Comptes{% endblock %} -{% block content %} +{% block fixed-content %} -
-
-
-
-
{{ accounts|length|add:-1 }}
-
compte{{ accounts|length|add:-1|pluralize }}
-
-
- Créer un compte - {% if perms.kfet.manage_perms %} - Permissions - {% endif %} - {% if perms.kfet.view_negs %} - Négatifs - {% endif %} -
-
-
-
- {% include 'kfet/base_messages.html' %} -
-
-

Liste des comptes

-
- - - - - - - - - - - - - - {% for account in accounts %} - - - - - - - - - - {% endfor %} - -
TrigrammeNomBalanceCOFDptPromo
- - - - {{ account.trigramme }}{{ account.name }}{{ account.balance }}€{{ account.is_cof }}{{ account.departement }}{{ account.promo|default_if_none:'' }}
-
-
-
+
+
{{ accounts|length|add:-1 }}
+
compte{{ accounts|length|add:-1|pluralize }}
+
+
+ Créer un compte + {% if perms.kfet.manage_perms %} + Permissions + {% endif %} + {% if perms.kfet.view_negs %} + Négatifs + {% endif %} +
+ +{% endblock %} + +{% block main-content %} + +
+

Liste des comptes

+
+ + + + + + + + + + + + + + {% for account in accounts %} + + + + + + + + + + {% endfor %} + +
TrigrammeNomBalanceCOFDptPromo
+ + + + {{ account.trigramme }}{{ account.name }}{{ account.balance }}€{{ account.is_cof|yesno:"Oui,Non" }}{{ account.departement }}{{ account.promo|default_if_none:'' }}
diff --git a/kfet/templates/kfet/account_create.html b/kfet/templates/kfet/account_create.html index 3b4829d8..b9e050b4 100644 --- a/kfet/templates/kfet/account_create.html +++ b/kfet/templates/kfet/account_create.html @@ -1,45 +1,39 @@ -{% extends "kfet/base.html" %} +{% extends "kfet/base_col_1.html" %} {% load staticfiles %} {% block title %}Nouveau compte{% endblock %} +{% block header-title %}Création d'un compte{% endblock %} {% block extra_head %} {% endblock %} -{% block content-header-title %}Création d'un compte{% endblock %} +{% block main-class %}content-form{% endblock %} -{% block content %} +{% block main-content %} -{% include 'kfet/base_messages.html' %} - -
-
-
- -
+
+
+

Les mots contenant des caractères non alphanumériques seront ignorés

+ +
+
+
+
+
+ {% include 'kfet/account_create_form.html' %} +
+ {% if not perms.kfet.add_account %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} +
+ + {% endblock %} -{% block content-header-title %}Création d'un compte{% endblock %} +{% block main-class %}content-form{% endblock %} -{% block content %} +{% block main-content %} -{% include 'kfet/base_messages.html' %} - -
-
-
- -
+
+
+ +
+
+
+
+
+ {% include 'kfet/account_create_form.html' %} +
+ {% if not perms.kfet.add_account %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} +
+ {% endblock %} -{% block content %} +{% block title %}Permissions - Édition{% endblock %} +{% block header-title %}Modification des permissions{% endblock %} -
+{% block main-class %}content-form{% endblock %} + +{% block main-content %} + + {% csrf_token %} -
- {{ form.name.errors }} - {{ form.name.label_tag }} -
- K-Fêt - {{ form.name }} +
+ +
+
+ K-Fêt + {{ form.name|add_class:"form-control" }} +
+ {% if form.name.errors %}{{ form.name.errors }}{% endif %} + {% if form.name.help_text %}{{ form.name.help_text }}{% endif %}
-
- {{ form.permissions.errors }} - {{ form.permissions.label_tag }} - {{ form.permissions }} -
- + {% include "kfet/form_field_snippet.html" with field=form.permissions %} + {% if not perms.kfet.manage_perms %} + {% include "kfet/form_authentication_snippet.html" %} + {% endif %} + {% include "kfet/form_submit_snippet.html" with value="Enregistrer" %} diff --git a/kfet/templates/kfet/account_negative.html b/kfet/templates/kfet/account_negative.html index af4366ed..e92f3f70 100644 --- a/kfet/templates/kfet/account_negative.html +++ b/kfet/templates/kfet/account_negative.html @@ -1,79 +1,73 @@ -{% extends 'kfet/base.html' %} +{% extends "kfet/base_col_2.html" %} -{% block title %}Comptes en négatifs{% endblock %} -{% block content-header-title %}Comptes - Négatifs{% endblock %} +{% block title %}Comptes - Négatifs{% endblock %} +{% block header-title %}Comptes en négatifs{% endblock %} -{% block content %} +{% block fixed-content %} -
-
-
-
-
{{ negatives|length }}
-
compte{{ negatives|length|pluralize }} en négatif
-
-
Total: {{ negatives_sum|floatformat:2 }}€
-
-
-
Découvert autorisé par défaut
-
Montant: {{ kfet_config.overdraft_amount }}€
-
Pendant: {{ kfet_config.overdraft_duration }}
-
-
- {% if perms.kfet.change_settings %} - - {% endif %} -
+
+
{{ negatives|length }}
+
compte{{ negatives|length|pluralize }} en négatif
+
+
Total: {{ negatives_sum|floatformat:2 }}€
-
- {% include 'kfet/base_messages.html' %} -
-
-

Liste des comptes en négatifs

-
- - - - - - - - - - - - - - - - {% for neg in negatives %} - - - - - - - - - - - - {% endfor %} - -
TriNomBalanceRéelleDébutDécouvert autoriséJusqu'auBalance offset
- - - - {{ neg.account.trigramme }}{{ neg.account.name }}{{ neg.account.balance|floatformat:2 }}€ - {% if neg.balance_offset %} - {{ neg.account.real_balance|floatformat:2 }}€ - {% endif %} - {{ neg.start|date:'d/m/Y H:i:s'}}{{ neg.authz_overdraft_amount|default_if_none:'' }}{{ neg.authz_overdrafy_until|default_if_none:'' }}{{ neg.balance_offset|default_if_none:'' }}
-
-
-
+
+
Découvert autorisé par défaut
+
Montant: {{ kfet_config.overdraft_amount }}€
+
Pendant: {{ kfet_config.overdraft_duration }}
+
+
+{% if perms.kfet.change_settings %} + +{% endif %} + +{% endblock %} + +{% block main-content %} + +
+

Liste des comptes en négatifs

+
+ + + + + + + + + + + + + + + + {% for neg in negatives %} + + + + + + + + + + + + {% endfor %} + +
TriNomBalanceRéelleDébutDécouvert autoriséJusqu'auBalance offset
+ + + + {{ neg.account.trigramme }}{{ neg.account.name }}{{ neg.account.balance|floatformat:2 }}€ + {% if neg.balance_offset %} + {{ neg.account.real_balance|floatformat:2 }}€ + {% endif %} + {{ neg.start|date:'d/m/Y H:i:s'}}{{ neg.authz_overdraft_amount|default_if_none:'' }}{{ neg.authz_overdrafy_until|default_if_none:'' }}{{ neg.balance_offset|default_if_none:'' }}
diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index b55f2b99..282e035f 100644 --- a/kfet/templates/kfet/account_read.html +++ b/kfet/templates/kfet/account_read.html @@ -1,4 +1,4 @@ -{% extends "kfet/base.html" %} +{% extends "kfet/base_col_2.html" %} {% load staticfiles %} {% load kfet_tags %} {% load l10n %} @@ -23,20 +23,12 @@ $(document).ready(function() { "{% url 'kfet.account.stat.balance.list' trigramme=account.trigramme %}", $("#stat_balance") ); - }); +}); {% endif %} {% endblock %} {% block title %} -{% if account.user == request.user %} - Mon compte -{% else %} - Informations du compte {{ account.trigramme }} -{% endif %} -{% endblock %} - -{% block content-header-title %} {% if account.user == request.user %} Mon compte {% else %} @@ -44,53 +36,47 @@ $(document).ready(function() { {% endif %} {% endblock %} -{% block content %} +{% block header-title %} +{% if account.user == request.user %} + Mon compte +{% else %} + Informations du compte {{ account.trigramme }} +{% endif %} +{% endblock %} -
-
-
- {% include 'kfet/left_account.html' %} +{% block fixed-content %} +{% include "kfet/left_account.html" %} +{% endblock %} + +{% block main-content %} + +
+ {% if account.user == request.user %} +
+

Statistiques

+
+

Ma balance

+
+

Ma consommation

+
-
-
- {% include "kfet/base_messages.html" %} -
-
-
- {% if account.user == request.user %} -
-
-

Statistiques

-
-

Ma balance

-
-

Ma consommation

-
-
-
-
- {% endif %} - {% if addcosts %} -

Gagné des majorations

-
-
    - {% for addcost in addcosts %} -
  • {{ addcost.date|date:'l j F' }}: +{{ addcost.sum_addcosts }}€
  • - {% endfor %} -
-
- {% endif %} -

Historique

-
- {% if account.user == request.user %} -
-
- {% endif %} -
-
-
-
-
+
+ {% endif %} +
+ {% if addcosts %} +

Gagné des majorations

+
+
    + {% for addcost in addcosts %} +
  • {{ addcost.date|date:'l j F' }}: +{{ addcost.sum_addcosts }}€
  • + {% endfor %} +
+
+ {% endif %} +

Historique

+
+
+
{% endblock %} -{% block title %}Informations sur l'article {{ article }}{% endblock %} -{% block content-header-title %}Article - {{ article.name }}{% endblock %} +{% block title %}Article - {{ article.name }}{% endblock %} +{% block header-title %}Informations sur l'article {{ article.name }}{% endblock %} -{% block content %} +{% block fixed-content %} -
-
-
-
-
{{ article.name }}
-
{{ article.category }}
-
-
Prix (hors réduc.): {{ article.price }}€
-
Stock: {{ article.stock }}
-
En vente: {{ article.is_sold | yesno:"Oui,Non" }}
-
Affiché: {{ article.hidden | yesno:"Non,Oui" }}
-
-
- -
+
+
{{ article.name }}
+
{{ article.category }}
+
+
Prix (hors réduc.): {{ article.price }}€
+
Stock: {{ article.stock }}
+
En vente: {{ article.is_sold | yesno:"Oui,Non" }}
+
Affiché: {{ article.hidden | yesno:"Non,Oui" }}
-
- {% include 'kfet/base_messages.html' %} -
-
-

Historique

-
-
-

Inventaires

- - - - - - - - - - {% for inventoryart in inventoryarts %} - - - - - - {% endfor %} - -
DateStockErreur
{{ inventoryart.inventory.at }}{{ inventoryart.stock_new }}{{ inventoryart.stock_error }}
-
-
-

Prix fournisseurs

- - - - - - - - - - - - {% for supplierart in supplierarts %} - - - - - - - - {% endfor %} - -
DateFournisseurHTTVADroits
{{ supplierart.at }}{{ supplierart.supplier.name }}{{ supplierart.price_HT }}{{ supplierart.TVA }}{{ supplierart.rights }}
-
-
-
-
-

Statistiques

-
-
-
-

Ventes de {{ article.name }}

-
-
-
-
+
+ + +{% endblock %} + +{% block main-content %} + +
+

Historique

+
+
+

Inventaires

+ + + + + + + + + + {% for inventoryart in inventoryarts %} + + + + + + {% endfor %} + +
DateStockErreur
{{ inventoryart.inventory.at }}{{ inventoryart.stock_new }}{{ inventoryart.stock_error }}
+
+
+

Prix fournisseurs

+
+ + + + + + + + + + + + {% for supplierart in supplierarts %} + + + + + + + + {% endfor %} + +
DateFournisseurHTTVADroits
{{ supplierart.at }}{{ supplierart.supplier.name }}{{ supplierart.price_HT }}{{ supplierart.TVA }}{{ supplierart.rights }}
+
+
+
+

Statistiques

+
+

Ventes

+
diff --git a/kfet/templates/kfet/article_update.html b/kfet/templates/kfet/article_update.html index a3bfbcc6..d451df94 100644 --- a/kfet/templates/kfet/article_update.html +++ b/kfet/templates/kfet/article_update.html @@ -1,27 +1,12 @@ -{% extends 'kfet/base.html' %} -{% load widget_tweaks %} -{% load staticfiles %} +{% extends "kfet/base_col_1.html" %} -{% block title %}Édition de l'article {{ article.name }}{% endblock %} -{% block content-header-title %}Article {{ article.name }} - Édition{% endblock %} +{% block title %}{{ article.name }} - Édition{% endblock %} +{% block header-title %}Édition de l'article {{ article.name }}{% endblock %} -{% block content %} +{% block main-class %}content-form{% endblock %} -{% include "kfet/base_messages.html" %} +{% block main-content %} -
-
-
-
- {% csrf_token %} - {% include 'kfet/form_snippet.html' with form=form %} - {% if not perms.kfet.change_article %} - {% include 'kfet/form_authentication_snippet.html' %} - {% endif %} - {% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %} -
-
-
-
+{% include "kfet/base_form.html" with authz=perms.kfet.change_article submit_text="Mettre à jour"%} {% endblock %} diff --git a/kfet/templates/kfet/base.html b/kfet/templates/kfet/base.html index 173a5fb7..da37abae 100644 --- a/kfet/templates/kfet/base.html +++ b/kfet/templates/kfet/base.html @@ -30,12 +30,12 @@ {% include "kfet/base_nav.html" %}
- {% block content-header %} -
-
-

{% block content-header-title %}{% endblock %}

-
+ {% block header %} +
+
+

{% block header-title %}{% endblock %}

+
{% endblock %} {% block content %}{% endblock %} {% include "kfet/base_footer.html" %} diff --git a/kfet/templates/kfet/base_col_1.html b/kfet/templates/kfet/base_col_1.html new file mode 100644 index 00000000..a4c26b82 --- /dev/null +++ b/kfet/templates/kfet/base_col_1.html @@ -0,0 +1,14 @@ +{% extends "kfet/base.html" %} + +{% block content %} + +
+
+ {% include "kfet/base_messages.html" %} +
+ {% block main-content %}{% endblock %} +
+
+
+ +{% endblock %} diff --git a/kfet/templates/kfet/base_col_2.html b/kfet/templates/kfet/base_col_2.html new file mode 100644 index 00000000..58c36d14 --- /dev/null +++ b/kfet/templates/kfet/base_col_2.html @@ -0,0 +1,19 @@ +{% extends "kfet/base.html" %} + +{% block content %} + +
+
+
+ {% block fixed-content %}{% endblock %} +
+
+
+ {% include "kfet/base_messages.html" %} +
+ {% block main-content %}{% endblock %} +
+
+
+ +{% endblock %} diff --git a/kfet/templates/kfet/base_form.html b/kfet/templates/kfet/base_form.html new file mode 100644 index 00000000..1ac4c81b --- /dev/null +++ b/kfet/templates/kfet/base_form.html @@ -0,0 +1,10 @@ +{% load kfet_tags %} + +
+ {% csrf_token %} + {% include "kfet/form_snippet.html" %} + {% if not authz %} + {% include "kfet/form_authentication_snippet.html" %} + {% endif %} + {% include "kfet/form_submit_snippet.html" with value=submit_text %} +
diff --git a/kfet/templates/kfet/base_messages.html b/kfet/templates/kfet/base_messages.html index 440b8c10..66b67162 100644 --- a/kfet/templates/kfet/base_messages.html +++ b/kfet/templates/kfet/base_messages.html @@ -1,8 +1,8 @@ {% if messages %}
{% for message in messages %} -
-
+
+
{% if 'safe' in message.tags %} {{ message|safe }} diff --git a/kfet/templates/kfet/base_nav.html b/kfet/templates/kfet/base_nav.html index b5c98375..273cdc0b 100644 --- a/kfet/templates/kfet/base_nav.html +++ b/kfet/templates/kfet/base_nav.html @@ -9,46 +9,50 @@ - +
- {% endif %} -
-

{{ article.category.name }}

-
    - {% endifchanged %} -
  • -
    - {{ article.name }} - {{ article.price | ukf:False}} UKF -
  • - {% if forloop.last %} -
-
- {% endif %} - {% endfor %} -
-
+
+
+ {% if pressions %} +

Pressions du moment

+
    + {% for article in pressions %} +
  • +
    + {{ article.name }} + {{ article.price | ukf:False}} UKF +
  • + {% endfor %} +
+ {% endif %} +
+ {% for article in articles %} + {% ifchanged article.category %} + {% if not forloop.first %} + +
+ {% endif %} +
+

{{ article.category.name }}

+
    + {% endifchanged %} +
  • +
    + {{ article.name }} + {{ article.price | ukf:False}} UKF +
  • + {% if forloop.last %} +
+
+ {% endif %} + {% endfor %}
-
diff --git a/kfet/templates/kfet/inventory.html b/kfet/templates/kfet/inventory.html index 5d8a28f4..7c8b8bd2 100644 --- a/kfet/templates/kfet/inventory.html +++ b/kfet/templates/kfet/inventory.html @@ -1,63 +1,55 @@ -{% extends 'kfet/base.html' %} +{% extends "kfet/base_col_2.html" %} {% block title %}Inventaires{% endblock %} -{% block content-header-title %}Inventaires{% endblock %} +{% block header-title %}Inventaires{% endblock %} -{% block content %} +{% block fixed-content %} -
-
-
-
-
- -
-
-
- {% include 'kfet/base_messages.html' %} -
-
-

Liste des inventaires

-
- - - - - - - - - - - - {% for inventory in inventories %} - - - - - - - - {% endfor %} - -
DateParNb articlesCommande
- - - - {{ inventory.at }}{{ inventory.by.trigramme }}{{ inventory.nb_articles }} - {% if inventory.order %} - - #{{ inventory.order.pk }} - - {% endif %} -
-
-
-
+ + +{% endblock %} + +{% block main-content %} + +
+

Liste des inventaires

+
+ + + + + + + + + + + + {% for inventory in inventories %} + + + + + + + + {% endfor %} + +
DateParNb articlesCommande
+ + + + {{ inventory.at }}{{ inventory.by.trigramme }}{{ inventory.nb_articles }} + {% if inventory.order %} + + #{{ inventory.order.pk }} + + {% endif %} +
diff --git a/kfet/templates/kfet/inventory_create.html b/kfet/templates/kfet/inventory_create.html index 0192d4ad..fd1f576f 100644 --- a/kfet/templates/kfet/inventory_create.html +++ b/kfet/templates/kfet/inventory_create.html @@ -1,4 +1,4 @@ -{% extends 'kfet/base.html' %} +{% extends "kfet/base_col_1.html" %} {% load staticfiles %} {% load widget_tweaks %} @@ -8,75 +8,98 @@ {% endblock %} {% block title %}Nouvel inventaire{% endblock %} -{% block content-header-title %}Nouvel inventaire{% endblock %} +{% block header-title %}Création d'un inventaire{% endblock %} -{% block content %} +{% block main-size %}col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2{% endblock %} -{% include 'kfet/base_messages.html' %} -
-
-
- - - - - - - - - - - - - - - {% for form in formset %} - {% ifchanged form.category %} - - - - - {% endifchanged %} - - {{ form.article }} - - - - - - - - - - {% endfor %} - -
ArticleQuantité par caisseStock ThéoriqueCaisses en réserveCaisses en arrièreVracStock totalCompte terminé
{{ form.category_name }}
{{ form.name }}{{ form.box_capacity }}{{ form.stock_old }} -
-
- -
-
-
-
-
-
-
{{ form.stock_new | attr:"readonly"| add_class:"form-control" }}
-
-
- {{ formset.management_form }} - {% if not perms.kfet.add_inventory %} -
- {% include "kfet/form_authentication_snippet.html" %} -
- {% endif %} - - {% csrf_token %} -
+{% block main-content %} + +
+
+ + + + + + + + + + + + + + + {% for form in formset %} + {% ifchanged form.category %} + + + + + {% endifchanged %} + + {{ form.article }} + + + + + + + + + + {% endfor %} + + + + + + + + +
ArticleQuantité par caisseStock théoriqueCaisses en réserveCaisses en arrièreVracStock totalCompte terminé
{{ form.category_name }}
{{ form.name }}{{ form.box_capacity }} + {{ form.stock_old }} + + + + + + + + {{ form.stock_new | attr:"readonly"| add_class:"form-control" }} + +
+ +
+
+ +
+
Totaux
-
- + {{ formset.management_form }} + {% if not perms.kfet.add_inventory %} +
+ {% include "kfet/form_authentication_snippet.html" %} +
+ {% endif %} + + {% csrf_token %} + {% endblock %} diff --git a/kfet/templates/kfet/order.html b/kfet/templates/kfet/order.html index d1fb0442..82695685 100644 --- a/kfet/templates/kfet/order.html +++ b/kfet/templates/kfet/order.html @@ -1,105 +1,97 @@ -{% extends 'kfet/base.html' %} +{% extends "kfet/base_col_2.html" %} {% block title %}Commandes{% endblock %} -{% block content-header-title %}Commandes{% endblock %} +{% block header-title %}Commandes{% endblock %} -{% block content %} +{% block fixed-content %} -
-
-
-
-
{{ orders|length }}
-
commande{{ orders|length|pluralize }}
-
-
-
-
+
+
{{ orders|length }}
+
commande{{ orders|length|pluralize }}
+
+ +{% endblock %} + +{% block main-content %} + +
+

Fournisseurs

+
+ + + + + + + + + + + + {% for supplier in suppliers %} + + + + + + + + + + {% endfor %} + +
NomMailTél.AdresseCommentaire
+ + Passer une commande + + + + + + {{ supplier.name }}{{ supplier.email }}{{ supplier.phone }}{{ supplier.address }}{{ supplier.comment }}
-
- {% include 'kfet/base_messages.html' %} -
-
-

Fournisseurs

-
- - - - - - - - - - - - {% for supplier in suppliers %} - - - - - - - - - - {% endfor %} - -
NomMailTél.AdresseCommentaire
- - Passer une commande - - - - - - {{ supplier.name }}{{ supplier.email }}{{ supplier.phone }}{{ supplier.address }}{{ supplier.comment }}
-
-
-
-

Liste des commandes

-
- - - - - - - - - - - - {% for order in orders %} - - - - - - - - {% endfor %} - -
DateFournisseurInventaire
- {% if not order.inventory %} - - Générer inventaire - - {% endif %} - - - - - {{ order.at }}{{ order.supplier }} - {% if order.inventory %} - - #{{ order.inventory.pk }} - - {% endif %} -
-
-
-
+
+
+

Liste des commandes

+
+ + + + + + + + + + + + {% for order in orders %} + + + + + + + + {% endfor %} + +
DateFournisseurInventaire
+ {% if not order.inventory %} + + Générer inventaire + + {% endif %} + + + + + {{ order.at }}{{ order.supplier }} + {% if order.inventory %} + + #{{ order.inventory.pk }} + + {% endif %} +
diff --git a/kfet/templates/kfet/order_create.html b/kfet/templates/kfet/order_create.html index c2d07f76..33c4ab31 100644 --- a/kfet/templates/kfet/order_create.html +++ b/kfet/templates/kfet/order_create.html @@ -1,71 +1,72 @@ -{% extends 'kfet/base.html' %} +{% extends "kfet/base_col_1.html" %} {% load widget_tweaks %} {% block title %}Nouvelle commande{% endblock %} -{% block content-header-title %}Nouvelle commande {{ supplier.name }}{% endblock %} +{% block header-title %}Création d'une commande {{ supplier.name }}{% endblock %} -{% block content %} +{% block main-size %}col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2{% endblock %} + +{% block main-content %} -
-
{% csrf_token %} - +
+
- - - - - + - - - - - + {% for label in scale.get_labels %} + + {% endfor %} {% for form in formset %} {% ifchanged form.category %} - - - + + {% endifchanged %} {{ form.article }} - - - - - + {% for v_chunk in form.v_all %} + + {% endfor %} + - + {% endfor %}
ArticleVentes + Ventes V. moy. + V. moy.
E.T. + E.T.
Prév. + Prév.
StockRec. + Box
+ +
Rec.
Commande
S1S2S3S4S5{{ label }}
{{ form.category_name }}
{{ form.category_name }}
{{ form.name }}{{ form.v_s1 }}{{ form.v_s2 }}{{ form.v_s3 }}{{ form.v_s4 }}{{ form.v_s5 }}{{ v_chunk }}{{ form.v_moy }} {{ form.v_et }} {{ form.v_prev }} {{ form.stock }}{{ form.box_capacity|default:"" }} {{ form.c_rec }}{{ form.quantity_ordered | add_class:"form-control" }}{{ form.quantity_ordered | add_class:"form-control" }}
+
{{ formset.management_form }} {% if not perms.kfet.add_inventory %}
@@ -74,8 +75,6 @@ {% endif %} -
-