playlists and podcasts on episode view
This commit is contained in:
parent
bd185125ac
commit
aabbcd97fa
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
venv/
|
||||
node_modules/
|
||||
*.egg-info/
|
||||
*.egg
|
||||
|
||||
|
Binary file not shown.
|
@ -19,8 +19,8 @@ class TracksInline(SortableInlineAdminMixin, admin.TabularInline):
|
|||
|
||||
class SoundInline(admin.TabularInline):
|
||||
model = Sound
|
||||
fields = ['type', 'path', 'duration', 'is_public']
|
||||
readonly_fields = ['type']
|
||||
fields = ['type', 'path', 'embed', 'duration', 'is_public']
|
||||
readonly_fields = ['type', 'path', 'duration']
|
||||
extra = 0
|
||||
|
||||
|
||||
|
|
|
@ -23,5 +23,3 @@ class Article(Page):
|
|||
verbose_name = _('Article')
|
||||
verbose_name_plural = _('Articles')
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -53,14 +53,14 @@ Context:
|
|||
{% block header %}
|
||||
<h1 class="title is-1">{% block title %}{% endblock %}</h1>
|
||||
|
||||
<h4 class="subtitle is-size-3 columns">
|
||||
<h3 class="subtitle is-3 columns">
|
||||
{% block subtitle %}
|
||||
{% if parent %}
|
||||
<a href="{{ parent.get_absolute_url }}" class="column">
|
||||
❬ {{ parent.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</h4>
|
||||
</h3>
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
||||
|
|
|
@ -31,11 +31,32 @@
|
|||
{% block main %}
|
||||
{{ block.super }}
|
||||
|
||||
{% if podcasts or tracks %}
|
||||
<section class="columns is-desktop">
|
||||
{% if tracks %}
|
||||
<div class="column">
|
||||
<h4 class="title is-4">{% trans "Playlist" %}</h4>
|
||||
<ol>
|
||||
{% for track in tracks %}
|
||||
<li><span>{{ track.title }}</span>
|
||||
<span class="has-text-grey-dark has-text-weight-light">
|
||||
— {{ track.artist }}
|
||||
{% if track.info %}(<i>{{ track.info }}</i>){% endif %}
|
||||
</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if podcasts %}
|
||||
<div class="column">
|
||||
<h4 class="title is-4">{% trans "Podcasts" %}</h4>
|
||||
{% for object in podcasts %}
|
||||
{% include "aircox/podcast_item.html" %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -3,17 +3,9 @@
|
|||
{% with object.track as track %}
|
||||
<span class="has-text-info is-size-5">♬</span>
|
||||
<span>{{ track.title }}</span>
|
||||
{% with track.artist as artist %}
|
||||
{% with track.info as info %}
|
||||
<span class="has-text-grey-dark has-text-weight-light">
|
||||
{% blocktrans %}
|
||||
by {{ artist }}
|
||||
{% endblocktrans %}
|
||||
{% if info %}
|
||||
({% blocktrans %}<i>{{ info }}</i>{% endblocktrans %})
|
||||
{% endif %}
|
||||
— {{ track.artist }}
|
||||
{% if track.info %}(<i>{{ track.info }}</i>){% endif %}
|
||||
</span>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
||||
|
|
|
@ -22,12 +22,6 @@ Context:
|
|||
|
||||
|
||||
{% block main %}
|
||||
{% block headline %}
|
||||
{% if page and page.headline %}
|
||||
<p class="headline">{{ page.headline }}</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|default_if_none:''|safe }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
{% if episodes %}
|
||||
<section>
|
||||
<h4 class="subtitle is-size-4">{% trans "Last shows" %}</h4>
|
||||
<h4 class="title is-4">{% trans "Last shows" %}</h4>
|
||||
|
||||
{% for object in episodes %}
|
||||
{% include "aircox/episode_item.html" %}
|
||||
|
|
|
@ -23,6 +23,8 @@ class EpisodeDetailView(ProgramPageDetailView):
|
|||
def get_context_data(self, **kwargs):
|
||||
kwargs.setdefault('program', self.object.program)
|
||||
kwargs.setdefault('parent', kwargs['program'])
|
||||
if not 'tracks' in kwargs:
|
||||
kwargs['tracks'] = self.object.track_set.order_by('position')
|
||||
if not 'podcasts' in kwargs:
|
||||
kwargs['podcasts'] = self.object.sound_set.podcasts()
|
||||
return super().get_context_data(**kwargs)
|
||||
|
|
Loading…
Reference in New Issue
Block a user