Resolved issues with mobile templates after updates in wmcbrines fork.
[pyTivo/wmcbrine/lucasnz.git] / plugins / togo / templates / npl_mob.tmpl
blobd0246eac7b36b2a5e89b1bfc16d163feccecdc54
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 - ToGo</title>
6 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
7 <link rel="stylesheet" type="text/css" href="/main_mob.css">
8 </head>
9 <body>
10 #set $folders = $title.split('/')[1:]
11 <form action="/TiVoConnect" method="POST">
12 <script language="JavaScript">
13 <!--
14 function toggle(source) {
15         var checkboxes = document.getElementsByName('Url');
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="title"><a id="titleA" href="/">pyTiVo</a></p>
25 <table id="main">
26   ## Header Row
27     <tr id="header">
28     <td colspan="2">
29   #if $folder != ''
30 <a href="/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;TiVo=$tivoIP">
31   #end if
32 Pull from $tname
33   #if $folder != ''
34 </a> /
35     #if '/' in $title
36       #set $folders = $title.split('/')[1:]
37       #for $f in $folders[:-1]
38         $f /
39       #end for
40       $folders[-1]
41     #else
42       $title
43     #end if
44   #end if
45     </td>
46     <td><input type="checkbox" name="selectAll" onClick="toggle(this)" Title="Select All" /></td>
47     </tr>
48   #set $i = 0
49   ## i variable is used to alternate colors of row
50   ## loop through passed data printing row for each show or folder
51   #for $row in $data
52           #set $i += 1
53           #set $j = $i%2
54           <tr class="row$(j)">
55           #if $row['ContentType'].startswith('x-tivo-container')
56             ## This is a folder
57                 <td id="ColA"><a href='/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;Folder=$quote(row["Url"])&amp;TiVo=$tivoIP'>$row['Title'] </a></td>
58                 <td id="ColB"><div id="count">$(row["TotalItems"])</div></td>
59                 <td id="ColC"><img src="/iphonearrow.png" alt=""></td>
60                 #else
61             ## This is a show
62                 <td id="ColA">
63                         #if 'episodeTitle' in $row
64                         <span class="progtitle">$row['title']: $row['episodeTitle']</span>
65                         #else
66                         <span class="progtitle">$row['title']</span>
67                         #end if
68                         <span class="progdesc">'
69                         #if 'description' in $row
70                         $row['description']
71                         #end if
72                         #if 'displayMajorNumber' in $row and 'callsign' in $row
73                         $row['displayMajorNumber'] $row['callsign']
74                         #end if
75                         </span>
76                         <span class="rectxt">Recorded on </span>
77                         <span class="recdate">$row['CaptureDate']</span>
78                         #if 'Url' in $row and row['Url'] in $status
79                                 #set $this_status = $status[$row['Url']]
80                                 #if $this_status['running'] and $this_status['rate'] != ""
81                                         <div class="transferring">
82                                         #set $gb = '%.3f GB' % (float($this_status['size']) / (1024 ** 3))
83                                         Transfering - $this_status['rate']<br>$gb
84                                         <a href="/TiVoConnect?Command=ToGoStop&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])">Stop Transfer</a>
85                                         </div>
86                                 #elif $this_status['running'] and $this_status['rate'] == ""
87                                         <div class="transferring">
88                                         Initiating Transfer<br>
89                                         Please Wait
90                                         </div>
91                                 #elif $this_status['error']
92                                         <div class="failed">
93                                         Error - $this_status['error']<br>
94                                         </div>
95                                 #elif $this_status['finished']
96                                         <div>
97                                         Transfer Complete
98                                         </div>
99                                 #elif $this_status['queued']
100                                         <div class="queued">
101                                         Queued: $queue.index($row['Url'])<br>
102                                         <a href="/TiVoConnect?Command=Unqueue&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP">Unqueue</a>
103                                         </div>
104                                 #end if
105                         #end if
106                 </td>
107                 <td id="ColB">
108                 #if 'CopyProtected' in $row and $row['CopyProtected'] == 'Yes'
109                         <img src="/nocopy.png" alt="">
110                 #elif 'Icon' in $row
111                     <!-- Display icons similar to TiVo colored circles -->
112                         #if $row['Icon'] == 'urn:tivo:image:expires-soon-recording'
113                                 <img src="/soon.png" alt="">
114                         #else if $row['Icon'] == 'urn:tivo:image:expired-recording'
115                                 <img src="/expired.png" alt="">
116                         #else if $row['Icon'] == 'urn:tivo:image:save-until-i-delete-recording'
117                                 <img src="/kuid.png" alt="">
118                         #else if $row['Icon'] == 'urn:tivo:image:in-progress-recording'
119                                 <img src="/recording.png" alt="">
120                         #end if
121                 #end if
122                 </td>
123                 <td id="ColC">
124                 #if 'Url' in $row and not ($row['Url'] in $status and ($status[$row['Url']]['running'] or $status[$row['Url']]['queued'])) and not ('CopyProtected' in $row and $row['CopyProtected'] == 'Yes') and not ('Icon' in $row and $row['Icon'] == 'urn:tivo:image:in-progress-recording')
125                         <input type="checkbox" name="Url" value="$row['Url']">
126                 #end if
127                 </td>
128           #end if
129           </tr>
130   #end for
131   #if ($TotalItems - $ItemCount) > ($ItemStart + 1)
132      <tr><td colspan="3">
133      #set $Offset = $shows_per_page - 1
134      <a href="/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;TiVo=$tivoIP&amp;AnchorItem=$FirstAnchor&amp;AnchorOffset=$Offset&amp;Folder=$quote($folder)">Next Page</a>
135      </td></tr>
136   #end if
137 </table>
138 <p id="title">
139  <input type="hidden" name="Command" value="ToGo">
140  <input type="hidden" name="Container" value="$container">
141  <input type="hidden" name="TiVo" value="$tivoIP">
142  <input type="checkbox" checked name="save">Metadata<br>
143 #if $togo_mpegts
144  <input type="checkbox" checked name="ts_format">Transfer as mpeg-ts<br>
145 #end if
146 </p>
147 <div id="pushmenu">
148 #if $has_tivodecode
149  <input type="checkbox" checked name="decode">Decrypt
150 #end if
151  <input style="font-size:16px" value="Transfer" type="submit">
152 </div>
153 </form>
154 </body>
155 </html>