-
Notifications
You must be signed in to change notification settings - Fork 14
/
get-comments.xsl
executable file
·48 lines (44 loc) · 1.22 KB
/
get-comments.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="comments">
<h3>
<xsl:text>Comments</xsl:text>
<xsl:if test="$is-logged-in = 'true'">
<xsl:text> — </xsl:text>
<a href="{$root}/symphony/publish/comments/?filter=article:{/data/article/entry/@id}">Manage</a>
</xsl:if>
</h3>
<div id="comments">
<xsl:apply-templates select="entry"/>
<xsl:apply-templates select="error"/>
</div>
</xsl:template>
<xsl:template match="comments/entry">
<dl class="comment">
<dt>
<xsl:choose>
<xsl:when test="website">
<a href="{website}">
<xsl:value-of select="author"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="author"/>
</xsl:otherwise>
</xsl:choose>
<em>
<xsl:call-template name="format-date">
<xsl:with-param name="date" select="date"/>
<xsl:with-param name="format" select=" 'd m y, t' "/>
</xsl:call-template>
</em>
</dt>
<dd>
<xsl:copy-of select="comment/*"/>
</dd>
</dl>
</xsl:template>
<xsl:template match="comments/error">
<p>There are no comments made so far.</p>
</xsl:template>
</xsl:stylesheet>