From a01fc63a82bd30d5f84291ccb7f5828dc964e7dd Mon Sep 17 00:00:00 2001 From: Skia Date: Thu, 28 Jul 2016 20:05:56 +0200 Subject: [PATCH] Begin launderette --- core/management/commands/populate.py | 13 ++ core/models.py | 2 +- core/static/core/style.css | 5 + core/templates/core/login.jinja | 16 +- core/templates/core/page.jinja | 2 +- counter/migrations/0010_auto_20160728_1820.py | 38 ++++ launderette/__init__.py | 0 launderette/admin.py | 3 + launderette/migrations/0001_initial.py | 47 ++++ .../migrations/0002_auto_20160728_1858.py | 39 ++++ .../migrations/0003_launderette_sellers.py | 20 ++ .../migrations/0004_auto_20160728_1922.py | 19 ++ launderette/migrations/__init__.py | 0 launderette/models.py | 76 +++++++ .../templates/launderette/counter_click.jinja | 79 +++++++ .../templates/launderette/counter_edit.jinja | 13 ++ .../templates/launderette/counter_main.jinja | 55 +++++ .../launderette/launderette_book.jinja | 21 ++ .../launderette/launderette_detail.jinja | 13 ++ .../launderette/launderette_list.jinja | 23 ++ .../launderette/launderette_main.jinja | 21 ++ .../templates/launderette/product_list.jinja | 23 ++ .../launderette/producttype_list.jinja | 24 +++ .../templates/launderette/user_account.jinja | 86 ++++++++ launderette/tests.py | 3 + launderette/urls.py | 17 ++ launderette/views.py | 62 ++++++ locale/fr/LC_MESSAGES/django.mo | Bin 19244 -> 20085 bytes locale/fr/LC_MESSAGES/django.po | 200 ++++++++++++++---- sith/settings_sample.py | 11 +- sith/urls.py | 1 + 31 files changed, 871 insertions(+), 61 deletions(-) create mode 100644 counter/migrations/0010_auto_20160728_1820.py create mode 100644 launderette/__init__.py create mode 100644 launderette/admin.py create mode 100644 launderette/migrations/0001_initial.py create mode 100644 launderette/migrations/0002_auto_20160728_1858.py create mode 100644 launderette/migrations/0003_launderette_sellers.py create mode 100644 launderette/migrations/0004_auto_20160728_1922.py create mode 100644 launderette/migrations/__init__.py create mode 100644 launderette/models.py create mode 100644 launderette/templates/launderette/counter_click.jinja create mode 100644 launderette/templates/launderette/counter_edit.jinja create mode 100644 launderette/templates/launderette/counter_main.jinja create mode 100644 launderette/templates/launderette/launderette_book.jinja create mode 100644 launderette/templates/launderette/launderette_detail.jinja create mode 100644 launderette/templates/launderette/launderette_list.jinja create mode 100644 launderette/templates/launderette/launderette_main.jinja create mode 100644 launderette/templates/launderette/product_list.jinja create mode 100644 launderette/templates/launderette/producttype_list.jinja create mode 100644 launderette/templates/launderette/user_account.jinja create mode 100644 launderette/tests.py create mode 100644 launderette/urls.py create mode 100644 launderette/views.py diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py index 9557ab6c..2cf0bbeb 100644 --- a/core/management/commands/populate.py +++ b/core/management/commands/populate.py @@ -52,6 +52,7 @@ class Command(BaseCommand): c.edit_groups = [g] c.save() self.reset_index("counter") + Counter(name="Eboutic", club=main_club, type='EBOUTIC').save() p = Page(name='Index') p.set_lock(root) p.save() @@ -132,6 +133,18 @@ Welcome to the wiki page! p.save() PageRev(page=p, title="Aide sur la syntaxe", author=skia, content=""" Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site. +""").save() + p = Page(name='Services') + p.save() + p.set_lock(skia) + p.view_groups=[settings.SITH_GROUPS['public']['id']] + p.save() + PageRev(page=p, title="Services", author=skia, content=""" +| | | | +| :---: | :---: | :---: | +| [Eboutic](/eboutic) | [Laverie](/launderette) | Matmat | +| SAS | Weekmail | Forum| + """).save() # Adding README p = Page(name='README') diff --git a/core/models.py b/core/models.py index a0834330..e919acf5 100644 --- a/core/models.py +++ b/core/models.py @@ -447,7 +447,7 @@ class Page(models.Model): return '/'.join([self.parent.get_full_name(), self.name]) def get_display_name(self): - return self.get_full_name() + return self.revisions.last().title class PageRev(models.Model): """ diff --git a/core/static/core/style.css b/core/static/core/style.css index 7ef55ccd..55ae5f08 100644 --- a/core/static/core/style.css +++ b/core/static/core/style.css @@ -166,6 +166,11 @@ tbody>tr:hover { padding: 4px; line-height: 120%; } +textarea { + white-space: pre; + width: 98%; + margin-top: 10px; +} /*--------------------------------FOOTER-------------------------------*/ footer{ diff --git a/core/templates/core/login.jinja b/core/templates/core/login.jinja index 68397ae5..c30f0b18 100644 --- a/core/templates/core/login.jinja +++ b/core/templates/core/login.jinja @@ -17,19 +17,9 @@
{% csrf_token %} - - - - - - - - - -
{{ form.username.label_tag() }}{{ form.username }}
{{ form.password.label_tag() }}{{ form.password }}
- - - +{{ form.as_p() }} + +

{# Assumes you setup the password_reset view in your URLconf #} diff --git a/core/templates/core/page.jinja b/core/templates/core/page.jinja index be504a8e..ab97da42 100644 --- a/core/templates/core/page.jinja +++ b/core/templates/core/page.jinja @@ -15,7 +15,7 @@ {% macro print_page_name(page) %} {% if page %} {{ print_page_name(page.parent) }} > -{{ page.name }} +{{ page.get_display_name() }} {% endif %} {% endmacro %} diff --git a/counter/migrations/0010_auto_20160728_1820.py b/counter/migrations/0010_auto_20160728_1820.py new file mode 100644 index 00000000..3b17255b --- /dev/null +++ b/counter/migrations/0010_auto_20160728_1820.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('counter', '0009_auto_20160721_1902'), + ] + + operations = [ + migrations.AlterModelOptions( + name='counter', + options={'verbose_name': 'counter'}, + ), + migrations.AlterModelOptions( + name='permanency', + options={'verbose_name': 'permanency'}, + ), + migrations.AlterModelOptions( + name='product', + options={'verbose_name': 'product'}, + ), + migrations.AlterModelOptions( + name='producttype', + options={'verbose_name': 'product type'}, + ), + migrations.AlterModelOptions( + name='refilling', + options={'verbose_name': 'refilling'}, + ), + migrations.AlterModelOptions( + name='selling', + options={'verbose_name': 'selling'}, + ), + ] diff --git a/launderette/__init__.py b/launderette/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/launderette/admin.py b/launderette/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/launderette/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/launderette/migrations/0001_initial.py b/launderette/migrations/0001_initial.py new file mode 100644 index 00000000..deacb3bd --- /dev/null +++ b/launderette/migrations/0001_initial.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Launderette', + fields=[ + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), + ('name', models.CharField(max_length=30, verbose_name='name')), + ], + options={ + 'verbose_name': 'Launderette', + }, + ), + migrations.CreateModel( + name='Machine', + fields=[ + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), + ('name', models.CharField(max_length=30, verbose_name='name')), + ('is_working', models.BooleanField(default=True, verbose_name='is working')), + ('launderette', models.ForeignKey(to='launderette.Launderette', related_name='machines', verbose_name='launderette')), + ], + options={ + 'verbose_name': 'Machine', + }, + ), + migrations.CreateModel( + name='Token', + fields=[ + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), + ('name', models.CharField(max_length=30, verbose_name='name')), + ('type', models.CharField(choices=[('WASHING', 'Washing'), ('DRYING', 'Drying')], max_length=10, verbose_name='type')), + ('launderette', models.ForeignKey(to='launderette.Launderette', related_name='tokens', verbose_name='launderette')), + ], + options={ + 'verbose_name': 'Token', + }, + ), + ] diff --git a/launderette/migrations/0002_auto_20160728_1858.py b/launderette/migrations/0002_auto_20160728_1858.py new file mode 100644 index 00000000..f8aa6b6d --- /dev/null +++ b/launderette/migrations/0002_auto_20160728_1858.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('subscription', '0002_auto_20160718_1805'), + ('launderette', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Slot', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)), + ('start_date', models.DateTimeField(verbose_name='start date')), + ('type', models.CharField(max_length=10, verbose_name='type', choices=[('WASHING', 'Washing'), ('DRYING', 'Drying')])), + ('machine', models.ForeignKey(verbose_name='machine', related_name='slots', to='launderette.Machine')), + ], + ), + migrations.AlterField( + model_name='token', + name='name', + field=models.IntegerField(verbose_name='name'), + ), + migrations.AddField( + model_name='slot', + name='token', + field=models.ForeignKey(verbose_name='token', related_name='slots', to='launderette.Token'), + ), + migrations.AddField( + model_name='slot', + name='user', + field=models.ForeignKey(verbose_name='user', related_name='slots', to='subscription.Subscriber'), + ), + ] diff --git a/launderette/migrations/0003_launderette_sellers.py b/launderette/migrations/0003_launderette_sellers.py new file mode 100644 index 00000000..de418c0f --- /dev/null +++ b/launderette/migrations/0003_launderette_sellers.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('subscription', '0002_auto_20160718_1805'), + ('launderette', '0002_auto_20160728_1858'), + ] + + operations = [ + migrations.AddField( + model_name='launderette', + name='sellers', + field=models.ManyToManyField(to='subscription.Subscriber', verbose_name='sellers', related_name='launderettes'), + ), + ] diff --git a/launderette/migrations/0004_auto_20160728_1922.py b/launderette/migrations/0004_auto_20160728_1922.py new file mode 100644 index 00000000..6bcbdbe8 --- /dev/null +++ b/launderette/migrations/0004_auto_20160728_1922.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('launderette', '0003_launderette_sellers'), + ] + + operations = [ + migrations.AlterField( + model_name='launderette', + name='sellers', + field=models.ManyToManyField(blank=True, to='subscription.Subscriber', verbose_name='sellers', related_name='launderettes'), + ), + ] diff --git a/launderette/migrations/__init__.py b/launderette/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/launderette/models.py b/launderette/models.py new file mode 100644 index 00000000..945a9766 --- /dev/null +++ b/launderette/models.py @@ -0,0 +1,76 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ +from django.conf import settings +from django.core.urlresolvers import reverse + +from core.models import User +from subscription.models import Subscriber + +# Create your models here. + +class Launderette(models.Model): + name = models.CharField(_('name'), max_length=30) + sellers = models.ManyToManyField(Subscriber, verbose_name=_('sellers'), related_name='launderettes', blank=True) + + class Meta: + verbose_name = _('Launderette') + + def is_owned_by(self, user): + """ + Method to see if that object can be edited by the given user + """ + if user.is_in_group(settings.SITH_GROUPS['launderette-admin']['name']): + return True + return False + + def can_be_viewed_by(self, user): + return user.is_in_group(settings.SITH_MAIN_MEMBERS_GROUP) + + def __str__(self): + return self.name + + def get_absolute_url(self): + return reverse('launderette:launderette_list') + +class Machine(models.Model): + name = models.CharField(_('name'), max_length=30) + launderette = models.ForeignKey(Launderette, related_name='machines', verbose_name=_('launderette')) + is_working = models.BooleanField(_('is working'), default=True) + + class Meta: + verbose_name = _('Machine') + + def is_owned_by(self, user): + """ + Method to see if that object can be edited by the given user + """ + if user.is_in_group(settings.SITH_GROUPS['launderette-admin']['name']): + return True + return False + +class Token(models.Model): + name = models.IntegerField(_('name')) + launderette = models.ForeignKey(Launderette, related_name='tokens', verbose_name=_('launderette')) + type = models.CharField(_('type'), max_length=10, choices=[('WASHING', _('Washing')), ('DRYING', _('Drying'))]) + + class Meta: + verbose_name = _('Token') + + def is_owned_by(self, user): + """ + Method to see if that object can be edited by the given user + """ + if user.is_in_group(settings.SITH_GROUPS['launderette-admin']['name']): + return True + return False + +class Slot(models.Model): + start_date = models.DateTimeField(_('start date')) + type = models.CharField(_('type'), max_length=10, choices=[('WASHING', _('Washing')), ('DRYING', _('Drying'))]) + machine = models.ForeignKey(Machine, related_name='slots', verbose_name=_('machine')) + token = models.ForeignKey(Token, related_name='slots', verbose_name=_('token')) + user = models.ForeignKey(Subscriber, related_name='slots', verbose_name=_('user')) + + def full_clean(self): + return super(Slot, self).full_clean() + diff --git a/launderette/templates/launderette/counter_click.jinja b/launderette/templates/launderette/counter_click.jinja new file mode 100644 index 00000000..317a1b36 --- /dev/null +++ b/launderette/templates/launderette/counter_click.jinja @@ -0,0 +1,79 @@ +{% extends "core/base.jinja" %} + +{% macro add_product(id, content) %} +
+ {% csrf_token %} + + +
+{% endmacro %} + +{% macro del_product(id, content) %} +
+ {% csrf_token %} + + +
+{% endmacro %} + +{% block content %} +

{% trans %}Counter{% endtrans %}

+

{{ counter }}

+

{% trans %}Club: {% endtrans %} {{ counter.club }}

+ +
+
{% trans %}Customer{% endtrans %}
+

{{ customer.user.get_display_name() }}, {{ customer.amount }} €

+
+{% if counter.type == 'BAR' %} +
+
{% trans %}Refilling{% endtrans %}
+
+ {% csrf_token %} + {{ refill_form.as_p() }} + + +
+
+{% endif %} +
+
{% trans %}Selling{% endtrans %}
+ {% if request.session['not_enough'] %} +

{% trans %}Not enough money{% endtrans %}

+ {% endif %} +
+ {% csrf_token %} + + + +
+

{% trans %}Basket: {% endtrans %}

+ +

{% trans %}Total: {% endtrans %}{{ "%0.2f"|format(basket_total) }} €

+
+ {% csrf_token %} + + +
+
+ {% csrf_token %} + + +
+

{% trans %}Products: {% endtrans %} + {% for p in counter.products.all() %} + {{ add_product(p.id, p.name) }} + {% endfor %} +

+
+ +{% endblock %} + + + diff --git a/launderette/templates/launderette/counter_edit.jinja b/launderette/templates/launderette/counter_edit.jinja new file mode 100644 index 00000000..865ed1f3 --- /dev/null +++ b/launderette/templates/launderette/counter_edit.jinja @@ -0,0 +1,13 @@ +{% extends "core/base.jinja" %} + +{% block content %} +

{% trans %}Edit counter{% endtrans %}

+
+ {% csrf_token %} + {{ form.as_p() }} +

+
+{% endblock %} + + + diff --git a/launderette/templates/launderette/counter_main.jinja b/launderette/templates/launderette/counter_main.jinja new file mode 100644 index 00000000..1dcbd143 --- /dev/null +++ b/launderette/templates/launderette/counter_main.jinja @@ -0,0 +1,55 @@ +{% extends "core/base.jinja" %} + +{% macro barman_logout_link(user) %} +
+ {% csrf_token %} + + +
+{% endmacro %} + +{% block content %} +

{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}

+ +
+

{% trans %}Sellings{% endtrans %}

+ {% if last_basket %} +

{% trans %}Last selling: {% endtrans %}

+

{% trans %}Client: {% endtrans %}{{ last_customer }} - {% trans %}New amount: {% endtrans %}{{ new_customer_amount }} €.

+ +

{% trans %}Total: {% endtrans %}{{ last_total }} €

+ {% endif %} + {% if barmen %} +

{% trans %}Enter client code:{% endtrans %}

+
+ {% csrf_token %} + {{ form.as_p() }} +

+
+ {% else %} +

{% trans %}Please, login{% endtrans %}

+ {% endif %} +
+ {% if counter.type == 'BAR' %} +
+

{% trans %}Barman: {% endtrans %}

+ +
+ {% csrf_token %} + {{ login_form.as_p() }} +

+
+
+ {% endif %} +{% endblock %} + + + diff --git a/launderette/templates/launderette/launderette_book.jinja b/launderette/templates/launderette/launderette_book.jinja new file mode 100644 index 00000000..af30c6c1 --- /dev/null +++ b/launderette/templates/launderette/launderette_book.jinja @@ -0,0 +1,21 @@ +{% extends "core/base.jinja" %} + +{% block title %} +{% trans %}Launderette{% endtrans %} +{% endblock %} + +{% block content %} +{% if request.user.is_in_group(settings.SITH_MAIN_MEMBERS_GROUP) %} + +{% endif %} +{% endblock %} + + + + + + diff --git a/launderette/templates/launderette/launderette_detail.jinja b/launderette/templates/launderette/launderette_detail.jinja new file mode 100644 index 00000000..44885117 --- /dev/null +++ b/launderette/templates/launderette/launderette_detail.jinja @@ -0,0 +1,13 @@ +{% extends "core/base.jinja" %} + +{% block title %} +{% trans %}Launderette admin{% endtrans %} +{% endblock %} + +{% block content %} +Admin +{% endblock %} + + + + diff --git a/launderette/templates/launderette/launderette_list.jinja b/launderette/templates/launderette/launderette_list.jinja new file mode 100644 index 00000000..009bc19a --- /dev/null +++ b/launderette/templates/launderette/launderette_list.jinja @@ -0,0 +1,23 @@ +{% extends "core/base.jinja" %} + +{% block title %} +{% trans %}Launderette admin list{% endtrans %} +{% endblock %} + +{% block content %} +

{% trans %}New launderette{% endtrans %}

+{% if launderette_list %} +

{% trans %}Launderette admin list{% endtrans %}

+ +{% else %} +{% trans %}There is no launderette in this website.{% endtrans %} +{% endif %} +{% endblock %} + + + diff --git a/launderette/templates/launderette/launderette_main.jinja b/launderette/templates/launderette/launderette_main.jinja new file mode 100644 index 00000000..d3f7653e --- /dev/null +++ b/launderette/templates/launderette/launderette_main.jinja @@ -0,0 +1,21 @@ +{% extends "core/base.jinja" %} + +{% block title %} +{% trans %}Launderette{% endtrans %} +{% endblock %} + +{% block content %} +{% if request.user.is_in_group(settings.SITH_GROUPS['launderette-admin']['name']) %} +

{% trans %}Edit presentation page{% endtrans %}

+{% endif %} +{% if request.user.is_in_group(settings.SITH_MAIN_MEMBERS_GROUP) %} +

{% trans %}Book launderette slot{% endtrans %}

+{% endif %} + +{{ page.revisions.last().content|markdown }} +{% endblock %} + + + + + diff --git a/launderette/templates/launderette/product_list.jinja b/launderette/templates/launderette/product_list.jinja new file mode 100644 index 00000000..f9a50085 --- /dev/null +++ b/launderette/templates/launderette/product_list.jinja @@ -0,0 +1,23 @@ +{% extends "core/base.jinja" %} + +{% block title %} +{% trans %}Product list{% endtrans %} +{% endblock %} + +{% block content %} +

{% trans %}New product{% endtrans %}

+{% if product_list %} +

{% trans %}Product list{% endtrans %}

+ +{% else %} +{% trans %}There is no products in this website.{% endtrans %} +{% endif %} +{% endblock %} + + + + diff --git a/launderette/templates/launderette/producttype_list.jinja b/launderette/templates/launderette/producttype_list.jinja new file mode 100644 index 00000000..9a686dc8 --- /dev/null +++ b/launderette/templates/launderette/producttype_list.jinja @@ -0,0 +1,24 @@ +{% extends "core/base.jinja" %} + +{% block title %} +{% trans %}Product type list{% endtrans %} +{% endblock %} + +{% block content %} +

{% trans %}New product type{% endtrans %}

+{% if producttype_list %} +

{% trans %}Product type list{% endtrans %}

+ +{% else %} +{% trans %}There is no product types in this website.{% endtrans %} +{% endif %} +{% endblock %} + + + + + diff --git a/launderette/templates/launderette/user_account.jinja b/launderette/templates/launderette/user_account.jinja new file mode 100644 index 00000000..02283eb3 --- /dev/null +++ b/launderette/templates/launderette/user_account.jinja @@ -0,0 +1,86 @@ +{% extends "core/user_base.jinja" %} + +{% block title %} +{% trans user_name=profile.get_display_name() %}{{ user_name }}'s account{% endtrans %} +{% endblock %} + +{% block infos %} +

{% trans %}User account{% endtrans %}

+

{% trans %}Amount: {% endtrans %}{{ customer.amount }} €

+{% if customer.refillings.exists() %} +

{% trans %}Refillings{% endtrans %}

+ + + + + + + + + + {% for i in customer.refillings.all() %} + + + + + +{% endfor %} + +
{% trans %}Date{% endtrans %}{% trans %}Barman{% endtrans %}{% trans %}Amount{% endtrans %}
{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}{{ i.operator }}{{ i.amount }} €
+{% endif %} +{% if customer.buyings.exists() %} +

{% trans %}Buyings{% endtrans %}

+ + + + + + + + + + + + {% for i in customer.buyings.all() %} + + + + + + + +{% endfor %} + +
{% trans %}Date{% endtrans %}{% trans %}Barman{% endtrans %}{% trans %}Product{% endtrans %}{% trans %}Quantity{% endtrans %}{% trans %}Total{% endtrans %}
{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}{{ i.seller }}{{ i.product }}{{ i.quantity }}{{ i.quantity * i.unit_price }} €
+{% endif %} +{% if customer.user.invoices.exists() %} +

{% trans %}Invoices{% endtrans %}

+ + + + + + + + + + {% for i in customer.user.invoices.all() %} + + + + + +{% endfor %} + +
{% trans %}Date{% endtrans %}{% trans %}Items{% endtrans %}{% trans %}Amount{% endtrans %}
{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }} +
    + {% for it in i.items.all() %} +
  • {{ it.product_name }} - {{ it.product_unit_price }} €
  • + {% endfor %} +
+
{{ i.get_total() }} €
+{% endif %} +{% endblock %} + + + diff --git a/launderette/tests.py b/launderette/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/launderette/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/launderette/urls.py b/launderette/urls.py new file mode 100644 index 00000000..fe045885 --- /dev/null +++ b/launderette/urls.py @@ -0,0 +1,17 @@ +from django.conf.urls import url, include + +from launderette.views import * + +urlpatterns = [ + # views + url(r'^$', LaunderetteMainView.as_view(), name='launderette_main'), + url(r'^book$', LaunderetteBookMainView.as_view(), name='book_main'), + url(r'^book/(?P[0-9]+)$', LaunderetteBookView.as_view(), name='book_slot'), + url(r'^admin$', LaunderetteListView.as_view(), name='launderette_list'), + url(r'^admin/(?P[0-9]+)$', LaunderetteDetailView.as_view(), name='launderette_details'), + url(r'^admin/(?P[0-9]+)/edit$', LaunderetteEditView.as_view(), name='launderette_edit'), + url(r'^admin/new$', LaunderetteCreateView.as_view(), name='launderette_new'), +] + + + diff --git a/launderette/views.py b/launderette/views.py new file mode 100644 index 00000000..9862d3a7 --- /dev/null +++ b/launderette/views.py @@ -0,0 +1,62 @@ +from django.shortcuts import render +from django.views.generic import ListView, DetailView, RedirectView, TemplateView +from django.views.generic.edit import UpdateView, CreateView, DeleteView, ProcessFormView, FormMixin +from django.forms.models import modelform_factory +from django.forms import CheckboxSelectMultiple +from django.utils.translation import ugettext as _ +from django.conf import settings + +from core.models import Page +from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin +from launderette.models import Launderette, Token, Machine, Slot + +# For users + +class LaunderetteMainView(TemplateView): + """Main presentation view""" + template_name = 'launderette/launderette_main.jinja' + + def get_context_data(self, **kwargs): + """ Add page to the context """ + kwargs = super(LaunderetteMainView, self).get_context_data(**kwargs) + kwargs['page'] = Page.objects.filter(name='launderette').first() + return kwargs + +class LaunderetteBookMainView(CanViewMixin, ListView): + """Choose which launderette to book""" + model = Launderette + template_name = 'launderette/launderette_book.jinja' + +class LaunderetteBookView(TemplateView): + """Display the launderette schedule""" + model = Launderette + pk_url_kwarg = "launderette_id" + template_name = 'launderette/launderette_book.jinja' + + +# For admins + +class LaunderetteListView(CanViewMixin, ListView): + """Choose which launderette to administer""" + model = Launderette + template_name = 'launderette/launderette_list.jinja' + +class LaunderetteDetailView(CanViewMixin, DetailView): + """The admin page of the launderette""" + model = Launderette + pk_url_kwarg = "launderette_id" + template_name = 'launderette/launderette_detail.jinja' + +class LaunderetteEditView(CanViewMixin, UpdateView): + """Edit a launderette""" + model = Launderette + pk_url_kwarg = "launderette_id" + form_class = modelform_factory(Launderette, fields=['name', 'sellers'], + widgets={'sellers':CheckboxSelectMultiple}) + template_name = 'core/edit.jinja' + +class LaunderetteCreateView(CanCreateMixin, CreateView): + """Create a new launderette""" + model = Launderette + fields = ['name', 'sellers'] + template_name = 'core/create.jinja' diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo index 091b46c0617b0c60d27fa02d0a4671b6e6193814..29621bbb11cbbc5ce17439130473f1bda2d78bdd 100644 GIT binary patch delta 7288 zcmZYD3w+P@9>?+D?z7okW;T~?|FN5~3o~qPb2p7*E!Qyi$1XN@aS8n^%B736s6?1l zM9L0QiHMwviX??Yy0}!QQt7DF>;3t2|t1 z8hbCdI5Isft0jJ0&$8B2ej`M!mNl@sWhG-ahT|*@!)3;e7)t#u48{}2uQ8GOFPMam z7M9fphhR3&LO;uLS^Fpi(C{uc!Q=J`>k!$7% zVJ{>AeQ1wBEx0vmymqMmX&A)(Ru>9dVSgn1Rvv00<4~C?L0vc#HQ?Q-0T!SZv>3JX zWvE;9tZCnEJYdcrMlIwlYMzVeYCz!%1x@4?Nm?=3*c>%M9O}Yk)Wn@p3+je?O!{C3 z4oBVVW$45`sQ$50cK<}wM%$w@m=#6-H9=n*)G-IO^P#8}jzv8aQ%w6j)Iyh-^UJX* z^)=WEccAY1Noi^LEdi^UF?-Qistw4>9g3%*32JL@WXVo0<-aZ^;k zXzYjys14j{+MTFpr3B~TU8r03D>lPFP?>DXYSkX)qL4x%)->dyQZyQMD~eD%nt|Hs zBGiRzP#N2RTF@p`zgJM#??)}{DC%|n%+!B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dzh+Ps?GYcQACPAt{^?@Z{JLi|AJxz@qsVdnTs{M5n< zLK`QM_%rb+aR>1(p<_QWn)qB5jz1C461NfSiGD<1LPslV~EAXH^gT|TRQjp$j)y3XvNi4g_lX;cmUNmVAxqoSj+y`Y(OEN$m~XZVp~ZG^WIM~Du#Z8q+(<(23mE)d~F%5{S# zP;YJPA5r$#(neCy@o(aHUx}9w7yUvxj_6>&(4BG&<;ysYI7aAbPc*XE_!{_l(iTeb zKZKW}q7~6_Y@|?3yg(cvt`I*GA$(~y<`NA@Fm1i41QA_` z*9jfTw711ah+BzzBAAT5F8y%6`#$C2Z^gh46%;Tv7A`zD;e`&<1LI`U%^1b%4R#gd&`G}yFAN>R(aBf4gMb^ CUa0#3 diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index abc65c51..ddb49138 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-07-27 19:57+0200\n" +"POT-Creation-Date: 2016-07-28 20:02+0200\n" "PO-Revision-Date: 2016-07-18\n" "Last-Translator: Skia \n" "Language-Team: AE info \n" @@ -18,7 +18,8 @@ msgstr "" #: accounting/models.py:32 accounting/models.py:55 accounting/models.py:94 #: club/models.py:18 counter/models.py:38 counter/models.py:63 -#: counter/models.py:91 +#: counter/models.py:91 launderette/models.py:12 launderette/models.py:36 +#: launderette/models.py:52 msgid "name" msgstr "nom" @@ -31,6 +32,7 @@ msgid "account number" msgstr "numero de compte" #: accounting/models.py:92 club/models.py:109 counter/models.py:237 +#: launderette/models.py:68 msgid "start date" msgstr "date de début" @@ -149,6 +151,7 @@ msgstr "Nouveau compte club" #: core/templates/core/user_tools.jinja:32 #: counter/templates/counter/counter_list.jinja:15 #: counter/templates/counter/counter_list.jinja:18 +#: launderette/templates/launderette/launderette_list.jinja:14 msgid "Edit" msgstr "Éditer" @@ -203,6 +206,8 @@ msgstr "Fin" #: accounting/templates/accounting/journal_details.jinja:23 #: counter/templates/counter/user_account.jinja:17 #: counter/templates/counter/user_account.jinja:63 +#: launderette/templates/launderette/user_account.jinja:17 +#: launderette/templates/launderette/user_account.jinja:63 msgid "Amount" msgstr "Montant" @@ -236,6 +241,7 @@ msgstr "Voir" #: accounting/templates/accounting/journal_details.jinja:10 #: counter/templates/counter/user_account.jinja:9 +#: launderette/templates/launderette/user_account.jinja:9 msgid "Amount: " msgstr "Montant: " @@ -259,6 +265,9 @@ msgstr "No" #: counter/templates/counter/user_account.jinja:15 #: counter/templates/counter/user_account.jinja:36 #: counter/templates/counter/user_account.jinja:61 +#: launderette/templates/launderette/user_account.jinja:15 +#: launderette/templates/launderette/user_account.jinja:36 +#: launderette/templates/launderette/user_account.jinja:61 msgid "Date" msgstr "Date" @@ -311,6 +320,7 @@ msgid "You can not make loops in clubs" msgstr "Vous ne pouvez pas faire de boucles dans les clubs" #: club/models.py:107 eboutic/models.py:12 eboutic/models.py:45 +#: launderette/models.py:72 msgid "user" msgstr "nom d'utilisateur" @@ -366,6 +376,7 @@ msgstr "Éditer le club" #: core/templates/core/page_prop.jinja:8 #: core/templates/core/pagerev_edit.jinja:24 #: counter/templates/counter/counter_edit.jinja:8 +#: launderette/templates/launderette/counter_edit.jinja:8 #: subscription/templates/subscription/subscription.jinja:12 msgid "Save" msgstr "Sauver" @@ -374,8 +385,7 @@ msgstr "Sauver" msgid "Edit club properties" msgstr "Éditer les propriétés du club" -#: club/templates/club/club_list.jinja:4 -#: club/templates/club/club_list.jinja:24 +#: club/templates/club/club_list.jinja:4 club/templates/club/club_list.jinja:24 msgid "Club list" msgstr "Liste des clubs" @@ -576,6 +586,7 @@ msgid "Site made by good people" msgstr "Site réalisé par des gens biens" #: core/templates/core/create.jinja:4 +#, python-format msgid "Create %(name)s" msgstr "Créer %(name)s" @@ -594,6 +605,7 @@ msgstr "Confirmation" #: core/templates/core/delete_confirm.jinja:8 #: counter/templates/counter/counter_click.jinja:67 +#: launderette/templates/launderette/counter_click.jinja:67 msgid "Cancel" msgstr "Annuler" @@ -606,8 +618,7 @@ msgstr "Éditer %(obj)s" msgid "Edit group" msgstr "Éditer le groupe" -#: core/templates/core/group_edit.jinja:9 -#: core/templates/core/user_edit.jinja:8 +#: core/templates/core/group_edit.jinja:9 core/templates/core/user_edit.jinja:8 #: core/templates/core/user_group.jinja:8 msgid "Update" msgstr "Mettre à jour" @@ -643,12 +654,13 @@ msgstr "" msgid "Please login to see this page." msgstr "Merci de vous identifier pour voir cette page." -#: core/templates/core/login.jinja:31 +#: core/templates/core/login.jinja:22 #: counter/templates/counter/counter_main.jinja:48 +#: launderette/templates/launderette/counter_main.jinja:48 msgid "login" msgstr "login" -#: core/templates/core/login.jinja:36 +#: core/templates/core/login.jinja:26 msgid "Lost password?" msgstr "Mot de passe perdu ?" @@ -981,56 +993,70 @@ msgid "permanency" msgstr "permanence" #: counter/templates/counter/counter_click.jinja:20 +#: launderette/templates/launderette/counter_click.jinja:20 msgid "Counter" msgstr "Comptoir" #: counter/templates/counter/counter_click.jinja:22 +#: launderette/templates/launderette/counter_click.jinja:22 msgid "Club: " msgstr "Club : " #: counter/templates/counter/counter_click.jinja:25 +#: launderette/templates/launderette/counter_click.jinja:25 msgid "Customer" msgstr "Client" #: counter/templates/counter/counter_click.jinja:30 +#: launderette/templates/launderette/counter_click.jinja:30 msgid "Refilling" msgstr "Rechargement" #: counter/templates/counter/counter_click.jinja:35 #: counter/templates/counter/counter_click.jinja:48 +#: launderette/templates/launderette/counter_click.jinja:35 +#: launderette/templates/launderette/counter_click.jinja:48 msgid "Go" msgstr "Valider" #: counter/templates/counter/counter_click.jinja:40 +#: launderette/templates/launderette/counter_click.jinja:40 msgid "Selling" msgstr "Vente" #: counter/templates/counter/counter_click.jinja:42 +#: launderette/templates/launderette/counter_click.jinja:42 msgid "Not enough money" msgstr "Solde insuffisant" #: counter/templates/counter/counter_click.jinja:50 #: eboutic/templates/eboutic/eboutic_main.jinja:23 #: eboutic/templates/eboutic/eboutic_makecommand.jinja:7 +#: launderette/templates/launderette/counter_click.jinja:50 msgid "Basket: " msgstr "Panier : " #: counter/templates/counter/counter_click.jinja:58 #: counter/templates/counter/counter_main.jinja:24 #: eboutic/templates/eboutic/eboutic_main.jinja:30 +#: launderette/templates/launderette/counter_click.jinja:58 +#: launderette/templates/launderette/counter_main.jinja:24 msgid "Total: " msgstr "Total : " #: counter/templates/counter/counter_click.jinja:62 +#: launderette/templates/launderette/counter_click.jinja:62 msgid "Finish" msgstr "Terminer" #: counter/templates/counter/counter_click.jinja:69 #: eboutic/templates/eboutic/eboutic_main.jinja:37 +#: launderette/templates/launderette/counter_click.jinja:69 msgid "Products: " msgstr "Produits : " #: counter/templates/counter/counter_edit.jinja:4 +#: launderette/templates/launderette/counter_edit.jinja:4 msgid "Edit counter" msgstr "Éditer le comptoir" @@ -1048,107 +1074,135 @@ msgid "There is no counters in this website." msgstr "Il n'y a pas de comptoirs dans ce site web." #: counter/templates/counter/counter_main.jinja:12 +#: launderette/templates/launderette/counter_main.jinja:12 #, python-format msgid "%(counter_name)s counter" msgstr "Comptoir %(counter_name)s" #: counter/templates/counter/counter_main.jinja:15 +#: launderette/templates/launderette/counter_main.jinja:15 msgid "Sellings" msgstr "Ventes" #: counter/templates/counter/counter_main.jinja:17 +#: launderette/templates/launderette/counter_main.jinja:17 msgid "Last selling: " msgstr "Dernière vente : " #: counter/templates/counter/counter_main.jinja:18 +#: launderette/templates/launderette/counter_main.jinja:18 msgid "Client: " msgstr "Client : " #: counter/templates/counter/counter_main.jinja:18 +#: launderette/templates/launderette/counter_main.jinja:18 msgid "New amount: " msgstr "Nouveau montant : " #: counter/templates/counter/counter_main.jinja:27 +#: launderette/templates/launderette/counter_main.jinja:27 msgid "Enter client code:" msgstr "Entrez un code client : " #: counter/templates/counter/counter_main.jinja:31 +#: launderette/templates/launderette/counter_main.jinja:31 msgid "validate" msgstr "valider" #: counter/templates/counter/counter_main.jinja:34 +#: launderette/templates/launderette/counter_main.jinja:34 msgid "Please, login" msgstr "Merci de vous identifier" #: counter/templates/counter/counter_main.jinja:39 +#: launderette/templates/launderette/counter_main.jinja:39 msgid "Barman: " msgstr "Barman : " #: counter/templates/counter/product_list.jinja:4 #: counter/templates/counter/product_list.jinja:10 +#: launderette/templates/launderette/product_list.jinja:4 +#: launderette/templates/launderette/product_list.jinja:10 msgid "Product list" msgstr "Liste des produits" #: counter/templates/counter/product_list.jinja:8 +#: launderette/templates/launderette/product_list.jinja:8 msgid "New product" msgstr "Nouveau produit" #: counter/templates/counter/product_list.jinja:17 +#: launderette/templates/launderette/product_list.jinja:17 msgid "There is no products in this website." msgstr "Il n'y a pas de produits dans ce site web." #: counter/templates/counter/producttype_list.jinja:4 #: counter/templates/counter/producttype_list.jinja:10 +#: launderette/templates/launderette/producttype_list.jinja:4 +#: launderette/templates/launderette/producttype_list.jinja:10 msgid "Product type list" msgstr "Liste des types de produit" #: counter/templates/counter/producttype_list.jinja:8 +#: launderette/templates/launderette/producttype_list.jinja:8 msgid "New product type" msgstr "Nouveau type de produit" #: counter/templates/counter/producttype_list.jinja:17 +#: launderette/templates/launderette/producttype_list.jinja:17 msgid "There is no product types in this website." msgstr "Il n'y a pas de types de produit dans ce site web." #: counter/templates/counter/user_account.jinja:4 +#: launderette/templates/launderette/user_account.jinja:4 #, python-format msgid "%(user_name)s's account" msgstr "Compte de %(user_name)s" #: counter/templates/counter/user_account.jinja:8 +#: launderette/templates/launderette/user_account.jinja:8 msgid "User account" msgstr "Compte utilisateur" #: counter/templates/counter/user_account.jinja:11 +#: launderette/templates/launderette/user_account.jinja:11 msgid "Refillings" msgstr "Rechargements" #: counter/templates/counter/user_account.jinja:16 #: counter/templates/counter/user_account.jinja:37 +#: launderette/templates/launderette/user_account.jinja:16 +#: launderette/templates/launderette/user_account.jinja:37 msgid "Barman" msgstr "Barman" #: counter/templates/counter/user_account.jinja:32 +#: launderette/templates/launderette/user_account.jinja:32 msgid "Buyings" msgstr "Achats" #: counter/templates/counter/user_account.jinja:38 +#: launderette/templates/launderette/user_account.jinja:38 msgid "Product" msgstr "Produit" #: counter/templates/counter/user_account.jinja:39 +#: launderette/templates/launderette/user_account.jinja:39 msgid "Quantity" msgstr "Quantité" #: counter/templates/counter/user_account.jinja:40 +#: launderette/templates/launderette/user_account.jinja:40 msgid "Total" msgstr "Total" #: counter/templates/counter/user_account.jinja:57 +#: launderette/templates/launderette/user_account.jinja:57 msgid "Invoices" msgstr "Factures" #: counter/templates/counter/user_account.jinja:62 +#: launderette/templates/launderette/user_account.jinja:62 msgid "Items" msgstr "Articles" @@ -1168,7 +1222,7 @@ msgstr "ANN" msgid "You have not enough money to buy all the basket" msgstr "Vous n'avez pas assez d'argent pour acheter le panier" -#: eboutic/models.py:47 sith/settings.py:243 sith/settings_sample.py:231 +#: eboutic/models.py:47 sith/settings.py:240 sith/settings_sample.py:243 msgid "Credit card" msgstr "Carte banquaire" @@ -1235,75 +1289,146 @@ msgstr "Retourner à l'eboutic" msgid "You do not have enough money to buy the basket" msgstr "Vous n'avez pas assez d'argent pour acheter le panier" -#: sith/settings.py:240 sith/settings.py:247 sith/settings.py:259 -#: sith/settings_sample.py:228 sith/settings_sample.py:235 -#: sith/settings_sample.py:247 +#: launderette/models.py:13 +msgid "sellers" +msgstr "vendeurs" + +#: launderette/models.py:16 +#: launderette/templates/launderette/launderette_book.jinja:4 +#: launderette/templates/launderette/launderette_main.jinja:4 +msgid "Launderette" +msgstr "Laverie" + +#: launderette/models.py:37 launderette/models.py:53 +msgid "launderette" +msgstr "laverie" + +#: launderette/models.py:38 +msgid "is working" +msgstr "est HS" + +#: launderette/models.py:41 +msgid "Machine" +msgstr "Machine" + +#: launderette/models.py:54 launderette/models.py:69 +msgid "type" +msgstr "type" + +#: launderette/models.py:54 launderette/models.py:69 +msgid "Washing" +msgstr "Lavage" + +#: launderette/models.py:54 launderette/models.py:69 +msgid "Drying" +msgstr "Séchage" + +#: launderette/models.py:57 +msgid "Token" +msgstr "Jeton" + +#: launderette/models.py:70 +msgid "machine" +msgstr "machine" + +#: launderette/models.py:71 +msgid "token" +msgstr "jeton" + +#: launderette/templates/launderette/launderette_detail.jinja:4 +msgid "Launderette admin" +msgstr "Gestion de la laverie" + +#: launderette/templates/launderette/launderette_list.jinja:4 +#: launderette/templates/launderette/launderette_list.jinja:10 +msgid "Launderette admin list" +msgstr "Liste des laveries" + +#: launderette/templates/launderette/launderette_list.jinja:8 +msgid "New launderette" +msgstr "Nouvelle laverie" + +#: launderette/templates/launderette/launderette_list.jinja:18 +msgid "There is no launderette in this website." +msgstr "Il n'y a pas de laverie dans ce site web." + +#: launderette/templates/launderette/launderette_main.jinja:9 +msgid "Edit presentation page" +msgstr "Éditer la page de présentation" + +#: launderette/templates/launderette/launderette_main.jinja:12 +msgid "Book launderette slot" +msgstr "Réserver un créneau de laverie" + +#: sith/settings.py:237 sith/settings.py:244 sith/settings.py:256 +#: sith/settings_sample.py:240 sith/settings_sample.py:247 +#: sith/settings_sample.py:259 msgid "Check" msgstr "Chèque" -#: sith/settings.py:241 sith/settings.py:248 sith/settings.py:260 -#: sith/settings_sample.py:229 sith/settings_sample.py:236 -#: sith/settings_sample.py:248 +#: sith/settings.py:238 sith/settings.py:245 sith/settings.py:257 +#: sith/settings_sample.py:241 sith/settings_sample.py:248 +#: sith/settings_sample.py:260 msgid "Cash" msgstr "Espèces" -#: sith/settings.py:242 sith/settings_sample.py:230 +#: sith/settings.py:239 sith/settings_sample.py:242 msgid "Transfert" msgstr "Virement" -#: sith/settings.py:249 sith/settings_sample.py:237 +#: sith/settings.py:246 sith/settings_sample.py:249 msgid "Other" msgstr "Autre" -#: sith/settings.py:273 sith/settings_sample.py:261 +#: sith/settings.py:270 sith/settings_sample.py:273 msgid "One semester" msgstr "Un semestre" -#: sith/settings.py:278 sith/settings_sample.py:266 +#: sith/settings.py:275 sith/settings_sample.py:278 msgid "Two semesters" msgstr "Deux semestres" -#: sith/settings.py:283 sith/settings_sample.py:271 +#: sith/settings.py:280 sith/settings_sample.py:283 msgid "Common core cursus" msgstr "Cursus tronc commun" -#: sith/settings.py:288 sith/settings_sample.py:276 +#: sith/settings.py:285 sith/settings_sample.py:288 msgid "Branch cursus" msgstr "Cursus branche" -#: sith/settings.py:296 sith/settings_sample.py:284 +#: sith/settings.py:293 sith/settings_sample.py:296 msgid "President" msgstr "Président" -#: sith/settings.py:297 sith/settings_sample.py:285 +#: sith/settings.py:294 sith/settings_sample.py:297 msgid "Vice-President" msgstr "Vice-Président" -#: sith/settings.py:298 sith/settings_sample.py:286 +#: sith/settings.py:295 sith/settings_sample.py:298 msgid "Treasurer" msgstr "Trésorier" -#: sith/settings.py:299 sith/settings_sample.py:287 +#: sith/settings.py:296 sith/settings_sample.py:299 msgid "Communication supervisor" msgstr "Responsable com" -#: sith/settings.py:300 sith/settings_sample.py:288 +#: sith/settings.py:297 sith/settings_sample.py:300 msgid "Secretary" msgstr "Secrétaire" -#: sith/settings.py:301 sith/settings_sample.py:289 +#: sith/settings.py:298 sith/settings_sample.py:301 msgid "IT supervisor" msgstr "Responsable info" -#: sith/settings.py:302 sith/settings_sample.py:290 +#: sith/settings.py:299 sith/settings_sample.py:302 msgid "Board member" msgstr "Membre du bureau" -#: sith/settings.py:303 sith/settings_sample.py:291 +#: sith/settings.py:300 sith/settings_sample.py:303 msgid "Active member" msgstr "Membre actif" -#: sith/settings.py:304 sith/settings_sample.py:292 +#: sith/settings.py:301 sith/settings_sample.py:304 msgid "Curious" msgstr "Curieux" @@ -1339,18 +1464,3 @@ msgstr "Un utilisateur avec cette adresse email existe déjà" 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 "Create" -#~ msgstr "Créer" - -#~ msgid "%(c)s counter" -#~ msgstr "Comptoir %(c)s" - -#~ msgid "Page" -#~ msgstr "Page" - -#~ msgid "You're seeing the page %(page_name)s" -#~ msgstr "Vous consultez la page %(page_name)s" - -#~ msgid "Back to page" -#~ msgstr "Retour à la page" diff --git a/sith/settings_sample.py b/sith/settings_sample.py index 9dbc305b..ebd3a363 100644 --- a/sith/settings_sample.py +++ b/sith/settings_sample.py @@ -48,6 +48,7 @@ INSTALLED_APPS = ( 'accounting', 'counter', 'eboutic', + 'launderette', ) MIDDLEWARE_CLASSES = ( @@ -215,10 +216,18 @@ SITH_GROUPS = { 'id': 3, 'name': "Accounting admin", }, - 'counter-admin': { + 'communication-admin': { 'id': 4, + 'name': "Communication admin", + }, + 'counter-admin': { + 'id': 5, 'name': "Counter admin", }, + 'launderette-admin': { + 'id': 6, + 'name': "Launderette admin", + }, } SITH_BOARD_SUFFIX="-board" diff --git a/sith/urls.py b/sith/urls.py index 60de79eb..39cd5245 100644 --- a/sith/urls.py +++ b/sith/urls.py @@ -28,5 +28,6 @@ urlpatterns = [ url(r'^counter/', include('counter.urls', namespace="counter", app_name="counter")), url(r'^accounting/', include('accounting.urls', namespace="accounting", app_name="accounting")), url(r'^eboutic/', include('eboutic.urls', namespace="eboutic", app_name="eboutic")), + url(r'^launderette/', include('launderette.urls', namespace="launderette", app_name="launderette")), url(r'^admin/', include(admin.site.urls)), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # TODO: remove me for production!!!