Archived
4
2
This repository has been archived on 2024-09-28. You can view files and clone it, but cannot push or open issues or pull requests.
hpr_generator/templates/content-episode.tpl.html

61 lines
2.2 KiB
HTML
Raw Normal View History

2022-08-07 18:09:44 +00:00
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
<!--% PROCESS 'shared-avatar.tpl.html' %-->
<!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<!--% query_episodes = DBI.prepare('
WITH episode_maxmin AS (
SELECT MAX(id) AS \'latest\', MIN(id) AS \'earliest\', ? AS \'id\'
FROM eps
WHERE eps.date < date (\'now\', \'+1 days\')
),
episode_date AS (
SELECT eps.date
FROM eps
WHERE eps.id = ?
),
episode_previous AS (
SELECT MAX(id) AS \'previous\', ? AS \'id\'
FROM eps
INNER JOIN episode_date
ON eps.date < episode_date.date
WHERE eps.id > 1
),
episode_next AS (
SELECT MIN(id) AS \'next\', ? AS \'id\'
FROM eps
INNER JOIN episode_date
ON eps.date > episode_date.date
WHERE eps.date < date (\'now\')
)
SELECT eps.id, eps.date, eps.title, eps.duration,
eps.summary, eps.notes, eps.explicit, eps.license,
eps.tags, eps.version, eps.downloads, eps.valid,
episode_maxmin.latest, episode_maxmin.earliest,
2022-08-07 22:41:58 +00:00
episode_previous.previous, episode_next.next,
hosts.hostid, hosts.host,
miniseries.name AS \'series\', miniseries.id AS \'seriesid\'
2022-08-07 18:09:44 +00:00
FROM eps
2022-08-07 22:41:58 +00:00
INNER JOIN hosts ON eps.hostid = hosts.hostid
INNER JOIN miniseries ON eps.series = miniseries.id
2022-08-07 18:09:44 +00:00
INNER JOIN episode_maxmin ON eps.id = episode_maxmin.id
INNER JOIN episode_previous ON eps.id = episode_previous.id
INNER JOIN episode_next ON eps.id = episode_next.id
WHERE eps.id = ?
')
%-->
<!--% episode_result = query_episodes.execute(id, id, id, id, id) %-->
<!--% FOREACH episode IN episode_result %-->
<article>
<header>
<h1>hpr<!--% episode.id %--> :: <!--% episode.title %--></h1>
<h3><!--% episode.summary %--></h3>
<p class="meta"><!--% step_navigation(baseurl,episode) %-->
2022-08-07 18:26:05 +00:00
</p>
2022-08-07 22:41:58 +00:00
<p><!--% IF get_avatar(episode.hostid) != 'hpr_logo.png' %-->
<img src="<!--% absolute_path(baseurl) %-->images/<!--% get_avatar(episode.hostid) %-->" height="80" width="80" alt="" /></a><br><!--% END %-->
2022-08-07 18:09:44 +00:00
Hosted by <a href="correspondents/host<!--% episode.hostid %-->.html"><!--% episode.host %--></a>. <!--% show_meta(episode) %--></p>
</header>
<div><!--% episode.notes %--></div>
</article>
<!--% END %-->