Icons by Eric von Bayer.
[pyTivo/TheBayer.git] / plugins / togo / templates / npl.tmpl
blobcf839895cfe676294a957862c6a571173d1c4944
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\r
2 "http://www.w3.org/TR/html4/loose.dtd">\r
3 <html>\r
4 <head>\r
5 <meta content="text/html; charset=UTF-8" http-equiv="content-type">\r
6 <title>pyTivo - ToGo</title>\r
7 <style type="text/css">\r
8 \r
9 body {\r
10     background-color: rgb(250, 250, 250)\r
11 }\r
13 tr.row1 {\r
14     background-color: rgb(240, 240, 240)\r
15 }\r
17 span#title {\r
18     font-size: xx-large\r
19 }\r
21 table#main {\r
22     border: 1px solid rgb(220, 220, 220);\r
23     background-color: rgb(255, 255, 255)\r
24 }\r
26 td.unbreak {\r
27     white-space: nowrap;\r
28     text-align: center\r
29 }\r
31 </style>\r
32 </head>\r
33 <body>\r
35 #set $tname = $tivoIP\r
36 #for $tsn in $tivos\r
37     #if $tivoIP == $tivos[$tsn]\r
38         #set $tname = $tivo_names[$tsn]\r
39     #end if\r
40 #end for\r
41 <p style="text-align: center"><span id="title">pyTivo - ToGo - $tname</span></p>\r
42 <table id="main" border="0" cellpadding="0" cellspacing="4">\r
43     <tr>\r
44       <td>\r
45       <div>\r
46                   #if $ItemStart > 0\r
47                         #set $Offset = -($ItemStart + 1)\r
48                         #if $Offset < -($shows_per_page+1)\r
49                            #set $Offset = -($shows_per_page+1)\r
50                         #end if\r
51                         <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
52                   #end if\r
53                   <table>\r
54                   #if $folder != ''\r
55                         ## We are in a subfolder, offer the option to return to NPL\r
56                         <tr>\r
57                                 <td><img src="/plugin/togo/content/Back.png"></td>\r
58                                 <td colspan=4><a href="/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;TiVo=$tivoIP">Back to Now Playing List</a></td>\r
59                         </tr>\r
60                   #end if\r
61                   #set $i = 0\r
62                   ## i variable is used to alternate colors of row\r
63                   ## loop through passed data printing row for each show or folder\r
64                   #for $row in $data\r
65                           #set $i += 1\r
66                           #set $j = $i%2\r
67                           <tr class="row$(j)">\r
68                           #if $row['ContentType'] == 'x-tivo-container/folder'\r
69                             ## This is a folder\r
70                                 <td><image src="/plugin/togo/content/Folder.png" border=0></td>\r
71                                 <td><a href='/TiVoConnect?Command=NPL&amp;Container=$quote($container)&amp;Folder=$(row["UniqueId"])&amp;TiVo=$tivoIP'>$row['Title'] </a></td>\r
72                                 <td class="unbreak">$(row["TotalItems"]) Items</td>\r
73                                 <td class="unbreak">$row["LastChangeDate"]</td>\r
74                                 <td></td>\r
75                           #else\r
76                             ## This is a show\r
77                                 #if 'Icon' in $row\r
78                                     <!-- Display icons similar to TiVo colored circles -->\r
79                                         #if $row['Icon'] == 'urn:tivo:image:expires-soon-recording'\r
80                                                 <td><image src="/plugin/togo/content/Y.png" border=0></td>\r
81                                         #else if $row['Icon'] == 'urn:tivo:image:expired-recording'\r
82                                                 <td><image src="/plugin/togo/content/YE.png" border=0></td>\r
83                                         #else if $row['Icon'] == 'urn:tivo:image:save-until-i-delete-recording'\r
84                                                 <td><image src="/plugin/togo/content/G.png" border=0></td>\r
85                                         #else if $row['Icon'] == 'urn:tivo:image:in-progress-recording'\r
86                                                 <td><image src="/plugin/togo/content/R.png" border=0></td>\r
87                                         #else\r
88                                                 <td width="8"></td>\r
89                                         #end if\r
90                                 #else\r
91                                     ## No Icon listed in XML sheet\r
92                                         <td width="4"></td>\r
93                                 #end if\r
94                                 <td width="*">\r
95                                         #if 'episodeTitle' in $row\r
96                                         <b>$row['title']: $row['episodeTitle']</b><br>\r
97                                         #else\r
98                                         <b>$row['title']</b><br>\r
99                                         #end if\r
100                                         <small>#if 'description' in $row\r
101                                         $row['description']\r
102                                         #end if\r
103                                         #if 'displayMajorNumber' in $row and 'callsign' in $row\r
104                                         $row['displayMajorNumber'] $row['callsign']\r
105                                         #end if\r
106                                         </small>\r
107                                 </td>\r
108                                 <td class="unbreak">$row['SourceSize'] <br>\r
109                                 $row['Duration']\r
110                                 </td>\r
111                                 <td class="unbreak">$row['CaptureDate']</td>\r
112                                 #if 'CopyProtected' in $row and $row['CopyProtected'] == 'Yes'\r
113                                         <td class="unbreak">Copy&nbsp;Protected</td>\r
114                                 #else if 'Url' in $row\r
115                                         <td class="unbreak">\r
116                                         #if $row['Url'] in $status\r
117                                                 #set $this_status = $status[$row['Url']]\r
118                                                 #if $this_status['running'] and $this_status['rate'] != ""\r
119                                                         #set $gb = '%.3f GB' % (float($this_status['size']) / (1024 ** 3))\r
120                                                         Transfering - $this_status['rate'] KB/s<br>$gb\r
121                                                         <a href="/TiVoConnect?Command=ToGoStop&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=$quote($my_url)">Stop Transfer</a>\r
122                                                 #elif $this_status['running'] and $this_status['rate'] == ""\r
123                                                         Initiating Transfer<br>\r
124                                                         Please Wait\r
125                                                 #elif $this_status['error']\r
126                                                         Error - $this_status['error']<br>\r
127                                                         <a href="/TiVoConnect?Command=ToGo&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=$quote($my_url)">Try Transfer Again</a>\r
128                                                 #elif $this_status['finished']\r
129                                                         Transfer Complete\r
130                                                 #else\r
131                                                         Transfer Stopped<br>\r
132                                                         <a href="/TiVoConnect?Command=ToGo&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=$quote($my_url)">Try Transfer Again</a>\r
133                                                 #end if\r
134                                         #else\r
135                                                 <a href="/TiVoConnect?Command=ToGo&amp;Container=$quote($container)&amp;Url=$quote($row['Url'])&amp;TiVo=$tivoIP&amp;Redirect=$quote($my_url)">Transfer This</a>\r
136                                         #end if\r
137                                         </td>\r
138                                 #else\r
139                                     ## No URL was in links url in XML\r
140                                         <td></td>\r
141                                 #end if\r
142                           #end if\r
143                           </tr>\r
144                   #end for\r
145                   </table>\r
146                   #if ($TotalItems - $ItemCount) > ($ItemStart + 1)\r
147                      #set $Offset = $shows_per_page - 1\r
148                      <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
149                   #end if\r
150       </div>\r
151       </td>\r
152     </tr>\r
153 </table>\r
154 </body>\r
155 </html>\r