OSDN Git Service

add contrib dir
[tortoisegit/TortoiseGitJp.git] / contrib / other / svnindex / svnindex.xsl
1 <?xml version="1.0"?>\r
2 \r
3 <!-- A sample XML transformation style sheet for displaying the Subversion\r
4   directory listing that is generated by mod_dav_svn when the "SVNIndexXSLT"\r
5   directive is used. -->\r
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">\r
7 \r
8         <xsl:output method="html"/>\r
9 \r
10         <xsl:template match="*"/>\r
11 \r
12         <xsl:template match="svn">\r
13                 <html>\r
14                         <head>\r
15                                 <title>\r
16                                         <xsl:if test="string-length(index/@name) != 0">\r
17                                                 <xsl:value-of select="index/@name"/>\r
18                                                 <xsl:text>: </xsl:text>\r
19                                         </xsl:if>\r
20                                         <xsl:value-of select="index/@path"/>\r
21                                 </title>\r
22                                 <link rel="stylesheet" type="text/css" href="/svnindex.css"/>\r
23                                 <script type="text/javascript">\r
24                                         function onLoadHandler(){\r
25                                                 for(var i = 0; i &lt; document.links.length; i++){\r
26                                                         if(document.links[i].target == 'tsvn'){\r
27                                                                 document.links[i].href = 'tsvn:' + document.links[i].href;\r
28                                                         }\r
29                                                 }\r
30                                         }\r
31                                 </script>\r
32                         </head>\r
33                         <body onload="onLoadHandler()">\r
34                                 <div class="svn">\r
35                                         <xsl:apply-templates/>\r
36                                 </div>\r
37                                 <div class="footer">\r
38                                         <xsl:element name="a">\r
39                                                 <xsl:attribute name="style">float: right;</xsl:attribute>\r
40                                                 <xsl:attribute name="href">\r
41                                                         http://tortoisesvn.net\r
42                                                 </xsl:attribute>\r
43                                                 <xsl:text>TortoiseSVN</xsl:text>\r
44                                         </xsl:element>\r
45 \r
46                                         <xsl:text>Powered by </xsl:text>\r
47                                         <xsl:element name="a">\r
48                                                 <xsl:attribute name="href">\r
49                                                         <xsl:value-of select="@href"/>\r
50                                                 </xsl:attribute>\r
51                                                 <xsl:text>Subversion</xsl:text>\r
52                                         </xsl:element>\r
53                                         <xsl:text> </xsl:text>\r
54                                         <xsl:value-of select="@version"/>\r
55                                 </div>\r
56                         </body>\r
57                 </html>\r
58         </xsl:template>\r
59 \r
60         <xsl:template match="index">\r
61                 <div class="rev">\r
62                         <xsl:if test="string-length(@name) != 0">\r
63                                 <xsl:value-of select="@name"/>\r
64                                 <xsl:if test="string-length(@rev) != 0">\r
65                                         <xsl:text> &#8212; </xsl:text>\r
66                                 </xsl:if>\r
67                         </xsl:if>\r
68                         <xsl:if test="string-length(@rev) != 0">\r
69                                 <xsl:text>Revision </xsl:text>\r
70                                 <xsl:value-of select="@rev"/>\r
71                         </xsl:if>\r
72                 </div>\r
73                 <div class="path">\r
74                         <xsl:value-of select="@path"/>\r
75                 </div>\r
76                 <xsl:apply-templates select="updir"/>\r
77                 <xsl:apply-templates select="dir"/>\r
78                 <xsl:apply-templates select="file"/>\r
79         </xsl:template>\r
80 \r
81         <xsl:template match="updir">\r
82                 <div class="updir">\r
83                         <xsl:text>[</xsl:text>\r
84                         <xsl:element name="a">\r
85                                 <xsl:attribute name="href">..</xsl:attribute>\r
86                                 <xsl:text>Parent Directory</xsl:text>\r
87                         </xsl:element>\r
88                         <xsl:text>]</xsl:text>\r
89                 </div>\r
90     <!-- xsl:apply-templates/ -->\r
91         </xsl:template>\r
92 \r
93         <xsl:template match="dir">\r
94                 <div class="dir">\r
95                         <xsl:element name="a">\r
96                                 <xsl:attribute name="title">Checkout: <xsl:value-of select="@href"/></xsl:attribute>\r
97                                 <xsl:attribute name="style">float: right;</xsl:attribute>\r
98                                 <xsl:attribute name="target">tsvn</xsl:attribute>\r
99                                 <xsl:attribute name="href">\r
100                                         <xsl:value-of select="@href"/>\r
101                                 </xsl:attribute>\r
102                                 <img src="/menucheckout.ico"/>\r
103                         </xsl:element>\r
104                         <xsl:element name="a">\r
105                                 <xsl:attribute name="style">margin-right: 22px</xsl:attribute>\r
106                                 <xsl:attribute name="href">\r
107                                         <xsl:value-of select="@href"/>\r
108                                 </xsl:attribute>\r
109                                 <xsl:value-of select="@name"/>\r
110                                 <xsl:text>/</xsl:text>\r
111                         </xsl:element>\r
112                 </div>\r
113     <!-- <xsl:apply-templates/ -->\r
114         </xsl:template>\r
115 \r
116         <xsl:template match="file">\r
117                 <div class="file">\r
118                         <xsl:element name="a">\r
119                                 <xsl:attribute name="href">\r
120                                         <xsl:value-of select="@href"/>\r
121                                 </xsl:attribute>\r
122                                 <xsl:value-of select="@name"/>\r
123                         </xsl:element>\r
124                 </div>\r
125     <!-- xsl:apply-templates/ -->\r
126         </xsl:template>\r
127 \r
128 </xsl:stylesheet>\r