Add end date available property for talk
This commit is contained in:
parent
54bcf5dab8
commit
fc498f476c
|
@ -1,4 +1,5 @@
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.sites.models import Site
|
from django.contrib.sites.models import Site
|
||||||
|
@ -162,6 +163,11 @@ class Talk(PonyConfModel):
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
def end_date(self):
|
||||||
|
return self.start_date + timedelta(minutes=self.duration)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('event__id',)
|
ordering = ('event__id',)
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>{% trans "Format" %}</dt>
|
<dt>{% trans "Format" %}</dt>
|
||||||
<dd><a href="{{ talk.event.get_absolute_url }}">{{ talk.event }}</a></dd>
|
<dd><a href="{{ talk.event.get_absolute_url }}">{{ talk.event }}</a></dd>
|
||||||
<dt>{% trans "Topics:" %}</dt>
|
<dt>{% trans "Topics" %}</dt>
|
||||||
<dd>{% for topic in talk.topics.all %}
|
<dd>{% for topic in talk.topics.all %}
|
||||||
<a href="{{ topic.get_absolute_url }}">{{ topic }}</a>{% if not forloop.last %}, {% endif %}
|
<a href="{{ topic.get_absolute_url }}">{{ topic }}</a>{% if not forloop.last %}, {% endif %}
|
||||||
{% empty %}
|
{% empty %}
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<dd>{% if talk.start_date %}
|
<dd>{% if talk.start_date %}
|
||||||
<span class="date">{{ talk.start_date|date:"l d b" }}</span>,
|
<span class="date">{{ talk.start_date|date:"l d b" }}</span>,
|
||||||
<span class="time">{{ talk.start_date|date:"H:i" }} –
|
<span class="time">{{ talk.start_date|date:"H:i" }} –
|
||||||
{{ talk.slot.end|date:"H:i" }}</span>
|
{{ talk.end_date|date:"H:i" }}</span>
|
||||||
{% else %}<em>{% trans "not defined" %}</em>
|
{% else %}<em>{% trans "not defined" %}</em>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user