Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / tools / cgi / xslt / common.xslt
blob2d75d0670b8596b8c0017508c9dff4dc2d10e4ba
1 <!--
2  templates fragments shared by all templates.  This template expects
3  the following external variables:
5    cgi-program    - path to the CGI executable, to place in links
6    stylesheet     - path to the CSS stylesheet
8  the input XML must have the following structure, plus any elements
9  that are not common to all templates:
11  <darcs repository="">
12    <path>
13      <element full-path=""></element>
14    </path>
16    ...
18  </darcs>
19 -->
20 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
21   <xsl:variable name="command">
22     <xsl:value-of select="$cgi-program"/>/<xsl:value-of select="/darcs/@target"/>
23   </xsl:variable>
25   <xsl:variable name="repo" select="/darcs/@repository"/>
26   
27   <xsl:template match="/darcs">
28     <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
29       <head>
30         <title>darcs repository</title>
31         <link rel="stylesheet" href="{$stylesheet}"/>
32         <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="{$command}?c=rss" />
33       </head>
35       <body>
36         <xsl:apply-templates/>
38         <form action="{$command}" method="get">
39           <p>
40             <input class="patches" type="submit" name="c" value="patches"/>
41             
42             <a href="{$command}?c=rss">rss</a>
43             
44             <span class="version">
45               <a class="home" href="http://darcs.net/">darcs.cgi</a>
46               v1.0
47             </span>
48           </p>
49         </form>
50       </body>
51     </html>
52   </xsl:template>
54   <xsl:template match="path/directory">
55     <xsl:variable name="full-path"  select="@full-path"/>
56     
57     <a href="{$cgi-program}{$full-path}?c=browse">
58       <xsl:apply-templates/>
59     </a> /
60   </xsl:template>
62   <xsl:template match="path/file">
63     <xsl:apply-templates/>
64   </xsl:template>
65   
66 </xsl:stylesheet>