diff --git a/planning/forms.py b/planning/forms.py index 783fa49..831748d 100644 --- a/planning/forms.py +++ b/planning/forms.py @@ -10,7 +10,7 @@ class RoomForm(forms.ModelForm): class Meta: model = Room - fields = ['name', 'capacity'] + fields = ['name', 'label', 'capacity'] def clean_name(self): name = self.cleaned_data['name'] diff --git a/planning/migrations/0003_room_label.py b/planning/migrations/0003_room_label.py new file mode 100644 index 0000000..0b6fbcf --- /dev/null +++ b/planning/migrations/0003_room_label.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10 on 2016-10-10 22:06 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('planning', '0002_auto_20161005_2108'), + ] + + operations = [ + migrations.AddField( + model_name='room', + name='label', + field=models.CharField(blank=True, default='', max_length=256), + ), + ] diff --git a/planning/models.py b/planning/models.py index e5756d0..8619304 100644 --- a/planning/models.py +++ b/planning/models.py @@ -9,8 +9,9 @@ from autoslug import AutoSlugField class Room(models.Model): site = models.ForeignKey(Site, on_delete=models.CASCADE) - name = models.CharField(max_length=256, blank=True, default="") slug = AutoSlugField(populate_from='name') + name = models.CharField(max_length=256, blank=True, default="") + label = models.CharField(max_length=256, blank=True, default="") capacity = models.IntegerField(default=0) class Meta: diff --git a/planning/templates/planning/room_list.html b/planning/templates/planning/room_list.html index 9ab904a..f29f9d9 100644 --- a/planning/templates/planning/room_list.html +++ b/planning/templates/planning/room_list.html @@ -16,11 +16,14 @@ {% for room in room_list %}

{{ room }}

+ {% if room.label %}

{{ room.label }}

{% endif %} +

{{ room.capacity }} {% trans "place" %}{{ room.capacity|pluralize }} {% if request|staff %} | {% bootstrap_icon "pencil" %} {% endif %} +

{% cycle '' '
' %} {% cycle '' '' '' %}