Add latest comments to latest lane on main landing page
This commit is contained in:
parent
991f088ded
commit
71c1c46cfb
@ -85,26 +85,49 @@
|
|||||||
<section id="latest_shows">
|
<section id="latest_shows">
|
||||||
<header>Latest Shows</header>
|
<header>Latest Shows</header>
|
||||||
<!--% host_cnt = 0 %-->
|
<!--% host_cnt = 0 %-->
|
||||||
|
<ul>
|
||||||
<!--% FOREACH latest_episodes IN DBI.query(query_latest_episodes)
|
<!--% FOREACH latest_episodes IN DBI.query(query_latest_episodes)
|
||||||
%-->
|
%-->
|
||||||
<ul>
|
<li><a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(latest_episodes.id) %-->/index.html">hpr<!--% latest_episodes.id %--> :: <!--% latest_episodes.title %--></a></li>
|
||||||
<li><a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(latest_episodes.id) %-->/index.html">hpr<!--% latest_episodes.id %--> :: <!--% latest_episodes.title %--></a></li>
|
|
||||||
</ul>
|
|
||||||
<!--% host_cnt = host_cnt + 1 %-->
|
<!--% host_cnt = host_cnt + 1 %-->
|
||||||
<!--% END %-->
|
<!--% END %-->
|
||||||
<article id="previous_five_weeks">
|
</ul>
|
||||||
<header>
|
</section>
|
||||||
<hr>
|
<section id="latest_comments">
|
||||||
<h1>Previous five weeks</h1>
|
<header>Latest Comments</header>
|
||||||
</header>
|
<ul>
|
||||||
<!--% FOREACH last_5_weeks_episodes IN DBI.query(query_last_5_weeks_episodes)
|
<!--% FOREACH item IN DBI.query('
|
||||||
%-->
|
WITH episode_comment_rank AS (
|
||||||
<!--% show_summary(last_5_weeks_episodes) %-->
|
SELECT
|
||||||
<p class="listen-in"><!--% display_listen_in(last_5_weeks_episodes.id) %--></p>
|
comments.eps_id
|
||||||
<!--% END %-->
|
, comments.id as comment_id
|
||||||
</article>
|
, comments.comment_author_name
|
||||||
<h1>Older Shows</h1>
|
, comments.comment_timestamp
|
||||||
<p>
|
, comments.comment_title
|
||||||
Get a <a href="<!--% absolute_path(baseurl) %-->eps/index.html">full list</a> of all our shows.
|
, RANK() OVER (PARTITION BY eps_id ORDER BY id ) AS comment_number
|
||||||
</p>
|
FROM comments
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
episode_comment_rank.*
|
||||||
|
, hosts.host
|
||||||
|
, eps.title AS episode_title
|
||||||
|
, eps.date AS episode_date
|
||||||
|
FROM episode_comment_rank
|
||||||
|
INNER JOIN eps
|
||||||
|
ON episode_comment_rank.eps_id = eps.id
|
||||||
|
INNER JOIN hosts
|
||||||
|
ON eps.hostid = hosts.hostid
|
||||||
|
ORDER BY episode_comment_rank.comment_timestamp DESC
|
||||||
|
LIMIT 10;
|
||||||
|
|
||||||
|
')
|
||||||
|
%-->
|
||||||
|
<li>hpr<!--% item.eps_id %--> (<!--% item.episode_date %-->) "<!--% item.episode_title %-->" by <!--% item.host %-->
|
||||||
|
<ul>
|
||||||
|
<li><a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(item.eps_id) %-->/index.html#comment_<!--% item.comment_id%-->">Comment <!--% item.comment_number %-->: <!--% item.comment_author_name %--> on <!--% item.comment_timestamp %-->: "<!--% item.comment_title %-->"</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<!--% END %-->
|
||||||
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user