1 <?xml version=
"1.0" encoding=
"utf-8"?>
4 template for converting a darcs current/ directory listing from XML to
5 XHTML. This template expects the following external variables:
7 cgi-program - path to the CGI executable, to place in links
8 sort-by - field to sort by
9 stylesheet - path to the CSS stylesheet
11 the input XML must have the following structure, aside from what common.xslt
15 <directory name="" modified=""/>
16 <file name="" modified=""/>
19 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
20 <xsl:include href=
"common.xslt"/>
22 <xsl:template match=
"path">
24 files in
<span class=
"path"><a href=
"{$cgi-program}">projects
</a></span> /
<span class=
"path"><xsl:apply-templates/></span>
28 <xsl:template match=
"files">
32 <a class=
"sort" href=
"{$command}?c=browse&s=name">name
</a>
33 <a class=
"revsort" href=
"{$command}?c=browse&s=revname"> (rev)
</a>
36 <a class=
"sort" href=
"{$command}?c=browse&s=ts">modified
</a>
37 <a class=
"revsort" href=
"{$command}?c=browse&s=revts"> (rev)
</a>
44 <xsl:when test=
"$sort-by = 'ts'">
46 <xsl:sort select=
"name(self::node())"/>
47 <xsl:sort select=
"@ts"/>
48 </xsl:apply-templates>
50 <xsl:when test=
"$sort-by = 'revts'">
52 <xsl:sort select=
"name(self::node())"/>
53 <xsl:sort select=
"@ts" order=
"descending"/>
54 </xsl:apply-templates>
56 <xsl:when test=
"$sort-by = 'name'">
58 <xsl:sort select=
"name(self::node())"/>
59 <xsl:sort select=
"@name"/>
60 </xsl:apply-templates>
62 <xsl:when test=
"$sort-by = 'revname'">
64 <xsl:sort select=
"name(self::node())"/>
65 <xsl:sort select=
"@name" order=
"descending"/>
66 </xsl:apply-templates>
70 <xsl:sort select=
"name(self::node())"/>
71 <xsl:sort select=
"@name"/>
72 </xsl:apply-templates>
78 <xsl:template match=
"directory">
79 <xsl:variable name=
"name" select=
"@name"/>
80 <xsl:variable name=
"type" select=
"@type"/>
82 <tr class=
"directory">
84 <a href=
"{$command}{$name}?c=browse"><xsl:value-of select=
"@name"/></a>
86 <td><xsl:value-of select=
"@modified"/></td>
88 <a href=
"{$command}{$name}?c=annotate">annotate
</a>
91 <a href=
"{$command}{$name}?c=patches">patches
</a>
95 <xsl:apply-templates/>
98 <xsl:template match=
"file">
99 <xsl:variable name=
"name" select=
"@name"/>
102 <td><xsl:value-of select=
"@name"/></td>
103 <td><xsl:value-of select=
"@modified"/></td>
104 <td><a href=
"{$command}{$name}?c=annotate">annotate
</a></td>
105 <td><a href=
"{$command}{$name}?c=patches">patches
</a></td>
108 <xsl:apply-templates/>