work on archiver / episode item: is now

This commit is contained in:
bkfox
2020-05-29 17:37:04 +02:00
parent d5209206bd
commit d18aeaa9a9
6 changed files with 9 additions and 5 deletions

View File

@ -155,6 +155,7 @@ class Log(models.Model):
@classmethod
def merge_diffusions(cls, logs, diffs, count=None):
# TODO: limit count
# FIXME: log may be iterable (in stats view)
logs = list(logs.order_by('-date'))
diffs = deque(diffs.on_air().before().order_by('-start'))
object_list = []

View File

@ -12,7 +12,10 @@ Context variables:
{% block title %}
{% if not object.is_published and object.program.is_published %}
<a href="{{ object.program.get_absolute_url }}">{{ object.title }}</a>
<a href="{{ object.program.get_absolute_url }}">
{{ object.title }}
{% if object.is_now %}<span class="has-text-danger fa fa-play-circle"></span>{% endif %}
</a>
{% else %}
{{ block.super }}
{% endif %}

View File

@ -33,6 +33,6 @@ class StatisticsView(BaseAdminView, LogListView, ListView):
date = None
def get_object_list(self, logs, *_):
return super().get_object_list(logs, True)
super().get_object_list(logs, True)

View File

@ -43,7 +43,7 @@ class LogListMixin(GetDateMixin):
def get_object_list(self, logs, full=False):
"""
Return diffusions merged to the provided logs queryset. If
Return diffusions merged to the provided logs iterable. If
`full`, sort items by date without merging.
"""
diffs = self.get_diffusions_queryset()