forked from rc/aircox
static pages
This commit is contained in:
@ -4,11 +4,11 @@ import datetime
|
||||
from django.views.generic import ListView
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from ..models import Diffusion, Episode, Program, Sound
|
||||
from ..models import Diffusion, Episode, Program, StaticPage, Sound
|
||||
from .base import BaseView
|
||||
from .program import ProgramPageDetailView
|
||||
from .page import PageListView
|
||||
from .mixins import GetDateMixin, ParentMixin
|
||||
from .mixins import AttachedToMixin, GetDateMixin, ParentMixin
|
||||
|
||||
|
||||
__all__ = ['EpisodeDetailView', 'EpisodeListView', 'DiffusionListView']
|
||||
@ -28,18 +28,20 @@ class EpisodeDetailView(ProgramPageDetailView):
|
||||
return super().get_context_data(**kwargs)
|
||||
|
||||
|
||||
class EpisodeListView(ParentMixin, PageListView):
|
||||
class EpisodeListView(PageListView):
|
||||
model = Episode
|
||||
item_template_name = 'aircox/widgets/episode_item.html'
|
||||
has_headline = True
|
||||
parent_model = Program
|
||||
attach_to_value = StaticPage.ATTACH_TO_EPISODES
|
||||
|
||||
|
||||
class DiffusionListView(GetDateMixin, BaseView, ListView):
|
||||
class DiffusionListView(GetDateMixin, AttachedToMixin, BaseView, ListView):
|
||||
""" View for timetables """
|
||||
model = Diffusion
|
||||
has_filters = True
|
||||
redirect_date_url = 'diffusion-list'
|
||||
attach_to_value = StaticPage.ATTACH_TO_DIFFUSIONS
|
||||
|
||||
def get_date(self):
|
||||
date = super().get_date()
|
||||
|
Reference in New Issue
Block a user