diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc44f60 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +__pycache__/ +*.py[cod] + +venv/ +node_modules/ +*.egg-info/ +*.egg + + diff --git a/aircox/admin/__pycache__/sound.cpython-37.pyc b/aircox/admin/__pycache__/sound.cpython-37.pyc index 4480626..9923ef2 100644 Binary files a/aircox/admin/__pycache__/sound.cpython-37.pyc and b/aircox/admin/__pycache__/sound.cpython-37.pyc differ diff --git a/aircox/admin/sound.py b/aircox/admin/sound.py index 2499fd6..4800ee9 100644 --- a/aircox/admin/sound.py +++ b/aircox/admin/sound.py @@ -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 diff --git a/aircox/models/article.py b/aircox/models/article.py index 8986eb6..e99f30a 100644 --- a/aircox/models/article.py +++ b/aircox/models/article.py @@ -23,5 +23,3 @@ class Article(Page): verbose_name = _('Article') verbose_name_plural = _('Articles') - - diff --git a/aircox/templates/aircox/base.html b/aircox/templates/aircox/base.html index 4c5d6b3..79eb850 100644 --- a/aircox/templates/aircox/base.html +++ b/aircox/templates/aircox/base.html @@ -53,14 +53,14 @@ Context: {% block header %}

{% block title %}{% endblock %}

-

+

{% block subtitle %} {% if parent %} ❬ {{ parent.title }} {% endif %} {% endblock %} -

+ {% endblock %} diff --git a/aircox/templates/aircox/episode_detail.html b/aircox/templates/aircox/episode_detail.html index 3f1fda9..588eb0d 100644 --- a/aircox/templates/aircox/episode_detail.html +++ b/aircox/templates/aircox/episode_detail.html @@ -31,11 +31,32 @@ {% block main %} {{ block.super }} -{% if podcasts %} -{% for object in podcasts %} -{% include "aircox/podcast_item.html" %} -{% endfor %} -{% endif %} - +{% if podcasts or tracks %} +
+ {% if tracks %} +
+

{% trans "Playlist" %}

+
    + {% for track in tracks %} +
  1. {{ track.title }} + + — {{ track.artist }} + {% if track.info %}({{ track.info }}){% endif %} + +
  2. + {% endfor %} +
+
+ {% endif %} + {% if podcasts %} +
+

{% trans "Podcasts" %}

+ {% for object in podcasts %} + {% include "aircox/podcast_item.html" %} + {% endfor %} + {% endif %} +
+ {% endif %} +
{% endblock %} diff --git a/aircox/templates/aircox/log_item.html b/aircox/templates/aircox/log_item.html index 90af6c7..0cf518e 100644 --- a/aircox/templates/aircox/log_item.html +++ b/aircox/templates/aircox/log_item.html @@ -3,17 +3,9 @@ {% with object.track as track %} {{ track.title }} -{% with track.artist as artist %} -{% with track.info as info %} - {% blocktrans %} - by {{ artist }} - {% endblocktrans %} - {% if info %} - ({% blocktrans %}{{ info }}{% endblocktrans %}) - {% endif %} +— {{ track.artist }} +{% if track.info %}({{ track.info }}){% endif %} {% endwith %} -{% endwith %} -{% endwith %} diff --git a/aircox/templates/aircox/page.html b/aircox/templates/aircox/page.html index dbc834e..c2e46aa 100644 --- a/aircox/templates/aircox/page.html +++ b/aircox/templates/aircox/page.html @@ -22,12 +22,6 @@ Context: {% block main %} -{% block headline %} -{% if page and page.headline %} -

{{ page.headline }}

-{% endif %} -{% endblock %} - {% block content %} {{ page.content|default_if_none:''|safe }} {% endblock %} diff --git a/aircox/templates/aircox/program_base.html b/aircox/templates/aircox/program_base.html index 632f072..fe44bcc 100644 --- a/aircox/templates/aircox/program_base.html +++ b/aircox/templates/aircox/program_base.html @@ -6,7 +6,7 @@ {% if episodes %}
-

{% trans "Last shows" %}

+

{% trans "Last shows" %}

{% for object in episodes %} {% include "aircox/episode_item.html" %} diff --git a/aircox/views/episode.py b/aircox/views/episode.py index 983668b..4ce94e8 100644 --- a/aircox/views/episode.py +++ b/aircox/views/episode.py @@ -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)