Add page episode
This commit is contained in:
parent
de8bee7114
commit
227510316b
5
site.cfg
5
site.cfg
@ -74,3 +74,8 @@ navigation: navigation-get-shows.tpl.html
|
|||||||
content: content-episodes.tpl.html
|
content: content-episodes.tpl.html
|
||||||
filename: eps/index.html
|
filename: eps/index.html
|
||||||
|
|
||||||
|
[episode]
|
||||||
|
navigation: navigation-get-shows.tpl.html
|
||||||
|
content: content-episode.tpl.html
|
||||||
|
multipage: true
|
||||||
|
filename: eps/hpr[id]/index.html
|
||||||
|
67
templates/content-episode.tpl.html
Normal file
67
templates/content-episode.tpl.html
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<!--% 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,
|
||||||
|
episode_previous.previous, episode_next.next
|
||||||
|
FROM eps
|
||||||
|
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">
|
||||||
|
<small><a href="<!--% absolute_url(baseurl) %-->eps/hpr<!--% zero_pad_left(episode.earliest) %-->/index.html" rel="first"><< First</a>,
|
||||||
|
<!--% IF episode.previous %-->
|
||||||
|
<a href="<!--% absolute_url(baseurl) %-->eps/hpr<!--% zero_pad_left(episode.previous) %-->/index.html" rel="previous">< Previous</a>,
|
||||||
|
<!--% ELSE %-->
|
||||||
|
<span><</span> Previous,
|
||||||
|
<!--% END %-->
|
||||||
|
<!--% IF episode.next %-->
|
||||||
|
<a href="<!--% absolute_url(baseurl) %-->eps/hpr<!--% zero_pad_left(episode.next) %-->/index.html" rel="next">Next ></a>,
|
||||||
|
<!--% ELSE %-->
|
||||||
|
Next <span>></span>
|
||||||
|
<!--% END %-->
|
||||||
|
<a href="<!--% absolute_url(baseurl) %-->eps/hpr<!--% zero_pad_left(episode.latest) %-->/index.html" rel="last">Latest >></a></small>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Hosted by <a href="correspondents/host<!--% episode.hostid %-->.html"><!--% episode.host %--></a>. <!--% show_meta(episode) %--></p>
|
||||||
|
</header>
|
||||||
|
<div><!--% episode.notes %--></div>
|
||||||
|
</article>
|
||||||
|
<!--% END %-->
|
8
templates/ids-episode.tpl.html
Normal file
8
templates/ids-episode.tpl.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
||||||
|
<!--% FOREACH episode IN DBI.query(
|
||||||
|
'select eps.id from eps
|
||||||
|
where eps.date < date (\'now\', \'+1 days\') '
|
||||||
|
) %-->
|
||||||
|
,<!--% episode.id %-->
|
||||||
|
<!--% END %-->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user