-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
history.tmpl
118 lines (112 loc) · 5.12 KB
/
history.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#import sickbeard
#import os.path
#import datetime
#import re
#from sickbeard import history
#from sickbeard import providers
#from sickbeard.providers import generic
#from sickbeard.common import *
#set global $title="History"
#set global $sbPath=".."
#set global $topmenu="history"#
#include $os.path.join($sickbeard.PROG_DIR, "data/interfaces/default/inc_top.tmpl")
<script type="text/javascript">
<!--
\$(document).ready(function() {
\$("#historyTable:has(tbody tr)").tablesorter({
widgets: ['zebra', 'stickyHeaders', 'filter'],
sortList: [[1,1]],
sortLocaleCompare : true,
headers: {
1: { sorter: "text" }
},
textExtraction: {
0: function(node) { if (\$("img[title]", node).length > 0) {
return \$("img[title]", node).eq(0).attr("title");
} else {
return \$(node).text();
}
},
4: function(node) { if (\$("img[alt]", node).length > 0) {
return \$("img[alt]", node).eq(0).attr("alt");
} else {
return \$(node).text();
}
},
5: function(node) { return \$(node).find("span").text().toLowerCase(); }
},
widgetOptions : {
filter_useParsedData : true,
filter_defaultFilter : { 2 : '/{query}/' }
}
});
\$('#limit').change(function(){
url = '$sbRoot/history/?limit=' + \$(this).val()
window.location.href = url
});
});
//-->
</script>
<div class="h2footer align-right"><b>Limit:</b>
<select name="limit" id="limit">
<option value="100" #if $limit == "100" then "selected=\"selected\"" else ""#>100</option>
<option value="250" #if $limit == "250" then "selected=\"selected\"" else ""#>250</option>
<option value="500" #if $limit == "500" then "selected=\"selected\"" else ""#>500</option>
<option value="1000" #if $limit == "1000" then "selected=\"selected\"" else ""#>1000</option>
<option value="0" #if $limit == "0" then "selected=\"selected\"" else ""#>All</option>
</select>
</div><br/>
<table id="historyTable" class="tablesorter" cellspacing="1" border="0" cellpadding="0">
<thead><tr><th class="col-src">Src</th><th class="col-time">Time</th><th>Episode</th><th class="col-action">Action</th><th>Provider</th><th>Quality</th></tr></thead>
<tbody>
#for $hItem in $historyResults:
#set $curStatus, $curQuality = $Quality.splitCompositeStatus(int($hItem["action"]))
<tr>
<td class="col-src">
#if $hItem["source"]:
<img src="$sbRoot/images/${hItem["source"]}.png" width="16" height="16" alt="$hItem["source"]" title="$hItem["source"]" />
#else:
$hItem["source"]
#end if
</td>
<td class="col-time">$datetime.datetime.strptime(str($hItem["date"]), $history.dateFormat)</td>
<td><a href="$sbRoot/home/displayShow?show=$hItem["showid"]#season-$hItem["season"]">$hItem["show_name"] - <%=str(hItem["season"]) + "x" + "%02i" % int(hItem["episode"]) %></a></td>
<td class="col-action">$statusStrings[$curStatus]</td>
<td align="center">
#if $curStatus == DOWNLOADED and $str($hItem["provider"]) == '-1':
#set $match = $re.search("\-(\w+)\.\w{3}\Z", $os.path.basename($hItem["resource"]))
#if $match:
#if $match.group(1).upper() in ("X264", "720P"):
#set $match = $re.search("(\w+)\-.*\-" + $match.group(1) + "\.\w{3}\Z", $os.path.basename($hItem["resource"]), re.IGNORECASE)
#if $match:
$match.group(1).upper()
#end if
#else:
$match.group(1).upper()
#end if
#end if
#elif $curStatus == DOWNLOADED:
$hItem["provider"]
#else:
#if $hItem["provider"] and $len($hItem["provider"]) > 0:
#set provider_id = $generic.GenericProvider.makeID($hItem["provider"])
#set $provider = $providers.getProviderClass($provider_id)
#if $provider is not None:
#set image_name = provider.imageName()
#else:
#if $hItem["provider"] in ["Bin-Req", "TVBinz", "NZBs.org Old", "NZBMatrix", "NZBs'R'US", "Newzbin", "nzbX"]:
#set image_name = $provider_id + '.png'
#else:
#set image_name = 'missing.png'
#end if
#end if
<img src="$sbRoot/images/providers/$image_name" width="16" height="16" alt="$hItem["provider"]" title="$hItem["provider"]"/>
#end if
#end if
</td>
<td align="center"><span class="quality $Quality.qualityStrings[$curQuality].replace("720p","HD720p").replace("1080p","HD1080p").replace("RawHD TV", "RawHD").replace("HD TV", "HD720p")">$Quality.qualityStrings[$curQuality]</span></td>
</tr>
#end for
</tbody>
</table>
#include $os.path.join($sickbeard.PROG_DIR, "data/interfaces/default/inc_bottom.tmpl")