add itpc links for podcast clients

This commit is contained in:
Trent Palmer 2021-04-05 20:49:54 -07:00
parent 620140336c
commit f53640ec4f
4 changed files with 33 additions and 2 deletions

View File

@ -1,4 +1,5 @@
from django.db import models from django.db import models
from django.conf import settings
from tp.models import UUIDAsIDModel from tp.models import UUIDAsIDModel
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.text import slugify from django.utils.text import slugify
@ -75,6 +76,10 @@ class Feed(EpisodeAndFeed):
default=1, default=1,
) )
@property
def get_itpc_rss(self):
return(f'itpc://{settings.DOMAIN_NAME}/rss/{self.slug}.xml')
@property @property
def license_name(self): def license_name(self):
return(get_license_info(self.license))[0] return(get_license_info(self.license))[0]

View File

@ -23,11 +23,22 @@
<p class="text-center mb-2 mt-3">{{ i.created_on }}</p> <p class="text-center mb-2 mt-3">{{ i.created_on }}</p>
<div class="d-flex flex-row justify-content-around align-items-center"> <div class="d-flex flex-row justify-content-around align-items-center">
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:feed' pk=i.pk slug=i.slug %}">Items</a></p> <p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:feed' pk=i.pk slug=i.slug %}">Items</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:rss' slug=i.slug %}">RSS</a></p> <p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ i.slug }}-rss" data-toggle="collapse">PodCast</a></p>
</div> </div>
<a href="#x{{ i.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a> <a href="#x{{ i.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a>
</div> </div>
</div> </div>
<div id="x{{ i.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="{{ i.get_itpc_rss }}">BeyondPod</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:rss' slug=i.slug %}">RSS</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{{ i.get_itpc_rss }}">Other ITPC</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{{ i.get_itpc_rss }}">AntennaPod</a></p>
<p class="mb-1"><a type="button" class="btn btn-dark" href="{{ i.get_itpc_rss }}">Podcast Addict</a></p>
</div>
<hr class="my-1">
</div>
<div id="x{{ i.slug }}-attributions" class="collapse text-justify"> <div id="x{{ i.slug }}-attributions" class="collapse text-justify">
Photo <a href="{{ i.original_image_url }}" class="text-dark" style="text-decoration: underline">{{ i.image_title }}</a> by Photo <a href="{{ i.original_image_url }}" class="text-dark" style="text-decoration: underline">{{ i.image_title }}</a> by
{% if i.image_attribution_url == '' %} {% if i.image_attribution_url == '' %}

View File

@ -45,14 +45,27 @@
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:episode' pk=j.pk slug=j.slug %}">Link</a></p> <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 %} {% 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="{% 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 %} {% endif %}
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:rss' slug=j.feed.slug %}">RSS</a></p>
</div> </div>
<a href="#x{{ j.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a> <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>
</div> </div>
<div class="container w-100 mb-2"> <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"> <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 Photo <a href="{{ j.original_image_url }}" class="text-dark" style="text-decoration: underline">{{ j.image_title }}</a> by
{% if j.image_attribution_url == '' %} {% if j.image_attribution_url == '' %}

View File

@ -156,3 +156,5 @@ EMAIL_PORT = int(os.getenv('EMAIL_PORT'))
EMAIL_USE_TLS = os.getenv('EMAIL_USE_TLS') == "True" EMAIL_USE_TLS = os.getenv('EMAIL_USE_TLS') == "True"
EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER') EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD') EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD')
DOMAIN_NAME = os.getenv('DOMAIN_NAME')