add sound field to room model, fix #81
This commit is contained in:
parent
6911177bda
commit
7da7df56b2
|
@ -10,7 +10,7 @@ class RoomForm(forms.ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = Room
|
||||
fields = ['name', 'label', 'capacity']
|
||||
fields = ['name', 'label', 'capacity', 'sound']
|
||||
|
||||
def clean_name(self):
|
||||
name = self.cleaned_data['name']
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2017-05-26 11:18
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('planning', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='room',
|
||||
name='sound',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -14,6 +14,7 @@ class Room(models.Model):
|
|||
name = models.CharField(max_length=256, blank=True, default="")
|
||||
label = models.CharField(max_length=256, blank=True, default="")
|
||||
capacity = models.IntegerField(default=0)
|
||||
sound = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
unique_together = ['site', 'name']
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
<h1>{{ room.name }}
|
||||
<small>{{ room.label }}</small>
|
||||
<span class="glyphicon glyphicon-volume-{% if room.sound %}up{% else %}off{% endif %}"></span>
|
||||
</h1>
|
||||
|
||||
<h2>{% trans "Scheduled talks" %}</h2>
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
<div class="row">
|
||||
{% for room in room_list %}
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<h2><a href="{% url 'show-room' room.slug %}">{{ room }}</a></h2>
|
||||
<h2>
|
||||
<a href="{% url 'show-room' room.slug %}">{{ room }}</a>
|
||||
<span class="glyphicon glyphicon-volume-{% if room.sound %}up{% else %}off{% endif %}"></span>
|
||||
</h2>
|
||||
{% if room.label %}<p>{{ room.label }}</p>{% endif %}
|
||||
<p>
|
||||
{{ room.capacity }} {% trans "place" %}{{ room.capacity|pluralize }}
|
||||
|
|
Loading…
Reference in New Issue