Reflowed and split cscweb.xsl into smaller xsl files.
[www/www.git] / xsl / media.xsl
1 <?xml version='1.0'?>
2
3 <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4     xmlns:csc="http://www.csclub.uwaterloo.ca/cow" 
5     extension-element-prefixes="csc">
6
7 <xsl:template match="mediafile">
8   <xsl:param name="ext" />
9   <a href="/files/{@file}{$ext}"><xsl:value-of select="@type" /></a>, 
10 </xsl:template>
11
12 <xsl:template match="flvfile">
13   <script type="text/javascript" src="flash/swfobject.js"></script>
14   <p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">
15     Get the Flash Player</a> to see this video using Flash Player.</p>
16   <script type="text/javascript">
17     var s1 = new SWFObject("flash/flvplayer.swf","single","400","300","7");
18     s1.addParam("allowfullscreen","true");
19     s1.addVariable("file","http://csclub.uwaterloo.ca/files/<xsl:value-of select="@file" />");
20     <xsl:if test="@preview">
21       s1.addVariable("image","http://csclub.uwaterloo.ca/files/<xsl:value-of select="@preview" />");
22     </xsl:if>
23     s1.write("player1");
24   </script>
25 </xsl:template>
26
27 <xsl:template match="mediaitem">
28   <xsl:document method="xml" encoding="ISO-8859-1" 
29       doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
30       doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
31       href="{translate(concat($root, '/media/', @title , '.html'), ' ', ' ')}">
32     <html>
33       <head>
34         <title><xsl:value-of select="@title" /></title>
35         <link rel="stylesheet" href="{$pre}default.css" type="text/css" />
36       </head>
37       <body><div>
38         <xsl:call-template name="header">
39           <xsl:with-param name="title" select="@title" />
40         </xsl:call-template>
41         <xsl:if test="abstract">
42           <h2>Abstract</h2>
43           <div>
44             <xsl:apply-templates select="abstract/node()" />
45           </div>
46         </xsl:if>
47         <xsl:if test="flvfile">
48           <h2>View</h2>
49         <div>
50           <xsl:apply-templates select="flvfile" />
51         </div>
52         </xsl:if>
53         <xsl:if test="mediafile">
54           <h2>Download</h2>
55           <div><strong>
56             HTTP (web browser):
57             <xsl:apply-templates select="mediafile" />
58             <br/><br/>
59             BitTorrent:
60             <xsl:apply-templates select="mediafile" >
61               <xsl:with-param name="ext">.torrent</xsl:with-param>
62             </xsl:apply-templates>
63           </strong></div>
64         </xsl:if>
65         <br/>
66         <!-- AddThis Bookmark Button -->
67         <script type="text/javascript">
68           addthis_url    = location.href;
69           addthis_title  = document.title;
70           addthis_pub    = 'calumt';
71         </script>
72         <script type="text/javascript" 
73             src="http://s7.addthis.com/js/addthis_widget.php?v=12" />
74         <xsl:if test="@buttons">
75           <br/><br/>
76           <!-- digg button -->
77           <script src="http://digg.com/tools/diggthis.js" 
78                   type="text/javascript" />
79           <!-- reddit button -->
80           <script type="text/javascript" 
81                   src="http://reddit.com/button.js?t=3" />
82         </xsl:if>
83         <!-- google ads -->
84         <!--
85         <script type="text/javascript">
86           google_ad_client = "pub-5235744946475097";
87           google_ad_width = 728;
88           google_ad_height = 90;
89           google_ad_format = "728x90_as";
90           google_ad_type = "text_image";
91           //2007-03-21: mcc
92           google_ad_channel = "1106187834";
93         </script>
94         <script type="text/javascript"
95             src="http://pagead2.googlesyndication.com/pagead/show_ads.js" />
96         -->
97         <xsl:call-template name="footer" />
98       </div></body>
99     </html>
100   </xsl:document>
101   <li><a href= "{@title}.html"><xsl:value-of select="@title" /></a></li>
102 </xsl:template>
103
104 </xsl:stylesheet>