Added Home and parent folder links to togo (pull), video push and settings templates/xsl
[pyTivo/wmcbrine/lucasnz.git] / plugins / video / content / container.xsl
blob1b0b09c05e8871bdc8a875451f5b9dd528fdbc09
1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2 <xsl:output method="html" encoding="utf-8"
3 doctype-system="http://www.w3.org/TR/html4/strict.dtd"
4 doctype-public="-//W3C//DTD HTML 4.01//EN"/>
5 <xsl:template match="TiVoContainer">
6 <xsl:variable name="tivos" select="Tivos"/>
7 <html>
8 <head>
9 <title>pyTivo - Push -
10 <xsl:value-of select="Details/Title"/>
11 </title>
12 <link rel="stylesheet" type="text/css" href="/main.css"/>
13 </head>
14 <body>
15 <form action="/TiVoConnect" method="POST">
16 <p id="titlep"><span id="title">pyTivo - Push -
17 <xsl:value-of select="Details/Title"/>
18 </span></p>
19 <p><a href="/">Home</a></p>
20 <script language="JavaScript">
21 <![CDATA[
22 <!--
23 function toggle(source) {
24 var checkboxes = document.getElementsByName('File');
25 for (var i = 0; i < checkboxes.length; i++) {
26 if (typeof(checkboxes[i].checked) != "undefined") {
27 checkboxes[i].checked = source.checked;
31 //-->
32 ]]>
33 </script>
34 <table id="main" style="text-align: left;" border="0" cellpadding="0"
35 cellspacing="4" width="100%">
36 <tr class="header">
37 <td><input type="checkbox" name="selectAll" OnClick="toggle(this)" Title="Select All" /></td>
38 <td></td>
39 <td>Title</td>
40 <td>Size</td>
41 <td>Capture Date</td>
42 </tr>
43 <tr id="parentLinkRow" style="display: none;">
44 <td><img src="/back.png" alt="" /></td>
45 <td width="100%" colspan="4">
46 <a id="parentLink" href="">Up to Parent Folder</a>
47 </td>
48 </tr>
49 <SCRIPT LANGUAGE="JavaScript">
50 <![CDATA[
51 <!--
52 var sGet = window.location.search
53 var re = new RegExp("([\?|&]Container=)(.*)/[^&]+", "g");
54 var m = re.exec(sGet);
55 if (m != null) {
56 var re = new RegExp("([\?|&]Container=)(.*)/[^&]+", "g");
57 sGet = sGet.replace(re, "$1$2");
59 //Show up to parent folder link if we are in a subfolder
60 document.getElementById('parentLink').href = sGet;
61 document.getElementById('parentLinkRow').style.display = '';
63 //-->
64 ]]>
65 </SCRIPT>
66 <xsl:for-each select="Item">
67 <tr>
68 <xsl:choose>
69 <xsl:when test="position() mod 2 = 1">
70 <xsl:attribute name="class">
71 <xsl:value-of select="'row1'"/>
72 </xsl:attribute>
73 </xsl:when>
74 <xsl:otherwise>
75 <xsl:attribute name="class">
76 <xsl:value-of select="'row0'"/>
77 </xsl:attribute>
78 </xsl:otherwise>
79 </xsl:choose>
80 <xsl:choose>
81 <xsl:when test="Details/ContentType = 'x-container/folder'">
82 <td/>
83 <td><img src="/folder.png" alt="" /></td>
84 <td width="100%">
85 <a>
86 <xsl:attribute name="href">
87 <xsl:value-of select="Links/Content/Url"/>
88 </xsl:attribute>
89 <xsl:value-of select="Details/Title"/>
90 </a>
91 </td>
92 <td class="unbreak">
93 <xsl:value-of select="Details/TotalItems"/> Items
94 </td>
95 <td class="unbreak"><xsl:value-of select="Links/Push/Date"/></td>
96 </xsl:when>
97 <xsl:otherwise>
98 <td>
99 <input type="checkbox" name="File">
100 <xsl:attribute name="value">
101 <xsl:value-of select="Links/Push/File"/>
102 </xsl:attribute>
103 </input>
104 </td>
105 <td/>
106 <td width="100%">
107 <span class="progtitle">
108 <xsl:value-of select="Details/Title"/>
109 <xsl:if test="Details/EpisodeTitle != ''">
110 <xsl:if test="Details/EpisodeTitle != Details/Title">
111 : <xsl:value-of select="Details/EpisodeTitle"/>
112 </xsl:if>
113 </xsl:if>
114 </span>
115 <xsl:if test="Details/Description != ''">
116 <span class="progdesc">
117 <xsl:value-of select="Details/Description"/>
118 </span>
119 </xsl:if>
120 </td>
121 <td class="unbreak">
122 <xsl:value-of select="Links/Push/Size"/>
123 </td>
124 <td class="unbreak"><xsl:value-of select="Links/Push/Date"/></td>
125 </xsl:otherwise>
126 </xsl:choose>
127 </tr>
128 </xsl:for-each>
129 </table>
131 <input type="hidden" name="Command" value="Push"/>
132 <input type="hidden" name="Container">
133 <xsl:attribute name="value">
134 <xsl:value-of select="/TiVoContainer/Details/Title"/>
135 </xsl:attribute>
136 </input>
137 <select name="tsn">
138 <xsl:for-each select="/TiVoContainer/Tivos/Tivo">
139 <option>
140 <xsl:attribute name="value">
141 <xsl:value-of select="."/>
142 </xsl:attribute>
143 <xsl:value-of select="."/>
144 </option>
145 </xsl:for-each>
146 </select>
147 <input value="Send to TiVo" type="submit"/>
148 </p>
149 </form>
150 </body>
151 </html>
152 </xsl:template>
153 </xsl:stylesheet>