Validate better.
[pyTivo/TheBayer.git] / plugins / togo / templates / npl.tmpl
blob83f3d9d2498afdf424de601388efa0c5afb4b57e
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
2 <html>\r
3 <head>\r
4   <meta content="text/html; charset=UTF-8" http-equiv="content-type">\r
5   <title>pyTivo - ToGo</title>\r
6 </head>\r
7 <body style="background-color: rgb(250, 250, 250);">\r
8 \r
9 #set $tname = $tivoIP\r
10 #for $tsn in $tivos\r
11     #if $tivoIP == $tivos[$tsn]\r
12         #set $tname = $tivo_names[$tsn]\r
13     #end if\r
14 #end for\r
15 <p align="center"><font size="6">pyTivo - ToGo - $tname</font></p>\r
16 <table style="border: 1px solid rgb(220, 220, 220);background-color: rgb(255, 255, 255);text-align: left;" border="0" cellpadding="0" cellspacing="4">\r
17   <tbody>\r
18     <tr>\r
19       <td>\r
20       <div>\r
21                   #if $ItemStart > 0\r
22                         #set $Offset = -($ItemStart + 1)\r
23                         #if $Offset < -($shows_per_page+1)\r
24                            #set $Offset = -($shows_per_page+1)\r
25                         #end if\r
26                         <a href="/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;TiVo=$tivoIP&amp;AnchorItem=$FirstAnchor&amp;AnchorOffset=$Offset&amp;Folder=$folder">Previous Page</a>\r
27                   #end if\r
28                   <table>\r
29                   #if $folder != ''\r
30                         <!-- We are in a subfolder, offer the option to return to NPL -->\r
31                         <tr><td colspan=5><a href="/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;TiVo=$tivoIP">Back to Now Playing List</a></td></tr>\r
32                   #end if\r
33                   #set $i = 0\r
34                   <!-- i variable is used to alternate colors of row -->\r
35                   <!-- loop through passed data printing row for each show or folder -->\r
36                   #for $row in $data\r
37                           #set $i += 1\r
38                           #if $i%2\r
39                                 <tr style="background-color: rgb(240, 240, 240);">\r
40                           #else\r
41                                 <tr>\r
42                           #end if\r
43                           #if $row['ContentType'] == 'x-tivo-container/folder'\r
44                             <!-- This is a folder -->\r
45                                 <td></td>\r
46                                 <td><a href='/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;Folder=$(row["UniqueId"])&amp;TiVo=$tivoIP'>$row['Title'] </a></td>\r
47                                 <td NOWRAP align="center">$(row["TotalItems"]) Items</td>\r
48                                 <td NOWRAP align="center">$row["LastChangeDate"]</td>\r
49                                 <td></td>\r
50                           #else\r
51                             <!-- This is a show -->\r
52                                 #if 'Icon' in $row\r
53                                     <!-- Display small table with color similar to TiVo colored circles -->\r
54                                         #if $row['Icon'] == 'urn:tivo:image:expires-soon-recording'\r
55                                                 <td><table><tr><td height=18 width=8 bgcolor='yellow'> </td></tr></table></td>\r
56                                         #else if $row['Icon'] == 'urn:tivo:image:expired-recording'\r
57                                                 <td><table><tr><td height=18 width=8 bgcolor='yellow'><b> ! </b></td></tr></table></td>\r
58                                         #else if $row['Icon'] == 'urn:tivo:image:save-until-i-delete-recording'\r
59                                                 <td><table><tr><td height=18 width=8 bgcolor='green'></td></tr></table></td>                            \r
60                                         #else\r
61                                                 <td width=8></td>\r
62                                         #end if\r
63                                 #else\r
64                                     <!-- No Icon listed in XML sheet -->\r
65                                         <td width=4></td>\r
66                                 #end if\r
67                                 <td width="*">\r
68                                         #if 'episodeTitle' in $row\r
69                                         <b>$row['title']: $row['episodeTitle']</b><br>\r
70                                         #else\r
71                                         <b>$row['title']</b><br>\r
72                                         #end if\r
73                                         <small>#if 'description' in $row\r
74                                         $row['description']\r
75                                         #end if\r
76                                         #if 'displayMajorNumber' in $row and 'callsign' in $row\r
77                                         $row['displayMajorNumber'] $row['callsign']\r
78                                         #end if\r
79                                         </small>\r
80                                 </td>\r
81                                 <td NOWRAP align="center">$row['SourceSize'] <br>\r
82                                 $row['Duration']\r
83                                 </td>\r
84                                 <td NOWRAP align="center">$row['CaptureDate']</td>\r
85                                 #if 'CopyProtected' in $row and $row['CopyProtected'] == 'Yes'\r
86                                         <td>CopyProtected</td>\r
87                                 #else if 'Url' in $row\r
88                                         <td NOWRAP>\r
89                                         #if $row['Url'] in $status\r
90                                                 #set $this_status = $status[$row['Url']]\r
91                                                 #if $this_status['running'] and $this_status['rate'] != ""\r
92                                                         #set $gb = '%.3f GB' % (float($this_status['size']) / (1024 ** 3))\r
93                                                         Transfering - $this_status['rate'] KB/s<br>$gb\r
94                                                         <a href="/TiVoConnect?Command=ToGoStop&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=NPL">Stop Transfer</a>\r
95                                                 #elif $this_status['running'] and $this_status['rate'] == ""\r
96                                                         Initiating Transfer.<br>\r
97                                                         Please Wait\r
98                                                 #elif $this_status['error']\r
99                                                         Error - $this_status['error']<br>\r
100                                                         <a href="/TiVoConnect?Command=ToGo&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=NPL">Try Transfer Again.</a>\r
101                                                 #elif $this_status['finished']\r
102                                                         Transfer Complete\r
103                                                 #else\r
104                                                         Transfer Stopped<br>\r
105                                                         <a href="/TiVoConnect?Command=ToGo&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=NPL">Try Transfer Again.</a>\r
106                                                 #end if\r
107                                         #else\r
108                                                 <a href="/TiVoConnect?Command=ToGo&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=NPL">Transfer This.</a>\r
109                                         #end if\r
110                                         </td>\r
111                                 #else\r
112                                     <!-- No URL was in links url in XML -->\r
113                                         <td></td>\r
114                                 #end if\r
115                           #end if\r
116                           </tr>\r
117                   #end for\r
118                   </table>\r
119                   #if ($TotalItems - $ItemCount) > ($ItemStart + 1)\r
120                      #set $Offset = $shows_per_page - 1\r
121                      <a href="/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;TiVo=$tivoIP&amp;AnchorItem=$FirstAnchor&amp;AnchorOffset=$Offset&amp;Folder=$folder">Next Page</a>\r
122                   #end if\r
123       </div>\r
124       </td>\r
125     </tr>\r
126   </tbody>\r
127 </table>\r
128 </body>\r
129 </html>\r