From 0a21858b337c543b46d49a4cae9851dc17f86da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Fri, 14 Apr 2017 13:08:03 +0200 Subject: [PATCH 01/16] Use css for scroll positionning - Better rendering on scroll on pages with a left block (- It removes the warning on Firefox about scroll positionning) --- kfet/static/kfet/css/index.css | 7 +++++++ kfet/static/kfet/js/kfet.js | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 0244a57b..ce7e0dff 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -134,6 +134,13 @@ textarea { padding:0; } +@media (min-width: 768px) { + .col-content-left { + position: sticky; + top:50px; + } +} + .content-left-top { background:#fff; padding:10px 30px; 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'); From ea81ab7b25b9819505a186c19b3505449b2e8aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sat, 15 Apr 2017 12:36:11 +0200 Subject: [PATCH 02/16] Few display improvements. - Current day remains on the screen on history. - Message for generic team user connection is sended only if user is connecting from a k-fet url. - Less contrast on history. --- kfet/signals.py | 16 +++++++++------- kfet/static/kfet/css/history.css | 5 ++++- kfet/static/kfet/css/index.css | 7 +++++-- kfet/static/kfet/css/kpsul.css | 4 ++++ kfet/templates/kfet/base_messages.html | 2 +- kfet/templates/kfet/history.html | 2 -- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/kfet/signals.py b/kfet/signals.py index 3dd4d677..77c114e3 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..77ccaebb 100644 --- a/kfet/static/kfet/css/history.css +++ b/kfet/static/kfet/css/history.css @@ -14,12 +14,15 @@ 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 ce7e0dff..d241e209 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -186,8 +186,11 @@ textarea { text-align:center; } -.content-right { - margin:0 15px; + +@media (min-width: 768px) { + .content-right { + margin: 0 15px; + } } .content-right-block { diff --git a/kfet/static/kfet/css/kpsul.css b/kfet/static/kfet/css/kpsul.css index ba88e433..3a08a3bb 100644 --- a/kfet/static/kfet/css/kpsul.css +++ b/kfet/static/kfet/css/kpsul.css @@ -423,3 +423,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/templates/kfet/base_messages.html b/kfet/templates/kfet/base_messages.html index 440b8c10..3ac8512d 100644 --- a/kfet/templates/kfet/base_messages.html +++ b/kfet/templates/kfet/base_messages.html @@ -2,7 +2,7 @@
{% for message in messages %}
-
+
{% if 'safe' in message.tags %} {{ message|safe }} diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index ab1eef72..9e983079 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -14,7 +14,6 @@ - {% endblock %} @@ -30,7 +29,6 @@
opérations
-

Filtres

De
à
Caisses {{ filter_form.checkouts }}
From ce23eece6aff233f330eb4401a6e6d8eaa91c11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sat, 15 Apr 2017 13:03:01 +0200 Subject: [PATCH 03/16] Fix display on small screen devices. - Remove useless margin on small screens. - Better pills display on small screens. - Revert to transparent background for section title. --- kfet/static/kfet/css/index.css | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index d241e209..d9c44a60 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -154,6 +154,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; @@ -202,14 +210,6 @@ textarea { padding-bottom:15px; } -.content-right-block > div:not(.buttons-title) { - background:#fff; -} - -.content-right-block-transparent > div:not(.buttons-title) { - background-color: transparent; -} - .content-right-block .buttons-title { position:absolute; top:8px; From 739990cdb698ae165c9bcfc7ed35bfc4b679ea05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sat, 22 Apr 2017 01:17:23 +0200 Subject: [PATCH 04/16] Add total boxes to new inventory view + fix/clean - Add total boxes in cellar and bar to new inventory view. - On this view, table is "minified". - Revert background color for some templates. - Clean some margin (responsively). - Clean tab pills on account read. --- kfet/static/kfet/css/index.css | 59 +++++----- kfet/templates/kfet/account_read.html | 60 +++++----- kfet/templates/kfet/inventory_create.html | 133 ++++++++++++++-------- 3 files changed, 141 insertions(+), 111 deletions(-) diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index d9c44a60..04bb438e 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -114,22 +114,6 @@ 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; } @@ -194,20 +178,18 @@ textarea { text-align:center; } - @media (min-width: 768px) { .content-right { - margin: 0 15px; + margin: 15px; } } .content-right-block { - padding-bottom:5px; position:relative; } -.content-right-block:last-child { - padding-bottom:15px; +.content-right-block > div:not(.buttons-title) { + background: #fff; } .content-right-block .buttons-title { @@ -229,9 +211,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; } @@ -239,12 +220,18 @@ textarea { * Pages tableaux seuls */ -.content-center > div { +.content-center { background:#fff; } +@media (min-width: 992px) { + .content-center { + margin: 15px; + } +} + .content-center tbody tr:not(.section) td { - padding:0px 5px !important; + padding:0px 5px; } .content-center .table .form-control { @@ -252,7 +239,15 @@ textarea { height:28px; margin:3px 0px; } - .content-center .auth-form { + +.content-center .table-condensed input.form-control { + margin: 0 !important; + border-top: 0; + border-bottom: 0; + border-radius: 0; +} + +.content-center .auth-form { margin:15px; } @@ -577,15 +572,21 @@ thead .tooltip { /* 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; } diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index b55f2b99..95df85a0 100644 --- a/kfet/templates/kfet/account_read.html +++ b/kfet/templates/kfet/account_read.html @@ -23,7 +23,7 @@ $(document).ready(function() { "{% url 'kfet.account.stat.balance.list' trigramme=account.trigramme %}", $("#stat_balance") ); - }); +}); {% endif %} {% endblock %} @@ -55,39 +55,33 @@ $(document).ready(function() {
{% 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 %} -
-
+
+ {% 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

+
+
+
diff --git a/kfet/templates/kfet/inventory_create.html b/kfet/templates/kfet/inventory_create.html index d8109f8e..d1fe6e05 100644 --- a/kfet/templates/kfet/inventory_create.html +++ b/kfet/templates/kfet/inventory_create.html @@ -13,24 +13,25 @@ {% block content %} {% include 'kfet/base_messages.html' %} -
-
-
- - - - - - - - - - - - - - - {% for form in formset %} +
+
+
+ +
ArticleQuantité par caisseStock ThéoriqueCaisses en réserveCaisses en arrièreVracStock totalCompte terminé
+ + + + + + + + + + + + + + {% for form in formset %} {% ifchanged form.category %} @@ -41,42 +42,68 @@ {{ 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_old }} + + + + + + + + {{ form.stock_new | attr:"readonly"| add_class:"form-control" }} + +
+ +
+
+
-
-
-
-
-
{{ 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 %} -
+ {% endfor %} + + 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/settings_update.html b/kfet/templates/kfet/settings_update.html index fdd5f5d4..b5f46c23 100644 --- a/kfet/templates/kfet/settings_update.html +++ b/kfet/templates/kfet/settings_update.html @@ -5,21 +5,6 @@ {% block content %} -{% include "kfet/base_messages.html" %} - -
-
-
-
- {% csrf_token %} - {% include 'kfet/form_snippet.html' with form=form %} - {% if not perms.kfet.change_settings %} - {% 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_settings submit_text="Mettre à jour"%} {% endblock %} diff --git a/kfet/templates/kfet/supplier_form.html b/kfet/templates/kfet/supplier_form.html index 168f74d9..434b9382 100644 --- a/kfet/templates/kfet/supplier_form.html +++ b/kfet/templates/kfet/supplier_form.html @@ -1,27 +1,10 @@ {% extends 'kfet/base.html' %} -{% load widget_tweaks %} -{% load staticfiles %} {% block title %}Fournisseur - Modification{% endblock %} {% block content-header-title %}Fournisseur - Modification{% endblock %} {% block content %} -{% include 'kfet/base_messages.html' %} - -
-
-
-
- {% csrf_token %} - {% include 'kfet/form_snippet.html' with form=form %} - {% if not perms.kfet.change_supplier %} - {% 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_supplier submit_text="Mettre à jour" %} {% endblock %} diff --git a/kfet/views.py b/kfet/views.py index 60dbb44b..7b1674c4 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -85,6 +85,8 @@ def login_genericteam(request): user = authenticate(username="kfet_genericteam", token=token.token) login(request, user) + messages.success(request, "Connecté en utilisateur partagé") + if need_cas_logout: # Vue de déconnexion de CAS return logout_cas @@ -514,6 +516,10 @@ def account_update(request, trigramme): return render(request, "kfet/account_update.html", { 'account': account, + 'forms': [ + user_form, cof_form, account_form, group_form, pwd_form, + negative_form, + ], 'account_form': account_form, 'cof_form': cof_form, 'user_form': user_form, From 1a661c1fd3d784a2c784ab2ff8d90442871f004a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Thu, 18 May 2017 20:29:29 +0200 Subject: [PATCH 06/16] revert --- kfet/views.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kfet/views.py b/kfet/views.py index 7b1674c4..fa94bb35 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -516,10 +516,6 @@ def account_update(request, trigramme): return render(request, "kfet/account_update.html", { 'account': account, - 'forms': [ - user_form, cof_form, account_form, group_form, pwd_form, - negative_form, - ], 'account_form': account_form, 'cof_form': cof_form, 'user_form': user_form, From e9073e22654a9908c86854f9bc04ad270a4429bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Thu, 18 May 2017 21:41:23 +0200 Subject: [PATCH 07/16] Improve multiple select inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + Group edition form gains success message, is prettier + Fix: K-Fêt prefix for group name on this form --- kfet/static/kfet/css/index.css | 13 +++++ kfet/templates/kfet/account_group_form.html | 59 +++++++++++++++------ kfet/templates/kfet/base_form.html | 2 +- kfet/templates/kfet/history.html | 3 ++ kfet/views.py | 2 +- 5 files changed, 60 insertions(+), 19 deletions(-) diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 50d2cae8..4fc02014 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -595,3 +595,16 @@ thead .tooltip { 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; +} diff --git a/kfet/templates/kfet/account_group_form.html b/kfet/templates/kfet/account_group_form.html index e37bdd89..00e7809b 100644 --- a/kfet/templates/kfet/account_group_form.html +++ b/kfet/templates/kfet/account_group_form.html @@ -1,37 +1,62 @@ {% extends 'kfet/base.html' %} {% load staticfiles %} +{% load widget_tweaks %} {% block extra_head %} {% endblock %} +{% block title %}Permissions - Édition{% endblock %} +{% block content-header-title %}Modification des permissions{% endblock %} + {% block content %} -
- {% csrf_token %} -
- {{ form.name.errors }} - {{ form.name.label_tag }} -
- K-Fêt - {{ form.name }} +{% include "kfet/base_messages.html" %} + +
+
+
+ + {% csrf_token %} +
+ +
+
+ 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 %} +
+
+ {% 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" %} +
-
- {{ form.permissions.errors }} - {{ form.permissions.label_tag }} - {{ form.permissions }} -
- - +
diff --git a/kfet/templates/kfet/base_form.html b/kfet/templates/kfet/base_form.html index b83e888a..ba6a84ac 100644 --- a/kfet/templates/kfet/base_form.html +++ b/kfet/templates/kfet/base_form.html @@ -3,7 +3,7 @@
-
+ {% csrf_token %} {% include "kfet/form_snippet.html" %} {% if not authz %} diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index 9e983079..add461ab 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -128,6 +128,9 @@ $(document).ready(function() { $("select").multipleSelect({ width: '100%', filter: true, + allSelected: " ", + selectAllText: "Tout-te-s", + countSelected: "# sur %" }); $("input").on('dp.change change', function() { diff --git a/kfet/views.py b/kfet/views.py index fa94bb35..0cce165e 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -539,7 +539,7 @@ class AccountGroupCreate(SuccessMessageMixin, CreateView): success_message = 'Nouveau groupe : %(name)s' success_url = reverse_lazy('kfet.account.group') -class AccountGroupUpdate(UpdateView): +class AccountGroupUpdate(SuccessMessageMixin, UpdateView): queryset = Group.objects.filter(name__icontains='K-Fêt') template_name = 'kfet/account_group_form.html' form_class = GroupForm From ae270656264da08afe911d3cd3ffa551a7ce117c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Fri, 19 May 2017 13:42:41 +0200 Subject: [PATCH 08/16] Group permissions select multiple -> checkboxes - Add handler for CheckboxSelectMultiple in form_field_snippet.html. - Add template filter "widget_type" to get widget class name. - Group permissions selection becomes easier. --- kfet/forms.py | 23 +++++++++++++++++---- kfet/static/kfet/css/index.css | 7 +++++++ kfet/templates/kfet/account_group_form.html | 10 --------- kfet/templates/kfet/form_field_snippet.html | 14 ++++++++++++- kfet/templatetags/kfet_tags.py | 7 +++++-- 5 files changed, 44 insertions(+), 17 deletions(-) diff --git a/kfet/forms.py b/kfet/forms.py index f89b8f08..296ed4ae 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,25 @@ class UserGroupForm(forms.ModelForm): model = User 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'] diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 4fc02014..036e725e 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -608,3 +608,10 @@ thead .tooltip { .ms-choice > div { top: 4px !important; } + +/* Checkbox select multiple */ + +.checkbox-select-multiple label { + font-weight: normal; + margin-bottom: 0; +} diff --git a/kfet/templates/kfet/account_group_form.html b/kfet/templates/kfet/account_group_form.html index 00e7809b..52b99934 100644 --- a/kfet/templates/kfet/account_group_form.html +++ b/kfet/templates/kfet/account_group_form.html @@ -42,16 +42,6 @@ {% 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' %} - -
-
-
- - {% csrf_token %} -
- {{ trigramme_form.trigramme.errors }} - {{ trigramme_form.trigramme }} -
-
-

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 %} -
- -
+
+
+

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 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 65ccec3b..d451df94 100644 --- a/kfet/templates/kfet/article_update.html +++ b/kfet/templates/kfet/article_update.html @@ -1,9 +1,11 @@ -{% extends 'kfet/base.html' %} +{% 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 %} + +{% block main-content %} {% include "kfet/base_form.html" with authz=perms.kfet.change_article submit_text="Mettre à jour"%} 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 index 9fe79e32..1ac4c81b 100644 --- a/kfet/templates/kfet/base_form.html +++ b/kfet/templates/kfet/base_form.html @@ -1,17 +1,10 @@ {% load kfet_tags %} -
-
- {% include "kfet/base_messages.html" %} -
-
- {% 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 %} -
-
-
-
+
+ {% 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/category.html b/kfet/templates/kfet/category.html index 5393bf59..b7797c49 100644 --- a/kfet/templates/kfet/category.html +++ b/kfet/templates/kfet/category.html @@ -1,52 +1,46 @@ -{% extends 'kfet/base.html' %} +{% extends "kfet/base_col_2.html" %} {% block title %}Categories d'articles{% endblock %} -{% block content-header-title %}Categories d'articles{% endblock %} +{% block header-title %}Categories d'articles{% endblock %} -{% block content %} +{% block fixed-content %} -
-
-
-
-
{{ categories|length }}
-
catégorie{{ categories|length|pluralize }}
-
-
-
-
- {% include 'kfet/base_messages.html' %} -
-
-

Liste des catégories

-
- - - - - - - - - - - {% for category in categories %} - - - - - - - {% endfor %} - -
NomNombre d'articlesPeut être majorée
- - - - {{ category.name }}{{ category.articles.all|length }}{{ category.has_addcost | yesno:"Oui,Non"}}
-
-
-
+
+
{{ categories|length }}
+
catégorie{{ categories|length|pluralize }}
+
+ +{% endblock %} + +{% block main-content %} + +
+

Liste des catégories

+
+ + + + + + + + + + + {% for category in categories %} + + + + + + + {% endfor %} + +
NomNombre d'articlesPeut être majorée
+ + + + {{ category.name }}{{ category.articles.all|length }}{{ category.has_addcost | yesno:"Oui,Non"}}
diff --git a/kfet/templates/kfet/category_update.html b/kfet/templates/kfet/category_update.html index af213e71..c535a31d 100644 --- a/kfet/templates/kfet/category_update.html +++ b/kfet/templates/kfet/category_update.html @@ -1,9 +1,11 @@ -{% extends 'kfet/base.html' %} +{% extends "kfet/base_col_1.html" %} -{% block title %}Édition de la catégorie {{ category.name }}{% endblock %} -{% block content-header-title %}Catégorie {{ category.name }} - Édition{% endblock %} +{% block title %}{{ articlecategory.name }} - Édition{% endblock %} +{% block header-title %}Édition de la catégorie {{ articlecategory.name }}{% endblock %} -{% block content %} +{% block main-class %}content-form{% endblock %} + +{% block main-content %} {% include "kfet/base_form.html" with authz=perms.kfet.edit_articlecategory submit_text="Enregistrer"%} diff --git a/kfet/templates/kfet/checkout.html b/kfet/templates/kfet/checkout.html index fb2d10a7..329b8bef 100644 --- a/kfet/templates/kfet/checkout.html +++ b/kfet/templates/kfet/checkout.html @@ -1,59 +1,53 @@ -{% extends "kfet/base.html" %} +{% extends "kfet/base_col_2.html" %} -{% block title %}Liste des caisses{% endblock %} -{% block content-header-title %}Caisses{% endblock %} +{% block title %}Caisses{% endblock %} +{% block header-title %}Caisses{% endblock %} -{% block content %} +{% block fixed-content %} -
-
-
-
-
{{ checkouts|length }}
-
caisse{{ checkouts|length|pluralize }}
-
- -
-
-
- {% include 'kfet/base_messages.html' %} -
-
-

Liste des caisses

-
- - - - - - - - - - - - - {% for checkout in checkouts %} - - - - - - - - - {% endfor %} - -
NomBalanceDéb. valid.Fin valid.Protégée
- - - - {{ checkout.name }}{{ checkout.balance}}€{{ checkout.valid_from }}{{ checkout.valid_to }}{{ checkout.is_protected }}
-
-
-
+
+
{{ checkouts|length }}
+
caisse{{ checkouts|length|pluralize }}
+
+ + +{% endblock %} + +{% block main-content %} + +
+

Liste des caisses

+
+ + + + + + + + + + + + + {% for checkout in checkouts %} + + + + + + + + + {% endfor %} + +
NomBalanceDéb. valid.Fin valid.Protégée
+ + + + {{ checkout.name }}{{ checkout.balance}}€{{ checkout.valid_from }}{{ checkout.valid_to }}{{ checkout.is_protected }}
diff --git a/kfet/templates/kfet/checkout_create.html b/kfet/templates/kfet/checkout_create.html index 0f254f65..bed1b6ef 100644 --- a/kfet/templates/kfet/checkout_create.html +++ b/kfet/templates/kfet/checkout_create.html @@ -1,28 +1,13 @@ -{% extends "kfet/base.html" %} +{% extends "kfet/base_col_1.html" %} {% block extra_head %}{{ form.media }}{% endblock %} {% block title %}Nouvelle caisse{% endblock %} -{% block content-header-title %}Création d'une caisse{% endblock %} +{% block header-title %}Création d'une caisse{% endblock %} -{% block content %} +{% block main-class %}content-form{% endblock %} +{% block main-content %} -{% include 'kfet/base_messages.html' %} -
- {% csrf_token %} - {{ form.non_field_errors}} - {% for field in form %} - {{ field.errors }} - {{ field.label_tag }} -
{{ field }}
- {% if field.help_text %} -

{{ field.help_text|safe }}

- {% endif %} - {% endfor %} - {% if not perms.kfet.add_checkout %} - - {% endif %} - -
+{% include "kfet/base_form.html" with authz=perms.kfet.add_checkout submit_text="Enregistrer" %}