podcastrr/templates/podcasts/view.html
2025-06-14 22:53:38 -07:00

86 lines
3.7 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ podcast.title }}{% endblock %}
{% block content %}
<section class="podcast-detail">
<div class="podcast-header">
<div class="podcast-image">
{% if podcast.image_url %}
<img src="{{ podcast.image_url }}" alt="{{ podcast.title }}">
{% else %}
<div class="no-image">No Image</div>
{% endif %}
</div>
<div class="podcast-info">
<h1>{{ podcast.title }}</h1>
<p class="podcast-author">{{ podcast.author }}</p>
<div class="podcast-description">
<p>{{ podcast.description }}</p>
</div>
<div class="podcast-actions">
<form action="{{ url_for('podcasts.delete', podcast_id=podcast.id) }}" method="post" onsubmit="return confirm('Are you sure you want to delete this podcast?');">
<button type="submit" class="btn btn-danger">Delete Podcast</button>
</form>
<form action="{{ url_for('podcasts.update', podcast_id=podcast.id) }}" method="post">
<button type="submit" class="btn">Update Episodes</button>
</form>
</div>
<div class="podcast-meta">
<span>Last updated: {{ podcast.last_updated.strftime('%Y-%m-%d %H:%M') if podcast.last_updated else 'Never' }}</span>
<span>Last checked: {{ podcast.last_checked.strftime('%Y-%m-%d %H:%M') if podcast.last_checked else 'Never' }}</span>
</div>
</div>
</div>
<div class="episodes-section">
<div class="episodes-header">
<h2>Episodes ({{ episodes|length }})</h2>
</div>
{% if episodes %}
<div class="episodes-list">
{% for episode in episodes %}
<div class="episode-item">
<div class="episode-header">
<h3 class="episode-title">{{ episode.title }}</h3>
<span class="episode-date">{{ episode.published_date.strftime('%Y-%m-%d') if episode.published_date else 'Unknown date' }}</span>
</div>
<div class="episode-description">
<p>{{ episode.description|truncate(200) }}</p>
</div>
<div class="episode-footer">
<div class="episode-meta">
{% if episode.duration %}
<span class="episode-duration">Duration: {{ (episode.duration / 60)|int }} min</span>
{% endif %}
{% if episode.episode_number %}
<span class="episode-number">Episode: {{ episode.episode_number }}</span>
{% endif %}
</div>
<div class="episode-actions">
{% if episode.downloaded %}
<span class="badge downloaded">Downloaded</span>
{% else %}
<a href="{{ url_for('podcasts.download', episode_id=episode.id) }}" class="btn btn-sm">Download</a>
{% endif %}
<a href="{{ episode.audio_url }}" target="_blank" class="btn btn-sm btn-secondary">Stream</a>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="no-episodes">
<p>No episodes found for this podcast. Try clicking the "Update Episodes" button to fetch the latest episodes.</p>
</div>
{% endif %}
</div>
</section>
{% endblock %}