diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py
index 25b21c63..ed1d0bc5 100644
--- a/core/management/commands/populate.py
+++ b/core/management/commands/populate.py
@@ -71,7 +71,7 @@ Welcome to the wiki page!
p.set_lock(root)
p.save()
p.set_lock(root)
- PageRev(page=p, title="", author=root, content="").save()
+ PageRev(page=p, title="Laverie", author=root, content="Fonctionnement de la laverie").save()
# Here we add a lot of test datas, that are not necessary for the Sith, but that provide a basic development environment
if not options['prod']:
diff --git a/core/static/core/style.css b/core/static/core/style.css
index 55ae5f08..0ee66260 100644
--- a/core/static/core/style.css
+++ b/core/static/core/style.css
@@ -16,7 +16,6 @@ header {
right : 8%;
left: 40%;
background-color:#DDD;
- height: 3em;
}
header a {
display: inline-block;
diff --git a/core/templates/core/user_tools.jinja b/core/templates/core/user_tools.jinja
index e88ccb16..6b759946 100644
--- a/core/templates/core/user_tools.jinja
+++ b/core/templates/core/user_tools.jinja
@@ -17,7 +17,7 @@
{% trans %}Subscriptions{% endtrans %}
{% endif %}
{% trans %}Launderette{% endtrans %}
- {% if user.is_in_group(settings.SITH_GROUPS['launderette-admin']['name']) %}
+ {% if user.is_in_group(settings.SITH_GROUPS['launderette-admin']['name']) or user.is_in_group(settings.SITH_GROUPS['root']['name']) %}
{% trans %}Launderette{% endtrans %}
{% endif %}
diff --git a/core/views/__init__.py b/core/views/__init__.py
index 1b3acc6c..81891dd7 100644
--- a/core/views/__init__.py
+++ b/core/views/__init__.py
@@ -60,7 +60,7 @@ class CanEditPropMixin(View):
class CanEditMixin(View):
"""
- This view makes exactly the same this as its direct parent, but checks the group on the edit_groups field of the
+ This view makes exactly the same thing as its direct parent, but checks the group on the edit_groups field of the
object
"""
def dispatch(self, request, *arg, **kwargs):
@@ -78,7 +78,7 @@ class CanEditMixin(View):
class CanViewMixin(View):
"""
- This view still makes exactly the same this as its direct parent, but checks the group on the view_groups field of
+ This view still makes exactly the same thing as its direct parent, but checks the group on the view_groups field of
the object
"""
def dispatch(self, request, *arg, **kwargs):
diff --git a/counter/views.py b/counter/views.py
index f0fbebcf..61754525 100644
--- a/counter/views.py
+++ b/counter/views.py
@@ -327,8 +327,10 @@ class CounterEditView(CanEditPropMixin, UpdateView):
Edit a counter's main informations (for the counter's admin)
"""
model = Counter
- form_class = modelform_factory(Counter, fields=['name', 'club', 'type', 'products'],
- widgets={'products':CheckboxSelectMultiple})
+ form_class = modelform_factory(Counter, fields=['name', 'club', 'type', 'sellers', 'products'],
+ widgets={
+ 'products':CheckboxSelectMultiple,
+ 'sellers':CheckboxSelectMultiple})
pk_url_kwarg = "counter_id"
template_name = 'counter/counter_edit.jinja'
diff --git a/launderette/migrations/0006_auto_20160801_1928.py b/launderette/migrations/0006_auto_20160801_1928.py
new file mode 100644
index 00000000..fdc11e17
--- /dev/null
+++ b/launderette/migrations/0006_auto_20160801_1928.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('launderette', '0005_auto_20160801_1634'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='token',
+ name='borrow_date',
+ field=models.DateTimeField(blank=True, verbose_name='borrow date', null=True),
+ ),
+ migrations.AlterField(
+ model_name='token',
+ name='user',
+ field=models.ForeignKey(blank=True, to='subscription.Subscriber', related_name='tokens', verbose_name='user'),
+ ),
+ ]
diff --git a/launderette/migrations/0007_auto_20160801_1929.py b/launderette/migrations/0007_auto_20160801_1929.py
new file mode 100644
index 00000000..1cb8e9be
--- /dev/null
+++ b/launderette/migrations/0007_auto_20160801_1929.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', '0006_auto_20160801_1928'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='token',
+ name='user',
+ field=models.ForeignKey(verbose_name='user', related_name='tokens', blank=True, null=True, to='subscription.Subscriber'),
+ ),
+ ]
diff --git a/launderette/models.py b/launderette/models.py
index 4a9b3d33..aeacce4a 100644
--- a/launderette/models.py
+++ b/launderette/models.py
@@ -4,7 +4,7 @@ from django.conf import settings
from django.core.urlresolvers import reverse
from core.models import User
-from counter.models import Counter
+from counter.models import Counter, Product
from subscription.models import Subscriber
from subscription.views import get_subscriber
@@ -26,8 +26,8 @@ class Launderette(models.Model):
return False
def can_be_edited_by(self, user):
- sub = get_subscriber(request.user)
- return sub in self.sellers.all()
+ sub = get_subscriber(user)
+ return sub in self.counter.sellers.all()
def can_be_viewed_by(self, user):
return user.is_in_group(settings.SITH_MAIN_MEMBERS_GROUP)
@@ -65,8 +65,8 @@ class Token(models.Model):
name = models.CharField(_('name'), max_length=5)
launderette = models.ForeignKey(Launderette, related_name='tokens', verbose_name=_('launderette'))
type = models.CharField(_('type'), max_length=10, choices=[('WASHING', _('Washing')), ('DRYING', _('Drying'))])
- borrow_date = models.DateTimeField(_('borrow date'), null=True)
- user = models.ForeignKey(Subscriber, related_name='tokens', verbose_name=_('user'))
+ borrow_date = models.DateTimeField(_('borrow date'), null=True, blank=True)
+ user = models.ForeignKey(Subscriber, related_name='tokens', verbose_name=_('user'), null=True, blank=True)
class Meta:
verbose_name = _('Token')
diff --git a/launderette/templates/launderette/launderette_click.jinja b/launderette/templates/launderette/launderette_click.jinja
index 810c70d0..3ae92017 100644
--- a/launderette/templates/launderette/launderette_click.jinja
+++ b/launderette/templates/launderette/launderette_click.jinja
@@ -8,7 +8,7 @@
{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}