Archived
4
2

Merge pull request '[I12] Implement comments_viewer page' (#77) from I12_Implement-comments-viewer into main

Reviewed-on: #77
This commit is contained in:
Roan Horning 2023-02-25 01:44:50 +00:00
commit f7e54233e2
3 changed files with 53 additions and 0 deletions

View File

@ -242,6 +242,12 @@ table.hosts tr:nth-child(even) { background-color:#cccccc; }
table.hosts tr:nth-child(odd) { background-color:white; }
table.hosts tr td img { vertical-align:middle }
pre.comment {
white-space: pre-wrap;
padding: 2px;
line-height: 1.2rem;
}
@media only screen and (max-width: 680px) {
#container {width: 95%;}
img#hprlogo {float: left; max-width: 85px; padding: .35em;}

View File

@ -146,6 +146,10 @@ media_baseurl: https://www.hackerpublicradio.org/eps/
navigation: navigation-about.tpl.html
content: content-mumble-howto.tpl.html
[comments_viewer]
navigation: navigation-about.tpl.html
content: content-comments_viewer.tpl.html
[hpr_ogg]
root_template: rss.tpl.xml
content: rss-hpr.tpl.xml

View File

@ -0,0 +1,43 @@
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
<!--% PROCESS 'shared-avatar.tpl.html' %-->
<!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% PROCESS 'shared-listen-now.tpl.html' %-->
<!--% PROCESS "queries-episode-${constants.database}.tpl.html" %-->
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<h2>Comment Viewer</h2>
<p>Because of the spammers we have had to turn on comment moderation. Sorry about the delay this will cause.</p>
<p><a href="<!--% absolute_path(baseurl) %-->comments.rss">Subscribe</a> to the comment feed.</p>
<hr />
<!--% FOREACH item IN DBI.query('
SELECT C.*,
H.host, H.hostid AS host_id,
E.title AS episode_title,
E.date AS episode_date,
E.duration AS episode_duration,
M.id AS series_id, M.name AS series_name
FROM comments AS C
INNER JOIN eps AS E
ON C.eps_id = E.id
INNER JOIN hosts AS H
ON E.hostid = H.hostid
INNER JOIN miniseries AS M
ON E.series = M.id
ORDER BY C.comment_timestamp DESC
LIMIT 30
')
%-->
<article>
<header>
<h1><!--% item.comment_author_name %--> says: <!--% item.comment_title %--></h1>
<p><small>Posted at <!--% item.comment_timestamp %--> relating to the show <a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(item.eps_id) %-->/index.html">hpr<!--% item.eps_id %--></a> which was released on <!--% item.episode_date %--> by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(item.host_id) %-->.html"><!--% item.host %--></a> entitled <em><!--% item.episode_title %--></em></small>
</p>
</header>
<pre class="comment">
<!--% item.comment_text %-->
</pre>
<footer>
Listen in <a href="<!--% media_path(item.eps_id, 'hpr', 'ogg', baseurl, media_baseurl) %-->">ogg</a>, <a href="<!--% media_path(item.eps_id, 'hpr', 'spx', baseurl, media_baseurl) %-->">spx</a>, or <a href="<!--% media_path(item.eps_id, 'hpr', 'mp3', baseurl, media_baseurl) %-->">mp3</a> format.</p></footer>
</article>
<hr />
<!--% END %-->