diff --git a/core/lookups.py b/core/lookups.py
new file mode 100644
index 00000000..1e061674
--- /dev/null
+++ b/core/lookups.py
@@ -0,0 +1,39 @@
+from ajax_select import register, LookupChannel
+
+from core.views.site import search_user
+from core.models import User
+from counter.models import Product, Counter
+
+@register('users')
+class UsersLookup(LookupChannel):
+ model = User
+
+ def get_query(self, q, request):
+ return search_user(q)
+
+ def format_match(self, obj):
+ return obj.get_mini_item()
+
+ def format_item_display(self, item):
+ return item.get_display_name()
+
+@register('counters')
+class CountersLookup(LookupChannel):
+ model = Counter
+
+ def get_query(self, q, request):
+ return self.model.objects.filter(name__icontains=q)[:50]
+
+ def format_item_display(self, item):
+ return item.name
+
+@register('products')
+class ProductsLookup(LookupChannel):
+ model = Product
+
+ def get_query(self, q, request):
+ print(request.__dict__)
+ return (self.model.objects.filter(name__icontains=q) | self.model.objects.filter(code__icontains=q))[:50]
+
+ def format_item_display(self, item):
+ return item.name
diff --git a/core/models.py b/core/models.py
index 62c3a3d5..c3135377 100644
--- a/core/models.py
+++ b/core/models.py
@@ -351,6 +351,20 @@ class User(AbstractBaseUser):
def can_be_edited_by(self, user):
return user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user.is_root
+ def get_mini_item(self):
+ return """
+
+
+
+
+
%s
+
+ """ % (
+ self.profile_pict.get_download_url() if self.profile_pict else "/static/core/img/na.gif",
+ _("Profile"),
+ self.get_display_name(),
+ )
+
class AnonymousUser(AuthAnonymousUser):
def __init__(self, request):
diff --git a/core/static/core/form.css b/core/static/core/form.css
deleted file mode 100644
index ff65340e..00000000
--- a/core/static/core/form.css
+++ /dev/null
@@ -1,192 +0,0 @@
-/* ----------------------------------------------------------------------------------------------------
-Super Form Reset
-----------------------------------------------------------------------------------------------------*/
-
-form {
- margin: 0px auto;
- width: 60%;
-}
-
-input,
-label,
-select,
-button,
-textarea
-{
- margin: 1px;
- border: none;
- padding: 1px;
- display: inline-block;
- vertical-align: middle;
- white-space: normal;
- background: none;
- line-height: 1;
-
- /* Browsers have different default form fonts */
- font-size: 13px;
- font-family: Arial;
-}
-
-label {
- min-width: 50%;
-}
-
-/* Remove the stupid outer glow in Webkit */
-input:focus
-{
- outline: 0;
-}
-
-/* Box Sizing Reset
------------------------------------------------*/
-
-/* All of our custom controls should be what we expect them to be */
-input,
-textarea
-{
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-/* These elements are usually rendered a certain way by the browser */
-button,
-input[type=reset],
-input[type=button],
-input[type=submit],
-input[type=checkbox],
-input[type=radio],
-select
-{
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-/* Text Inputs
------------------------------------------------*/
-
-input[type=date],
-input[type=datetime],
-input[type=datetime-local],
-input[type=email],
-input[type=month],
-input[type=number],
-input[type=password],
-input[type=range],
-input[type=search],
-input[type=tel],
-input[type=text],
-input[type=time],
-input[type=url],
-input[type=week],
-textarea
-{
- background-color: white;
- border: 1px solid black;
- padding: 2px;
- border-radius: 2px;
-}
-
-/* Button Controls
------------------------------------------------*/
-
-input[type=checkbox],
-input[type=radio]
-{
- width: 13px;
- height: 13px;
-}
-
-/* File Uploads
------------------------------------------------*/
-
-input[type=file]
-{
-
-}
-
-/* Search Input
------------------------------------------------*/
-
-/* Make webkit render the search input like a normal text field */
-input[type=search]
-{
- -webkit-appearance: textfield;
- -webkit-box-sizing: content-box;
-}
-
-/* Turn off the recent search for webkit. It adds about 15px padding on the left */
-::-webkit-search-decoration
-{
- display: none;
-}
-
-/* Buttons
------------------------------------------------*/
-
-button,
-input[type="reset"],
-input[type="button"],
-input[type="submit"]
-{
- /* Fix IE7 display bug */
- overflow: visible;
- width: auto;
- cursor: pointer;
- padding: 3px;
- border: 1px solid black;
- border-radius: 2px;
- background-color: white;
-}
-
-button:hover,
-input[type="reset"]:hover,
-input[type="button"]:hover,
-input[type="submit"]:hover
-{
- box-shadow: 0 0 2px #000;
-}
-
-button:active,
-input[type="reset"]:active,
-input[type="button"]:active,
-input[type="submit"]:active
-{
- box-shadow: inset 0 0 2px #000;
-}
-
-/* IE8 and FF freak out if this rule is within another selector */
-::-webkit-file-upload-button
-{
- padding: 0;
- border: 0;
- background: none;
-}
-
-/* Textarea
------------------------------------------------*/
-
-textarea
-{
- /* Move the label to the top */
- vertical-align: top;
-
- /* Turn off scroll bars in IE unless needed */
- overflow: auto;
-}
-
-/* Selects
------------------------------------------------*/
-
-select
-{
-
-}
-
-select[multiple]
-{
- /* Move the label to the top */
- vertical-align: top;
-}
-
diff --git a/core/static/core/style.css b/core/static/core/style.css
index a66db1b4..3537a882 100644
--- a/core/static/core/style.css
+++ b/core/static/core/style.css
@@ -160,22 +160,31 @@ tbody>tr:hover {
float: right;
padding: 10px;
}
+#user_info_container {
+}
#user_info {
+ float: right;
+ padding: 5px;
width: 40%;
margin: 0px auto;
background: lightgrey;
}
/*-----------------------------USER PROFILE----------------------------*/
-#user_profile {
+#user_profile_container {
width: 80%;
margin: 0px auto;
+}
+#user_profile {
+ width: 100%;
+ margin: 0px auto;
padding: 10px;
overflow: auto;
}
#user_profile h4 { border-bottom: 1px solid grey; max-width: 60%; }
#user_profile #pictures {
- width: 30%;
+ max-width: 250px;
+ max-height: 300px;
float: right;
font-style: italic;
}
@@ -238,7 +247,14 @@ footer{
text-align: center;
}
-/*--------------------------------MODALE-------------------------------*/
+/*---------------------------------FORMS-------------------------------*/
+form {
+ margin: 0px auto;
+ width: 60%;
+}
+label {
+ display: block;
+}
.choose_file_widget {
display: none;
}
@@ -247,24 +263,10 @@ footer{
position: absolute;
width: 97%;
}
-.form-wrapper {
- display: inline-block;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: #DDD;
- opacity: 0.8;
- padding: 15px;
- border-radius: 4px;
+#user_edit * {
+ text-align: center;
+
}
-.form-wrapper>form {
- display: inline-block;
- position: absolute;
- padding: 15px;
- border-radius: 4px;
- left: 30%;
- top: 40%;
- background-color: white;
+#user_edit img {
+ width: 100px;
}
diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja
index f639ab56..39fe6ca0 100644
--- a/core/templates/core/base.jinja
+++ b/core/templates/core/base.jinja
@@ -4,9 +4,9 @@
{% block head %}
{% block title %}{% trans %}Welcome!{% endtrans %}{% endblock %}
-
+
{% endblock %}
@@ -70,6 +70,7 @@
+
+{% endblock %}
+
diff --git a/counter/templates/counter/counter_edit.jinja b/counter/templates/counter/counter_edit.jinja
new file mode 100644
index 00000000..0bb689cf
--- /dev/null
+++ b/counter/templates/counter/counter_edit.jinja
@@ -0,0 +1,19 @@
+{% extends "core/base.jinja" %}
+
+{% block title %}
+{% trans obj=object %}Edit {{ obj }}{% endtrans %}
+{% endblock %}
+
+{% block content %}
+
{% trans obj=object %}Edit {{ obj }}{% endtrans %}
+
+{% endblock %}
+
+
+
diff --git a/counter/templates/counter/counter_list.jinja b/counter/templates/counter/counter_list.jinja
index 0bf14e72..7dc68425 100644
--- a/counter/templates/counter/counter_list.jinja
+++ b/counter/templates/counter/counter_list.jinja
@@ -10,13 +10,19 @@
{% trans %}Counter admin list{% endtrans %}
{% else %}
diff --git a/counter/urls.py b/counter/urls.py
index a3190d22..f35fa222 100644
--- a/counter/urls.py
+++ b/counter/urls.py
@@ -8,6 +8,7 @@ urlpatterns = [
url(r'^(?P
[0-9]+)/login$', CounterLogin.as_view(), name='login'),
url(r'^(?P[0-9]+)/logout$', CounterLogout.as_view(), name='logout'),
url(r'^admin/(?P[0-9]+)$', CounterEditView.as_view(), name='admin'),
+ url(r'^admin/(?P[0-9]+)/prop$', CounterEditPropView.as_view(), name='prop_admin'),
url(r'^admin$', CounterListView.as_view(), name='admin_list'),
url(r'^admin/new$', CounterCreateView.as_view(), name='new'),
url(r'^admin/delete/(?P[0-9]+)$', CounterDeleteView.as_view(), name='delete'),
diff --git a/counter/views.py b/counter/views.py
index 6e3fc0a6..d44a5446 100644
--- a/counter/views.py
+++ b/counter/views.py
@@ -14,8 +14,11 @@ from django.db import DataError, transaction
import re
from datetime import date, timedelta
+from ajax_select.fields import AutoCompleteSelectField, AutoCompleteSelectMultipleField
+from ajax_select import make_ajax_form, make_ajax_field
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin
+from core.views.forms import SelectUser
from subscription.models import Subscriber
from subscription.views import get_subscriber
from counter.models import Counter, Customer, Product, Selling, Refilling, ProductType
@@ -29,8 +32,7 @@ class GetUserForm(forms.Form):
some nickname, first name, or last name (TODO)
"""
code = forms.CharField(label="Code", max_length=10, required=False)
- id = forms.IntegerField(label="ID", required=False)
- # TODO: add a nice JS widget to search for users
+ id = AutoCompleteSelectField('users', required=False, label=_("Select user"), help_text=None)
def as_p(self):
self.fields['code'].widget.attrs['autofocus'] = True
@@ -327,15 +329,31 @@ class CounterListView(CanViewMixin, ListView):
model = Counter
template_name = 'counter/counter_list.jinja'
-class CounterEditView(CanEditPropMixin, UpdateView):
+class CounterEditForm(forms.ModelForm):
+ class Meta:
+ model = Counter
+ fields = ['sellers', 'products']
+ sellers = make_ajax_field(Counter, 'sellers', 'users', show_help_text=False)
+ products = make_ajax_field(Counter, 'products', 'products')
+
+class CounterEditView(CanEditMixin, UpdateView):
+ """
+ Edit a counter's main informations (for the counter's manager)
+ """
+ model = Counter
+ form_class = CounterEditForm
+ pk_url_kwarg = "counter_id"
+ template_name = 'counter/counter_edit.jinja'
+
+ def get_success_url(self):
+ return reverse_lazy('counter:admin', kwargs={'counter_id': self.object.id})
+
+class CounterEditPropView(CanEditPropMixin, UpdateView):
"""
Edit a counter's main informations (for the counter's admin)
"""
model = Counter
- form_class = modelform_factory(Counter, fields=['name', 'club', 'type', 'sellers', 'products'],
- widgets={
- 'products':CheckboxSelectMultiple,
- 'sellers':CheckboxSelectMultiple})
+ form_class = modelform_factory(Counter, fields=['name', 'club', 'type'])
pk_url_kwarg = "counter_id"
template_name = 'core/edit.jinja'
@@ -399,13 +417,20 @@ class ProductCreateView(CanCreateMixin, CreateView):
'selling_price', 'special_selling_price', 'icon', 'club']
template_name = 'core/create.jinja'
+class ProductEditForm(forms.ModelForm):
+ class Meta:
+ model = Product
+ fields = ['name', 'description', 'product_type', 'code', 'purchase_price',
+ 'selling_price', 'special_selling_price', 'icon', 'club']
+ counters = make_ajax_field(Product, 'counters', 'counters', show_help_text=False, label='Counters', help_text="Guy",
+ required=False) # TODO FIXME
+
class ProductEditView(CanEditPropMixin, UpdateView):
"""
An edit view for the admins
"""
model = Product
- fields = ['name', 'description', 'product_type', 'code', 'purchase_price',
- 'selling_price', 'special_selling_price', 'icon', 'club']
+ form_class = ProductEditForm
pk_url_kwarg = "product_id"
template_name = 'core/edit.jinja'
# TODO: add management of the 'counters' ForeignKey
diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo
index 8df42a48..dbf75084 100644
Binary files a/locale/fr/LC_MESSAGES/django.mo and b/locale/fr/LC_MESSAGES/django.mo differ
diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po
index b9dd20b1..25172d9a 100644
--- a/locale/fr/LC_MESSAGES/django.po
+++ b/locale/fr/LC_MESSAGES/django.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-08-19 01:43+0200\n"
+"POT-Creation-Date: 2016-08-19 23:14+0200\n"
"PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia \n"
"Language-Team: AE info \n"
@@ -66,7 +66,7 @@ msgstr "montant effectif"
msgid "number"
msgstr "numéro"
-#: accounting/models.py:154 core/models.py:404 core/models.py:680
+#: accounting/models.py:154 core/models.py:418 core/models.py:694
#: counter/models.py:209 counter/models.py:255 eboutic/models.py:14
#: eboutic/models.py:47
msgid "date"
@@ -122,7 +122,7 @@ msgstr "Compte"
msgid "Company"
msgstr "Entreprise"
-#: accounting/models.py:163 sith/settings.py:280 sith/settings_sample.py:266
+#: accounting/models.py:163 sith/settings.py:284 sith/settings_sample.py:267
msgid "Other"
msgstr "Autre"
@@ -209,8 +209,7 @@ msgstr "Nouveau compte club"
#: club/templates/club/club_detail.jinja:7 core/templates/core/file.jinja:38
#: core/templates/core/page.jinja:31 core/templates/core/user_base.jinja:10
#: core/templates/core/user_tools.jinja:33
-#: counter/templates/counter/counter_list.jinja:15
-#: counter/templates/counter/counter_list.jinja:18
+#: counter/templates/counter/counter_list.jinja:20
#: launderette/templates/launderette/launderette_list.jinja:14
msgid "Edit"
msgstr "Éditer"
@@ -303,6 +302,7 @@ msgstr "Voir"
#: accounting/templates/accounting/journal_details.jinja:10
#: core/templates/core/user_account.jinja:10
+#: counter/templates/counter/counter_click.jinja:31
msgid "Amount: "
msgstr "Montant: "
@@ -447,6 +447,8 @@ msgstr "Éditer le club"
#: core/templates/core/create.jinja:12 core/templates/core/edit.jinja:12
#: core/templates/core/file_edit.jinja:8 core/templates/core/page_prop.jinja:8
#: core/templates/core/pagerev_edit.jinja:24
+#: counter/templates/counter/counter_edit.jinja:12
+#: counter/templates/counter/counter_edit.jinja:14
#: subscription/templates/subscription/subscription.jinja:22
msgid "Save"
msgstr "Sauver"
@@ -769,109 +771,116 @@ msgstr "adresse des parents"
msgid "A user with that username already exists"
msgstr "Un utilisateur de ce nom d'utilisateur existe déjà"
-#: core/models.py:381
+#: core/models.py:364 core/templates/core/macros.jinja:9
+#: core/templates/core/macros.jinja:11 core/templates/core/macros.jinja:22
+#: core/templates/core/user_detail.jinja:13
+#: core/templates/core/user_edit.jinja:15
+msgid "Profile"
+msgstr "Profil"
+
+#: core/models.py:395
msgid "Visitor"
msgstr "Visiteur"
-#: core/models.py:386
+#: core/models.py:400
msgid "define if we show a users stats"
msgstr "Definit si l'on montre les statistiques de l'utilisateur"
-#: core/models.py:388
+#: core/models.py:402
msgid "Show your account statistics to others"
msgstr "Montrez vos statistiques de compte aux autres"
-#: core/models.py:395
+#: core/models.py:409
msgid "file name"
msgstr "nom du fichier"
-#: core/models.py:396 core/models.py:529
+#: core/models.py:410 core/models.py:543
msgid "parent"
msgstr "parent"
-#: core/models.py:397 core/models.py:407
+#: core/models.py:411 core/models.py:421
msgid "file"
msgstr "fichier"
-#: core/models.py:398
+#: core/models.py:412
msgid "owner"
msgstr "propriétaire"
-#: core/models.py:399 core/models.py:535
+#: core/models.py:413 core/models.py:549
msgid "edit group"
msgstr "groupe d'édition"
-#: core/models.py:400 core/models.py:536
+#: core/models.py:414 core/models.py:550
msgid "view group"
msgstr "groupe de vue"
-#: core/models.py:401
+#: core/models.py:415
msgid "is folder"
msgstr "est un dossier"
-#: core/models.py:402
+#: core/models.py:416
msgid "mime type"
msgstr "type mime"
-#: core/models.py:403
+#: core/models.py:417
msgid "size"
msgstr "taille"
-#: core/models.py:433
+#: core/models.py:447
msgid "Character '/' not authorized in name"
msgstr "Le caractère '/' n'est pas autorisé dans les noms de fichier"
-#: core/models.py:436 core/models.py:441
+#: core/models.py:450 core/models.py:455
msgid "Loop in folder tree"
msgstr "Boucle dans l'arborescence des dossiers"
-#: core/models.py:445
+#: core/models.py:459
msgid "You can not make a file be a children of a non folder file"
msgstr ""
"Vous ne pouvez pas mettre un fichier enfant de quelque chose qui n'est pas "
"un dossier"
-#: core/models.py:449
+#: core/models.py:463
msgid "Duplicate file"
msgstr "Un fichier de ce nom existe déjà"
-#: core/models.py:459
+#: core/models.py:473
msgid "You must provide a file"
msgstr "Vous devez fournir un fichier"
-#: core/models.py:484
+#: core/models.py:498
msgid "Folder: "
msgstr "Dossier : "
-#: core/models.py:486
+#: core/models.py:500
msgid "File: "
msgstr "Fichier : "
-#: core/models.py:528 core/models.py:532
+#: core/models.py:542 core/models.py:546
msgid "page name"
msgstr "nom de la page"
-#: core/models.py:533
+#: core/models.py:547
msgid "owner group"
msgstr "groupe propriétaire"
-#: core/models.py:564
+#: core/models.py:578
msgid "Duplicate page"
msgstr "Une page de ce nom existe déjà"
-#: core/models.py:570
+#: core/models.py:584
msgid "Loop in page tree"
msgstr "Boucle dans l'arborescence des pages"
-#: core/models.py:677
+#: core/models.py:691
msgid "revision"
msgstr "révision"
-#: core/models.py:678
+#: core/models.py:692
msgid "page title"
msgstr "titre de la page"
-#: core/models.py:679
+#: core/models.py:693
msgid "page content"
msgstr "contenu de la page"
@@ -883,7 +892,7 @@ msgstr "403. Non autorisé"
msgid "404, Not Found"
msgstr "404. Non trouvé"
-#: core/templates/core/base.jinja:5
+#: core/templates/core/base.jinja:5 core/templates/core/index.jinja:4
msgid "Welcome!"
msgstr "Bienvenue!"
@@ -908,27 +917,31 @@ msgstr "Outils"
msgid "Logout"
msgstr "Déconnexion"
-#: core/templates/core/base.jinja:36 core/templates/core/search.jinja:10
+#: core/templates/core/base.jinja:28 core/templates/core/base.jinja.py:29
+msgid "Search"
+msgstr "Recherche"
+
+#: core/templates/core/base.jinja:40 core/templates/core/search.jinja:10
msgid "Users"
msgstr "Utilisateurs"
-#: core/templates/core/base.jinja:37
+#: core/templates/core/base.jinja:41
msgid "Wiki"
msgstr "Wiki"
-#: core/templates/core/base.jinja:38
+#: core/templates/core/base.jinja:42
msgid "Pages"
msgstr "Pages"
-#: core/templates/core/base.jinja:39 core/templates/core/search.jinja:18
+#: core/templates/core/base.jinja:43 core/templates/core/search.jinja:18
msgid "Clubs"
msgstr "Clubs"
-#: core/templates/core/base.jinja:40
+#: core/templates/core/base.jinja:44
msgid "Services"
msgstr "Services"
-#: core/templates/core/base.jinja:56
+#: core/templates/core/base.jinja:60
msgid "Site made by good people"
msgstr "Site réalisé par des gens bons"
@@ -957,12 +970,14 @@ msgstr "Confirmation"
#: core/templates/core/delete_confirm.jinja:14
#: core/templates/core/file_delete_confirm.jinja:14
-#: counter/templates/counter/counter_click.jinja:71
+#: counter/templates/counter/counter_click.jinja:72
msgid "Cancel"
msgstr "Annuler"
#: core/templates/core/edit.jinja:4 core/templates/core/edit.jinja.py:8
#: core/templates/core/file_edit.jinja:4
+#: counter/templates/counter/counter_edit.jinja:4
+#: counter/templates/counter/counter_edit.jinja:8
#, python-format
msgid "Edit %(obj)s"
msgstr "Éditer %(obj)s"
@@ -1038,7 +1053,7 @@ msgstr "Liste des groupes"
msgid "New group"
msgstr "Nouveau groupe"
-#: core/templates/core/index.jinja:6
+#: core/templates/core/index.jinja:7
msgid "Hello, world. You're at the core index using Jinja2."
msgstr "Hello, world! Vous êtes sur la page d'accueil utilisant Jinja2."
@@ -1069,12 +1084,15 @@ msgstr "login"
msgid "Lost password?"
msgstr "Mot de passe perdu ?"
-#: core/templates/core/macros.jinja:9 core/templates/core/macros.jinja:11
-#: core/templates/core/user_detail.jinja:12
-#: core/templates/core/user_edit.jinja:15
-#: core/templates/core/user_mini.jinja:4
-msgid "Profile"
-msgstr "Profil"
+#: core/templates/core/macros.jinja:30
+#: core/templates/core/user_detail.jinja:22
+msgid "Born: "
+msgstr "Né le : "
+
+#: core/templates/core/macros.jinja:34
+#: core/templates/core/user_detail.jinja:33
+msgid "Promo: "
+msgstr "Promo : "
#: core/templates/core/page.jinja:7 core/templates/core/page_list.jinja:4
#: core/templates/core/page_list.jinja:9
@@ -1247,7 +1265,6 @@ msgstr "Rechargements"
#: core/templates/core/user_account.jinja:17
#: core/templates/core/user_account.jinja:45
-#: counter/templates/counter/counter_click.jinja:24
msgid "Counter"
msgstr "Comptoir"
@@ -1299,30 +1316,20 @@ msgstr "Groupes"
msgid "%(user_name)s's profile"
msgstr "Profil de %(user_name)s"
-#: core/templates/core/user_detail.jinja:21
-#: core/templates/core/user_mini.jinja:12
-msgid "Born: "
-msgstr "Né le : "
-
-#: core/templates/core/user_detail.jinja:27
+#: core/templates/core/user_detail.jinja:28
msgid "Option: "
msgstr "Filière : "
-#: core/templates/core/user_detail.jinja:32
-#: core/templates/core/user_mini.jinja:16
-msgid "Promo: "
-msgstr "Promo : "
-
-#: core/templates/core/user_detail.jinja:40
+#: core/templates/core/user_detail.jinja:42
#, python-format
msgid "User is subscriber until %(subscription_end)s"
msgstr "L'utilisateur est cotisant jusqu'au %(subscription_end)s"
-#: core/templates/core/user_detail.jinja:42
+#: core/templates/core/user_detail.jinja:44
msgid "User is not subscribed. "
msgstr "L'utilisateur n'est pas cotisant."
-#: core/templates/core/user_detail.jinja:43
+#: core/templates/core/user_detail.jinja:45
#: subscription/templates/subscription/subscription.jinja:4
#: subscription/templates/subscription/subscription.jinja:8
msgid "New subscription"
@@ -1382,6 +1389,7 @@ msgid "User list"
msgstr "Liste d'utilisateurs"
#: core/templates/core/user_stats.jinja:4
+#, python-format
msgid "%(user_name)s's stats"
msgstr "Stats de %(user_name)s"
@@ -1439,7 +1447,7 @@ msgstr "Ajouter un nouveau dossier"
msgid "Error creating folder %(folder_name)s: %(msg)s"
msgstr "Erreur de création du dossier %(folder_name)s : %(msg)s"
-#: core/views/files.py:62 core/views/forms.py:154 core/views/forms.py:158
+#: core/views/files.py:62 core/views/forms.py:168 core/views/forms.py:172
#, python-format
msgid "Error uploading file %(file_name)s: %(msg)s"
msgstr "Erreur d'envoie du fichier %(file_name)s : %(msg)s"
@@ -1448,7 +1456,11 @@ msgstr "Erreur d'envoie du fichier %(file_name)s : %(msg)s"
msgid "Choose file"
msgstr "Choisir un fichier"
-#: core/views/forms.py:113
+#: core/views/forms.py:63 core/views/forms.py:66
+msgid "Choose user"
+msgstr "Choisir un utilisateur"
+
+#: core/views/forms.py:127
msgid ""
"Profile: you need to be visible on the picture, in order to be recognized (e."
"g. by the barmen)"
@@ -1456,15 +1468,15 @@ msgstr ""
"Photo de profil: vous devez être visible sur la photo afin d'être reconnu "
"(par exemple par les barmen)"
-#: core/views/forms.py:114
+#: core/views/forms.py:128
msgid "Avatar: used on the forum"
msgstr "Avatar : utilisé sur le forum"
-#: core/views/forms.py:115
+#: core/views/forms.py:129
msgid "Scrub: let other know how your scrub looks like!"
msgstr "Blouse : montrez aux autres à quoi ressemble votre blouse !"
-#: core/views/forms.py:159
+#: core/views/forms.py:173
msgid "Bad image format, only jpeg, png, and gif are accepted"
msgstr "Mauvais format d'image, seuls les jpeg, png, et gif sont acceptés"
@@ -1480,7 +1492,7 @@ msgstr "client"
msgid "customers"
msgstr "clients"
-#: counter/models.py:44 counter/templates/counter/counter_click.jinja:46
+#: counter/models.py:44 counter/templates/counter/counter_click.jinja:47
msgid "Not enough money"
msgstr "Solde insuffisant"
@@ -1520,7 +1532,7 @@ msgstr "Bureau"
#: eboutic/templates/eboutic/eboutic_main.jinja:24
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:8
#: eboutic/templates/eboutic/eboutic_payment_result.jinja:4
-#: sith/settings.py:279 sith/settings_sample.py:265
+#: sith/settings.py:283 sith/settings_sample.py:266
msgid "Eboutic"
msgstr "Eboutic"
@@ -1556,9 +1568,9 @@ msgstr "quantité"
msgid "Sith account"
msgstr "Compte utilisateur"
-#: counter/models.py:257 sith/settings.py:272 sith/settings.py:277
-#: sith/settings.py:298 sith/settings_sample.py:258
-#: sith/settings_sample.py:263 sith/settings_sample.py:284
+#: counter/models.py:257 sith/settings.py:276 sith/settings.py:281
+#: sith/settings.py:302 sith/settings_sample.py:259
+#: sith/settings_sample.py:264 sith/settings_sample.py:285
msgid "Credit card"
msgstr "Carte banquaire"
@@ -1570,47 +1582,43 @@ msgstr "vente"
msgid "permanency"
msgstr "permanence"
-#: counter/templates/counter/counter_click.jinja:26
-msgid "Club: "
-msgstr "Club : "
-
#: counter/templates/counter/counter_click.jinja:29
msgid "Customer"
msgstr "Client"
-#: counter/templates/counter/counter_click.jinja:34
+#: counter/templates/counter/counter_click.jinja:35
msgid "Refilling"
msgstr "Rechargement"
-#: counter/templates/counter/counter_click.jinja:39
-#: counter/templates/counter/counter_click.jinja:52
+#: counter/templates/counter/counter_click.jinja:40
+#: counter/templates/counter/counter_click.jinja:53
#: launderette/templates/launderette/launderette_admin.jinja:35
#: launderette/templates/launderette/launderette_click.jinja:14
msgid "Go"
msgstr "Valider"
-#: counter/templates/counter/counter_click.jinja:44
+#: counter/templates/counter/counter_click.jinja:45
#: launderette/templates/launderette/launderette_admin.jinja:8
msgid "Selling"
msgstr "Vente"
-#: counter/templates/counter/counter_click.jinja:54
+#: counter/templates/counter/counter_click.jinja:55
#: eboutic/templates/eboutic/eboutic_main.jinja:27
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:11
msgid "Basket: "
msgstr "Panier : "
-#: counter/templates/counter/counter_click.jinja:62
+#: counter/templates/counter/counter_click.jinja:63
#: counter/templates/counter/counter_main.jinja:24
#: eboutic/templates/eboutic/eboutic_main.jinja:34
msgid "Total: "
msgstr "Total : "
-#: counter/templates/counter/counter_click.jinja:66
+#: counter/templates/counter/counter_click.jinja:67
msgid "Finish"
msgstr "Terminer"
-#: counter/templates/counter/counter_click.jinja:73
+#: counter/templates/counter/counter_click.jinja:74
msgid "Products: "
msgstr "Produits : "
@@ -1624,6 +1632,10 @@ msgid "New counter"
msgstr "Nouveau comptoir"
#: counter/templates/counter/counter_list.jinja:23
+msgid "Props"
+msgstr "Propriétés"
+
+#: counter/templates/counter/counter_list.jinja:29
msgid "There is no counters in this website."
msgstr "Il n'y a pas de comptoirs dans ce site web."
@@ -1691,19 +1703,23 @@ msgstr "Nouveau type de produit"
msgid "There is no product types in this website."
msgstr "Il n'y a pas de types de produit dans ce site web."
-#: counter/views.py:49
+#: counter/views.py:35
+msgid "Select user"
+msgstr "Choisir un utilisateur"
+
+#: counter/views.py:51
msgid "User not found"
msgstr "Utilisateur non trouvé"
-#: counter/views.py:212
+#: counter/views.py:214
msgid "END"
msgstr "FIN"
-#: counter/views.py:214
+#: counter/views.py:216
msgid "CAN"
msgstr "ANN"
-#: counter/views.py:244
+#: counter/views.py:246
msgid "You have not enough money to buy all the basket"
msgstr "Vous n'avez pas assez d'argent pour acheter le panier"
@@ -1855,12 +1871,12 @@ msgid "Washing and drying"
msgstr "Lavage et séchage"
#: launderette/templates/launderette/launderette_book.jinja:26
-#: sith/settings.py:408 sith/settings_sample.py:394
+#: sith/settings.py:412 sith/settings_sample.py:395
msgid "Washing"
msgstr "Lavage"
#: launderette/templates/launderette/launderette_book.jinja:30
-#: sith/settings.py:408 sith/settings_sample.py:394
+#: sith/settings.py:412 sith/settings_sample.py:395
msgid "Drying"
msgstr "Séchage"
@@ -1915,108 +1931,108 @@ msgstr "L'utilisateur n'a pas réservé de créneau"
msgid "Token not found"
msgstr "Jeton non trouvé"
-#: sith/settings.py:269 sith/settings.py:276 sith/settings.py:296
-#: sith/settings_sample.py:255 sith/settings_sample.py:262
-#: sith/settings_sample.py:282
+#: sith/settings.py:273 sith/settings.py:280 sith/settings.py:300
+#: sith/settings_sample.py:256 sith/settings_sample.py:263
+#: sith/settings_sample.py:283
msgid "Check"
msgstr "Chèque"
-#: sith/settings.py:270 sith/settings.py:278 sith/settings.py:297
-#: sith/settings_sample.py:256 sith/settings_sample.py:264
-#: sith/settings_sample.py:283
+#: sith/settings.py:274 sith/settings.py:282 sith/settings.py:301
+#: sith/settings_sample.py:257 sith/settings_sample.py:265
+#: sith/settings_sample.py:284
msgid "Cash"
msgstr "Espèces"
-#: sith/settings.py:271 sith/settings_sample.py:257
+#: sith/settings.py:275 sith/settings_sample.py:258
msgid "Transfert"
msgstr "Virement"
-#: sith/settings.py:284 sith/settings_sample.py:270
+#: sith/settings.py:288 sith/settings_sample.py:271
msgid "Belfort"
msgstr "Belfort"
-#: sith/settings.py:285 sith/settings_sample.py:271
+#: sith/settings.py:289 sith/settings_sample.py:272
msgid "Sevenans"
msgstr "Sevenans"
-#: sith/settings.py:286 sith/settings_sample.py:272
+#: sith/settings.py:290 sith/settings_sample.py:273
msgid "Montbéliard"
msgstr "Montbéliard"
-#: sith/settings.py:321 sith/settings_sample.py:307
+#: sith/settings.py:325 sith/settings_sample.py:308
msgid "One semester"
msgstr "Un semestre"
-#: sith/settings.py:326 sith/settings_sample.py:312
+#: sith/settings.py:330 sith/settings_sample.py:313
msgid "Two semesters"
msgstr "Deux semestres"
-#: sith/settings.py:331 sith/settings_sample.py:317
+#: sith/settings.py:335 sith/settings_sample.py:318
msgid "Common core cursus"
msgstr "Cursus tronc commun"
-#: sith/settings.py:336 sith/settings.py:341 sith/settings_sample.py:322
-#: sith/settings_sample.py:327
+#: sith/settings.py:340 sith/settings.py:345 sith/settings_sample.py:323
+#: sith/settings_sample.py:328
msgid "Branch cursus"
msgstr "Cursus branche"
-#: sith/settings.py:346 sith/settings_sample.py:332
+#: sith/settings.py:350 sith/settings_sample.py:333
msgid "Honorary member"
msgstr "Membre honoraire"
-#: sith/settings.py:351 sith/settings_sample.py:337
+#: sith/settings.py:355 sith/settings_sample.py:338
msgid "Assidu member"
msgstr "Membre d'Assidu"
-#: sith/settings.py:356 sith/settings_sample.py:342
+#: sith/settings.py:360 sith/settings_sample.py:343
msgid "Amicale/DOCEO member"
msgstr "Membre de l'Amicale/DOCEO"
-#: sith/settings.py:361 sith/settings_sample.py:347
+#: sith/settings.py:365 sith/settings_sample.py:348
msgid "UT network member"
msgstr "Cotisant du réseau UT"
-#: sith/settings.py:366 sith/settings_sample.py:352
+#: sith/settings.py:370 sith/settings_sample.py:353
msgid "CROUS member"
msgstr "Membres du CROUS"
-#: sith/settings.py:371 sith/settings_sample.py:357
+#: sith/settings.py:375 sith/settings_sample.py:358
msgid "Sbarro/ESTA member"
msgstr "Membre de Sbarro ou de l'ESTA"
-#: sith/settings.py:379 sith/settings_sample.py:365
+#: sith/settings.py:383 sith/settings_sample.py:366
msgid "President"
msgstr "Président"
-#: sith/settings.py:380 sith/settings_sample.py:366
+#: sith/settings.py:384 sith/settings_sample.py:367
msgid "Vice-President"
msgstr "Vice-Président"
-#: sith/settings.py:381 sith/settings_sample.py:367
+#: sith/settings.py:385 sith/settings_sample.py:368
msgid "Treasurer"
msgstr "Trésorier"
-#: sith/settings.py:382 sith/settings_sample.py:368
+#: sith/settings.py:386 sith/settings_sample.py:369
msgid "Communication supervisor"
msgstr "Responsable com"
-#: sith/settings.py:383 sith/settings_sample.py:369
+#: sith/settings.py:387 sith/settings_sample.py:370
msgid "Secretary"
msgstr "Secrétaire"
-#: sith/settings.py:384 sith/settings_sample.py:370
+#: sith/settings.py:388 sith/settings_sample.py:371
msgid "IT supervisor"
msgstr "Responsable info"
-#: sith/settings.py:385 sith/settings_sample.py:371
+#: sith/settings.py:389 sith/settings_sample.py:372
msgid "Board member"
msgstr "Membre du bureau"
-#: sith/settings.py:386 sith/settings_sample.py:372
+#: sith/settings.py:390 sith/settings_sample.py:373
msgid "Active member"
msgstr "Membre actif"
-#: sith/settings.py:387 sith/settings_sample.py:373
+#: sith/settings.py:391 sith/settings_sample.py:374
msgid "Curious"
msgstr "Curieux"
@@ -2052,11 +2068,14 @@ msgstr "Vous ne pouvez pas cotiser plusieurs fois pour la même période"
msgid "You are trying to create a subscription without member"
msgstr "Vous essayez de créer une cotisation sans membre"
-#: subscription/views.py:42
+#: subscription/views.py:52
msgid "A user with that email address already exists"
msgstr "Un utilisateur avec cette adresse email existe déjà"
-#: subscription/views.py:57
+#: subscription/views.py:67
msgid "You must either choose an existing user or create a new one properly"
msgstr ""
"Vous devez soit choisir un utilisateur existant, ou en créer un proprement."
+
+#~ msgid "Club: "
+#~ msgstr "Club : "
diff --git a/migrate.py b/migrate.py
index 913103e3..1622e19c 100644
--- a/migrate.py
+++ b/migrate.py
@@ -541,7 +541,7 @@ def migrate_sellings():
op = User.objects.filter(id=r['id_utilisateur']).first() or root
customer = Customer.objects.filter(user__id=r['id_utilisateur_client']).first() or root.customer
new = Selling(
- label=product.name,
+ label=product.name or "Produit supprimé",
counter=counter,
club=club,
product=product,
diff --git a/sith/settings_sample.py b/sith/settings_sample.py
index d7c53edb..637f13f2 100644
--- a/sith/settings_sample.py
+++ b/sith/settings_sample.py
@@ -44,6 +44,7 @@ INSTALLED_APPS = (
'django.contrib.sites',
'django_jinja',
'rest_framework',
+ 'ajax_select',
'core',
'club',
'subscription',
diff --git a/sith/urls.py b/sith/urls.py
index 37664230..de600744 100644
--- a/sith/urls.py
+++ b/sith/urls.py
@@ -17,6 +17,7 @@ from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls.static import static
from django.conf import settings
+from ajax_select import urls as ajax_select_urls
handler403 = "core.views.forbidden"
handler404 = "core.views.not_found"
@@ -31,5 +32,6 @@ urlpatterns = [
url(r'^launderette/', include('launderette.urls', namespace="launderette", app_name="launderette")),
url(r'^api/v1/', include('api.urls', namespace="api", app_name="api")),
url(r'^admin/', include(admin.site.urls)),
+ url(r'^ajax_select/', include(ajax_select_urls)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # TODO: remove me for production!!!
diff --git a/subscription/templates/subscription/subscription.jinja b/subscription/templates/subscription/subscription.jinja
index f0cb1173..4568d655 100644
--- a/subscription/templates/subscription/subscription.jinja
+++ b/subscription/templates/subscription/subscription.jinja
@@ -27,16 +27,18 @@
{{ super() }}