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