trentpalmerdotorg/audio/templates/audio/index.html

128 lines
7.1 KiB
HTML

{% extends "base.html" %}
{% block morehead %}
{% if is_episode %}
<meta property="twitter:card" content="summary" />
<meta property="twitter:creator" content="{{ user.account.twitter_handle }}" />
<meta property="twitter:image" content="{{ IMAGES_URL }}{{ twitter_image }}" />
<meta property="og:title" content="{{ ogtitle }}" />
<meta property="og:url" content="{{ ogurl }}" />
<meta property="og:audio" content="{{ MP3_URL }}{{ ogmp3 }}" />
<meta property="og:audio:secure" content="{{ MP3_URL }}{{ ogmp3 }}" />
<meta property="og:audio:type" content="audio/mpeg" />
{% endif %}
{% endblock morehead %}
{% block content %}
{% include "base_navbar.html" %}
{% include "base_heading.html" %}
<div id="main" class="mx-0 px-0">
<div class="row w-100 mx-0">
<div class="col-0 col-sm-3">
</div>
<div class="col-12 col-sm-6 px-0 mx-0">
{% if user.is_authenticated %}
{% if view == 'feed' %}
<div class="mb-3 d-flex justify-content-around">
<a href="{% url 'audio:edit_feed' pk=feed_pk title_slug=feed_slug %}" class="text-dark" style="text-decoration: underline">Edit Feed?</a>
<a href="{% url 'audio:new_episode' feed_pk=feed_pk feed_title_slug=feed_slug %}" class="text-dark" style="text-decoration: underline">New Episode?</a>
</div>
{% endif %}
{% endif %}
{% for j in episodes %}
<div class="card mx-1 mb-3">
<h2 style="font-size: 1.5rem" class="text-center mt-2">
{{ j.episode_number }}. {{ j.title }}
</h2>
<div class="container w-100 mb-2">
<div class="row">
<div class="col-3 d-flex flex-column justify-content-center">
<img src="{{ IMAGES_URL }}{{ j.image }}" alt="{{ j.image_title }}">
</div>
<div class="col-9 d-flex flex-column justify-content-around">
<p class="text-center mb-2 mt-3">{{ j.pub_date }}</p>
<div class="d-flex flex-row justify-content-around">
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:episode' pk=j.pk slug=j.slug %}">Link</a></p>
{% if add_feed_link %}
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:feed' pk=j.feed.id slug=j.feed.slug %}">Feed</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ j.slug }}-rss" data-toggle="collapse">Pod</a></p>
{% else %}
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ j.slug }}-rss" data-toggle="collapse">PodCast</a></p>
{% endif %}
</div>
<a href="#x{{ j.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a>
</div>
</div>
</div>
<div class="container w-100 mb-2">
<div id="x{{ j.slug }}-rss" class="collapse">
<hr class="my-2">
<div class="d-flex flex-row justify-content-around flex-wrap">
<p class="mb-1"><a type="button" class="btn btn-dark" href="{{ j.feed.get_itpc_rss }}">BeyondPod</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:rss' slug=j.feed.slug %}">RSS</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{{ j.feed.get_itpc_rss }}">Other ITPC</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{{ j.feed.get_itpc_rss }}">AntennaPod</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{{ j.feed.get_itpc_rss }}">Podcast Addict</a></p>
</div>
<hr class="my-1">
</div>
<div id="x{{ j.slug }}-attributions" class="collapse text-justify">
Photo <a href="{{ j.original_image_url }}" class="text-dark" style="text-decoration: underline">{{ j.image_title }}</a> by
{% if j.image_attribution_url == '' %}
{{ j.image_attribution }}
{% else %}
<a href="{{ j.image_attribution_url }}" class="text-dark" style="text-decoration: underline">{{ j.image_attribution }}</a>
{% endif %}
is licensed <a href="{{ j.image_license_url }}" class="text-dark" style="text-decoration: underline">{{ j.image_license_name }}</a>
{{ j.image_license_jurisdiction }}.
<hr class="my-1">
<a href="{{ j.feed.ebook_url }}" class="text-dark" style="text-decoration: underline">{{ j.feed.ebook_title }}</a> by
<a href="{{ j.feed.author_url }}" class="text-dark" style="text-decoration: underline">{{ j.feed.author }}</a>
is licensed <a href="{{ j.feed.license_url }}" class="text-dark" style="text-decoration: underline">{{ j.feed.license_name }}</a>
{{ j.feed.license_jurisdiction }}.
{% if j.feed.translator != '' %}
Translated by <a href="{{ j.feed.translator_url }}" class="text-dark" style="text-decoration: underline">{{ j.feed.translator }}</a>.
{% endif %}
{% if j.feed.intro_author != '' %}
Intro by <a href="{{ j.feed.intro_author_url }}" class="text-dark" style="text-decoration: underline">{{ j.feed.intro_author }}</a>.
{% endif %}
<hr class="my-1">
</div>
<p class="text-justify mb-0">{{ j.description }}</p>
<audio controls class="btn btn-dark w-100 mt-3">
<source src="{{ MP3_URL }}{{ j.mp3 }}" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
</div>
{% if user.is_authenticated %}
{% if user == j.user %}
<div class="container w-100 d-flex justify-content-around my-1">
<div>
<a href="{% url 'audio:edit_episode' pk=j.pk title_slug=j.slug %}" class="text-dark" style="text-decoration: underline">Edit Episode?</a><br>
</div>
{% if view != 'feed' %}
<div>
<a href="{% url 'audio:new_episode' feed_pk=j.feed.pk feed_title_slug=j.feed.slug %}" class="text-dark" style="text-decoration: underline">New Episode?</a>
</div>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
{% endfor %}
{% if is_episode %}
<div class="text-center">
More from <a href="{% url 'audio:feed' pk=feed.id slug=feed.slug %}" class="text-dark" style="text-decoration: underline">{{ feed.title }}</a>?
</div>
{% endif %}
</div>
<div class="col-0 col-sm-3">
</div>
</div>
</div>
{% endblock %}