room: show only accepted and pending talks
This commit is contained in:
parent
da45ebae45
commit
4b0bde3407
|
@ -24,10 +24,14 @@ class Room(models.Model):
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('list-rooms')
|
return reverse('list-rooms')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def talks(self):
|
||||||
|
return self.talk_set.exclude(accepted=False)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def talks_by_date(self):
|
def talks_by_date(self):
|
||||||
return self.talk_set.filter(start_date__isnull=False).order_by('start_date').all()
|
return self.talks.filter(start_date__isnull=False).order_by('start_date').all()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unscheduled_talks(self):
|
def unscheduled_talks(self):
|
||||||
return self.talk_set.filter(start_date__isnull=True).all()
|
return self.talks.filter(start_date__isnull=True).all()
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
{{ room.capacity }} {% trans "place" %}{{ room.capacity|pluralize }}
|
{{ room.capacity }} {% trans "place" %}{{ room.capacity|pluralize }}
|
||||||
{% if request|staff %}
|
{% if request|staff %}
|
||||||
|
|
|
|
||||||
{{ room.talk_set.count }} {% trans "talk" %}{{ room.talk_set.count|pluralize }}
|
{{ room.talks.count }} {% trans "talk" %}{{ room.talks.count|pluralize }}
|
||||||
{% if request|orga %}
|
{% if request|orga %}
|
||||||
|
|
|
|
||||||
<a href="{% url 'edit-room' room.slug %}">{% bootstrap_icon "pencil" %}</a>
|
<a href="{% url 'edit-room' room.slug %}">{% bootstrap_icon "pencil" %}</a>
|
||||||
|
|
|
@ -12,6 +12,7 @@ from .models import Room
|
||||||
from .forms import RoomForm
|
from .forms import RoomForm
|
||||||
from .utils import Program
|
from .utils import Program
|
||||||
|
|
||||||
|
|
||||||
class RoomMixin(object):
|
class RoomMixin(object):
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return Room.objects.filter(site=get_current_site(self.request)).all()
|
return Room.objects.filter(site=get_current_site(self.request)).all()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user