Sorting improvements - now sorts by time metadata field
[pyTivo/wmcbrine/lucasnz.git] / plugins / video / templates / container_html.tmpl
blobd2b05b7bbf0bd687907e3d6f137ed16fa6461ce2
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <title>pyTivo - Push</title>
6 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
7 <link rel="stylesheet" type="text/css" href="/main.css">
8 </head>
9 <body>
10 #set $folders = $name.split('/')
11 <form action="/TiVoConnect" method="POST">
12 <script language="JavaScript">
13 <!--
14 function toggle(source) {
15         var checkboxes = document.getElementsByName('File');
16         for (var i = 0; i < checkboxes.length; i++) {
17                 if (typeof(checkboxes[i].checked) != "undefined") {
18                         checkboxes[i].checked = source.checked;
19                         }
20         }
22 -->
23 </script>
24 <p id="titlep"><span id="title">
25 <a href="/">pyTivo</a> /
26 #if len($folders) > 1
27 <a href="/TiVoConnect?Command=QueryContainer&amp;Container=$quote($folders[0])&amp;Format=text/html">
28 #end if
29 Push from $folders[0]
30 #if len($folders) > 1
31 </a>
32   #if len($folders) > 2
33     #for $pos, $n in enumerate($folders[1:-1])
34       #set $ppath = '/'.join($folders[:$pos + 2])
35 / <a href="/TiVoConnect?Command=QueryContainer&amp;Container=$quote($ppath)&amp;Format=text/html">$n</a>
36     #end for
37   #end if
38 / $folders[-1]
39 #end if
40 </span></p>
41 <table id="main">
42   ## Header Row
43         <tr class="header">
44         #set $arrowicon = 'updownarrow'
45         #set sortorder = 'Normal'
46         #if $sortby == '!normal'
47             #set $arrowicon = 'downarrow'
48         #end if
49         #if $sortby == 'normal'
50             #set sortorder = '!Normal'
51             #set $arrowicon = 'uparrow'
52         #end if
53         <td class="$arrowicon" onclick="document.location.href = '/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)&amp;SortOrder=$quote($sortorder)&amp;Format=text/html';">
54             <span class="icon" style="float:left;"><input type="checkbox" name="selectAll" onClick="toggle(this)" Title="Select All" /></span>
55             <span class="prog"><a href='/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)&amp;SortOrder=$quote($sortorder)&amp;Format=text/html'>Title</a></span>
56         </td>
57                 <td class="progsizeheader">Size</td>
58         #set $arrowicon = 'updownarrow'
59         #set sortorder = 'CaptureDate'
60         #if $sortby == '!capturedate'
61             #set $arrowicon = 'downarrow'
62         #end if
63         #if $sortby == 'capturedate'
64             #set $sortorder = '!CaptureDate'
65             #set $arrowicon = 'uparrow'
66         #end if
67                 <td class="$arrowicon" onclick="document.location.href = '/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)&amp;SortOrder=$quote($sortorder)&amp;Format=text/html';">
68             <a href='/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)&amp;SortOrder=$quote($sortorder)&amp;Format=text/html'>Capture Date</a>
69         </td>
70         </tr>
71   #set $i = 0
72   ## i variable is used to alternate colors of row
73   ## loop through passed data printing row for each show or folder
74   #for $video in $videos
75           #set $i += 1
76           #set $j = $i%2
77           #if $video.is_dir
78         ## This is a folder
79         <tr class="row$(j) pointer" onclick="document.location.href = '/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)/$quote($video.name)&amp;Format=text/html';">
80                 <td class="progmain">
81             <span class="icon"><img src="/folder.png" alt=""></span>
82             <span><a href="/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)/$quote($video.name)&amp;Format=text/html">$video.title</a></span>
83         </td>
84                 <td class="progsize">$video.total_items Items</td>
85                 <td class="progdate">$video.textDate</td>
86           #else
87             ## This is a show
88         <tr class="row$(j)">
89                 <td class="progmain">
90             <span class="icon"><input type="checkbox" name="File" value="$video.part_path"></span>
91                         #if $video.episodeTitle
92                         <span class="progtitle">$video.title: $video.episodeTitle</span><br>
93                         #else
94                         <span class="progtitle">$video.title</span><br>
95                         #end if
96                         <span class="icon"></span>
97             <span class="progdesc">
98             #if $video.description
99                         $video.description
100                         #end if
101                         #if $video.displayMajorNumber and $video.callsign
102                         $video.displayMajorNumber $video.callsign
103                         #end if
104                         </span>
105                 </td>
106                 <td class="progsize">$video.textSize</td>
107                 <td class="progdate">$video.textDate</td>
108           #end if
109           </tr>
110   #end for
111 </table>
113       <input type="hidden" name="Command" value="Push">
114       <input type="hidden" name="Container" value="$name">
115         <select name="tsn">
116         #for $tivo in $tivos
117             #if 'name' in $tivos[$tivo] and not $tivo.startswith('{')
118                 <option>$tivos[$tivo]['name']</option>
119             #end if
120         #end for
121         #for $tivo in $tivos
122             #if not 'name' in $tivos[$tivo] and not $tivo.startswith('{')
123                 <option>$tivo</option>
124             #end if
125         #end for
126         </select>
127       <input value="Send to TiVo" type="submit">
128 </p>
129 </form>
130 </body>
131 </html>