SickGear/gui/slick/interfaces/default/manage_backlogOverview.tmpl

124 lines
4.4 KiB
Cheetah

#import sickbeard
#import datetime
#from sickbeard.common import *
#from sickbeard import sbdatetime, network_timezones
##
#set global $title = 'Backlog Overview'
#set global $header = 'Backlog Overview'
#set global $sbPath = '..'
#set global $topmenu = 'manage'
#set global $page_body_attr = 'backlog'
##
#import os.path
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
<script type="text/javascript">
<!--
\$(document).ready(function()
{
\$('#pickShow').change(function(){
var id = \$(this).val();
if (id) {
\$('html,body').animate({scrollTop: \$('#show-' + id).offset().top -25},'slow');
}
});
#set $fuzzydate = 'airdate'
#if $sickbeard.FUZZY_DATING:
fuzzyMoment({
containerClass: '.${fuzzydate}',
dateHasTime: !1,
dateFormat: '${sickbeard.DATE_PRESET}',
timeFormat: '${sickbeard.TIME_PRESET}',
trimZero: #echo ('!1', '!0')[$sickbeard.TRIM_ZERO]#
});
#end if
});
//-->
</script>
<div id="content960">
##
#if $varExists('header')
<h1 class="header">$header</h1>
#else
<h1 class="title">$title</h1>
#end if
##
#set $totalWanted = 0
#set $totalQual = 0
#for $curShow in $sickbeard.showList
#set $totalWanted += $showCounts[$curShow.indexerid][$Overview.WANTED]
#set $totalQual += $showCounts[$curShow.indexerid][$Overview.QUAL]
#end for
##
<div class="h2footer pull-right">
<span class="listing-key wanted">Wanted: <b>$totalWanted</b></span>
<span class="listing-key qual">Low Quality: <b>$totalQual</b></span>
</div>
<br/>
#if not $totalWanted
<h3>no shows require a <span class="grey-text">backlog search</span></h3>
#else
<div class="pull-left">
Jump to Show
<select id="pickShow" class="form-control form-control-inline input-sm">
#for $curShow in sorted($sickbeard.showList, key = operator.attrgetter('name')):
#if 0 != $showCounts[$curShow.indexerid][$Overview.QUAL] + $showCounts[$curShow.indexerid][$Overview.WANTED]:
<option value="$curShow.indexerid">$curShow.name</option>
#end if
#end for
</select>
</div>
#end if
<table class="sickbeardTable" border="0">
#for $curShow in sorted($sickbeard.showList, key = operator.attrgetter('name')):
##
#if 0 == $showCounts[$curShow.indexerid][$Overview.QUAL] + $showCounts[$curShow.indexerid][$Overview.WANTED]:
#continue
#end if
<tr class="seasonheader" id="show-$curShow.indexerid">
<td colspan="3" class="text-left">
<br/>
<h2><a href="$sbRoot/home/displayShow?show=$curShow.indexerid">$curShow.name</a></h2>
<div class="pull-right">
<span class="listing-key wanted">Wanted: <b>$showCounts[$curShow.indexerid][$Overview.WANTED]</b></span>
<span class="listing-key qual">Low Quality: <b>$showCounts[$curShow.indexerid][$Overview.QUAL]</b></span>
#if not $curShow.paused:
<a class="btn btn-inline forceBacklog" href="$sbRoot/manage/backlogShow?indexer_id=$curShow.indexerid"><i class="sgicon-play"></i> Force Backlog</a>
#else
<span class="quality SD btn-inline forceBacklog" style="padding:4px 10px; margin-bottom:1px"><i class="sgicon-pause"></i> Paused</span>
#end if
</div>
</td>
</tr>
<tr class="seasoncols"><th style="width:10%">Episode</th><th class="text-left">Name</th><th class="text-nowrap">Airdate</th></tr>
##
#for $curResult in $showSQLResults[$curShow.indexerid]:
#set $whichStr = '%sx%s' % ($str($curResult['season']), $str($curResult['episode']))
#try:
#set $overview = $showCats[$curShow.indexerid][$whichStr]
#except Exception
#continue
#end try
##
#if $overview in ($Overview.QUAL, $Overview.WANTED)
#
<tr class="seasonstyle $Overview.overviewStrings[$showCats[$curShow.indexerid][$whichStr]]">
<td>$whichStr</td>
<td class="text-left">$curResult['name']</td>
<td class="text-nowrap"><div class="${fuzzydate}">#if 1 == int($curResult['airdate']) then 'never' else $sbdatetime.sbdatetime.sbfdate($sbdatetime.sbdatetime.convert_to_setting($network_timezones.parse_date_time($curResult['airdate'], $curShow.airs,$curShow.network)))#</div></td>
</tr>
#
#end if
#end for
#end for
</table>
</div>
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')