Begin launderette

This commit is contained in:
Skia 2016-07-28 20:05:56 +02:00
parent 4c62816816
commit a01fc63a82
31 changed files with 871 additions and 61 deletions

View File

@ -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')

View File

@ -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):
"""

View File

@ -166,6 +166,11 @@ tbody>tr:hover {
padding: 4px;
line-height: 120%;
}
textarea {
white-space: pre;
width: 98%;
margin-top: 10px;
}
/*--------------------------------FOOTER-------------------------------*/
footer{

View File

@ -17,19 +17,9 @@
<form method="post" action="{{ url('core:login') }}">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag() }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag() }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" value="{% trans %}login{% endtrans %}" />
<input type="hidden" name="next" value="{{ next }}" />
{{ form.as_p() }}
<input type="hidden" name="next" value="{{ next }}">
<p><input type="submit" value="{% trans %}login{% endtrans %}"></p>
</form>
{# Assumes you setup the password_reset view in your URLconf #}

View File

@ -15,7 +15,7 @@
{% macro print_page_name(page) %}
{% if page %}
{{ print_page_name(page.parent) }} >
<a href="{{ url('core:page', page_name=page.get_full_name()) }}">{{ page.name }}</a>
<a href="{{ url('core:page', page_name=page.get_full_name()) }}">{{ page.get_display_name() }}</a>
{% endif %}
{% endmacro %}

View File

@ -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'},
),
]

0
launderette/__init__.py Normal file
View File

3
launderette/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -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',
},
),
]

View File

@ -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'),
),
]

View File

@ -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'),
),
]

View File

@ -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'),
),
]

View File

76
launderette/models.py Normal file
View File

@ -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()

View File

@ -0,0 +1,79 @@
{% extends "core/base.jinja" %}
{% macro add_product(id, content) %}
<form method="post" action="{{ url('counter:click', counter_id=counter.id, user_id=customer.user.id) }}" class="inline" style="display:inline">
{% csrf_token %}
<input type="hidden" name="action" value="add_product">
<button type="submit" name="product_id" value="{{ id }}"> {{ content }} </button>
</form>
{% endmacro %}
{% macro del_product(id, content) %}
<form method="post" action="{{ url('counter:click', counter_id=counter.id, user_id=customer.user.id) }}" class="inline" style="display:inline">
{% csrf_token %}
<input type="hidden" name="action" value="del_product">
<button type="submit" name="product_id" value="{{ id }}"> {{ content }} </button>
</form>
{% endmacro %}
{% block content %}
<h3>{% trans %}Counter{% endtrans %}</h3>
<h4>{{ counter }}</h4>
<p><strong>{% trans %}Club: {% endtrans %}</strong> {{ counter.club }}</p>
<div>
<h5>{% trans %}Customer{% endtrans %}</h5>
<p>{{ customer.user.get_display_name() }}, {{ customer.amount }} €</p>
</div>
{% if counter.type == 'BAR' %}
<div>
<h5>{% trans %}Refilling{% endtrans %}</h5>
<form method="post" action="{{ url('counter:click', counter_id=counter.id, user_id=customer.user.id) }}">
{% csrf_token %}
{{ refill_form.as_p() }}
<input type="hidden" name="action" value="refill">
<input type="submit" value="{% trans %}Go{% endtrans %}" />
</form>
</div>
{% endif %}
<div>
<h5>{% trans %}Selling{% endtrans %}</h5>
{% if request.session['not_enough'] %}
<p><strong>{% trans %}Not enough money{% endtrans %}</strong></p>
{% endif %}
<form method="post" action="{{ url('counter:click', counter_id=counter.id, user_id=customer.user.id) }}">
{% csrf_token %}
<input type="hidden" name="action" value="code">
<input type="input" name="code" value="" autofocus />
<input type="submit" value="{% trans %}Go{% endtrans %}" />
</form>
<p>{% trans %}Basket: {% endtrans %}</p>
<ul>
{% for id,infos in request.session['basket']|dictsort %}
{% set product = counter.products.filter(id=id).first() %}
{% set s = infos['qty'] * infos['price'] / 100 %}
<li>{{ del_product(id, '-') }} {{ infos['qty'] }} {{ add_product(id, '+') }} {{ product.name }}: {{ "%0.2f"|format(s) }} €</li>
{% endfor %}
</ul>
<p><strong>{% trans %}Total: {% endtrans %}{{ "%0.2f"|format(basket_total) }} €</strong></p>
<form method="post" action="{{ url('counter:click', counter_id=counter.id, user_id=customer.user.id) }}">
{% csrf_token %}
<input type="hidden" name="action" value="finish">
<input type="submit" value="{% trans %}Finish{% endtrans %}" />
</form>
<form method="post" action="{{ url('counter:click', counter_id=counter.id, user_id=customer.user.id) }}">
{% csrf_token %}
<input type="hidden" name="action" value="cancel">
<input type="submit" value="{% trans %}Cancel{% endtrans %}" />
</form>
<p><strong>{% trans %}Products: {% endtrans %}</strong>
{% for p in counter.products.all() %}
{{ add_product(p.id, p.name) }}
{% endfor %}
</p>
</div>
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "core/base.jinja" %}
{% block content %}
<h2>{% trans %}Edit counter{% endtrans %}</h2>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
{% endblock %}

View File

@ -0,0 +1,55 @@
{% extends "core/base.jinja" %}
{% macro barman_logout_link(user) %}
<form method="post" action="{{ url('counter:logout', counter_id=counter.id) }}" class="inline">
{% csrf_token %}
<input type="hidden" name="user_id" value="{{ user.id }}">
<button type="submit" name="submit_param" value="submit_value" class="link-button">{{ user.get_display_name() }}</button>
</form>
{% endmacro %}
{% block content %}
<h3>{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}</h3>
<div>
<h3>{% trans %}Sellings{% endtrans %}</h3>
{% if last_basket %}
<h4>{% trans %}Last selling: {% endtrans %}</h4>
<p>{% trans %}Client: {% endtrans %}{{ last_customer }} - {% trans %}New amount: {% endtrans %}{{ new_customer_amount }} €.</p>
<ul>
{% for s in last_basket %}
<li>{{ s }}</li>
{% endfor %}
</ul>
<p><strong>{% trans %}Total: {% endtrans %}{{ last_total }} €</strong></p>
{% endif %}
{% if barmen %}
<p>{% trans %}Enter client code:{% endtrans %}</p>
<form method="post" action="{{ url('counter:details', counter_id=counter.id) }}">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}validate{% endtrans %}" /></p>
</form>
{% else %}
<p>{% trans %}Please, login{% endtrans %}</p>
{% endif %}
</div>
{% if counter.type == 'BAR' %}
<div>
<h3>{% trans %}Barman: {% endtrans %}</h3>
<ul>
{% for b in barmen %}
<li>{{ barman_logout_link(b) }}</li>
{% endfor %}
</ul>
<form method="post" action="{{ url('counter:login', counter_id=counter.id) }}">
{% csrf_token %}
{{ login_form.as_p() }}
<p><input type="submit" value="{% trans %}login{% endtrans %}" /></p>
</form>
</div>
{% endif %}
{% endblock %}

View File

@ -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) %}
<ul>
{% for l in launderette_list %}
<li><a href="{{ url('launderette:book_slot', launderette_id=l.id) }}">{{ l }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Launderette admin{% endtrans %}
{% endblock %}
{% block content %}
Admin
{% endblock %}

View File

@ -0,0 +1,23 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Launderette admin list{% endtrans %}
{% endblock %}
{% block content %}
<p><a href="{{ url('launderette:launderette_new') }}">{% trans %}New launderette{% endtrans %}</a></p>
{% if launderette_list %}
<h3>{% trans %}Launderette admin list{% endtrans %}</h3>
<ul>
{% for l in launderette_list %}
<li><a href="{{ url('launderette:launderette_details', launderette_id=l.id) }}">{{ l }}</a> -
<a href="{{ url('launderette:launderette_edit', launderette_id=l.id) }}">{% trans %}Edit{% endtrans %}</a></li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no launderette in this website.{% endtrans %}
{% endif %}
{% endblock %}

View File

@ -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']) %}
<p><a href="{{ url('core:page_edit', page_name=page.get_full_name()) }}">{% trans %}Edit presentation page{% endtrans %}</a></p>
{% endif %}
{% if request.user.is_in_group(settings.SITH_MAIN_MEMBERS_GROUP) %}
<p><a href="{{ url('launderette:book_main') }}">{% trans %}Book launderette slot{% endtrans %}</a></p>
{% endif %}
{{ page.revisions.last().content|markdown }}
{% endblock %}

View File

@ -0,0 +1,23 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Product list{% endtrans %}
{% endblock %}
{% block content %}
<p><a href="{{ url('counter:new_product') }}">{% trans %}New product{% endtrans %}</a></p>
{% if product_list %}
<h3>{% trans %}Product list{% endtrans %}</h3>
<ul>
{% for p in product_list %}
<li><a href="{{ url('counter:product_edit', product_id=p.id) }}">{{ p }}</a></li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no products in this website.{% endtrans %}
{% endif %}
{% endblock %}

View File

@ -0,0 +1,24 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Product type list{% endtrans %}
{% endblock %}
{% block content %}
<p><a href="{{ url('counter:new_producttype') }}">{% trans %}New product type{% endtrans %}</a></p>
{% if producttype_list %}
<h3>{% trans %}Product type list{% endtrans %}</h3>
<ul>
{% for t in producttype_list %}
<li><a href="{{ url('counter:producttype_edit', type_id=t.id) }}">{{ t }}</a></li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no product types in this website.{% endtrans %}
{% endif %}
{% endblock %}

View File

@ -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 %}
<h3>{% trans %}User account{% endtrans %}</h3>
<p>{% trans %}Amount: {% endtrans %}{{ customer.amount }} €</p>
{% if customer.refillings.exists() %}
<h4>{% trans %}Refillings{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Barman{% endtrans %}</td>
<td>{% trans %}Amount{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in customer.refillings.all() %}
<tr>
<td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
<td>{{ i.operator }}</td>
<td>{{ i.amount }} €</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if customer.buyings.exists() %}
<h4>{% trans %}Buyings{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Barman{% endtrans %}</td>
<td>{% trans %}Product{% endtrans %}</td>
<td>{% trans %}Quantity{% endtrans %}</td>
<td>{% trans %}Total{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in customer.buyings.all() %}
<tr>
<td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
<td>{{ i.seller }}</td>
<td>{{ i.product }}</td>
<td>{{ i.quantity }}</td>
<td>{{ i.quantity * i.unit_price }} €</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if customer.user.invoices.exists() %}
<h4>{% trans %}Invoices{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Items{% endtrans %}</td>
<td>{% trans %}Amount{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in customer.user.invoices.all() %}
<tr>
<td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
<td>
<ul>
{% for it in i.items.all() %}
<li>{{ it.product_name }} - {{ it.product_unit_price }} €</li>
{% endfor %}
</ul>
</td>
<td>{{ i.get_total() }} €</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}

3
launderette/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

17
launderette/urls.py Normal file
View File

@ -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<launderette_id>[0-9]+)$', LaunderetteBookView.as_view(), name='book_slot'),
url(r'^admin$', LaunderetteListView.as_view(), name='launderette_list'),
url(r'^admin/(?P<launderette_id>[0-9]+)$', LaunderetteDetailView.as_view(), name='launderette_details'),
url(r'^admin/(?P<launderette_id>[0-9]+)/edit$', LaunderetteEditView.as_view(), name='launderette_edit'),
url(r'^admin/new$', LaunderetteCreateView.as_view(), name='launderette_new'),
]

62
launderette/views.py Normal file
View File

@ -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'

Binary file not shown.

View File

@ -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 <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\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"

View File

@ -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"

View File

@ -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!!!