work on archiver / episode item: is now
This commit is contained in:
		@ -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 = []
 | 
			
		||||
 | 
			
		||||
@ -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 %}
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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()
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user