2014-03-10 05:18:05 +00:00
#import sickbeard
#import datetime
#from sickbeard . common import *
#from sickbeard import sbdatetime
2014-11-09 02:49:38 +00:00
#from sickbeard . helpers import anon_url
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
#set global $ title = ' Coming Episodes '
#set global $ header = ' Coming Episodes '
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
#set global $ sbPath = ' .. '
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
#set global $ topmenu = ' comingEpisodes '
2014-03-10 05:18:05 +00:00
#import os . path
2014-11-09 02:49:38 +00:00
#include $ os . path . join ( $ sickbeard . PROG_DIR , ' gui/slick/interfaces/default/inc_top.tmpl ' )
2014-03-10 05:18:05 +00:00
#set $ sort = $ sickbeard . COMING_EPS_SORT
<script type="text/javascript" src=" $ sbRoot /js/ajaxEpSearch.js? $ sbPID "></script>
2014-11-09 02:49:38 +00:00
#if $ varExists ( ' header ' )
2014-03-10 05:18:05 +00:00
<h1 class="header"> $ header </h1>
2014-11-09 02:49:38 +00:00
#else
2014-03-10 05:18:05 +00:00
<h1 class="title"> $ title </h1>
#end if
<style type="text/css">
2014-11-09 02:49:38 +00:00
#SubMenu { display : none }
#contentWrapper { padding - top : 30 px }
2014-03-10 05:18:05 +00:00
</style>
2014-10-21 19:09:01 +00:00
<div class="h2footer pull-right">
2014-11-09 02:49:38 +00:00
<span>Layout:
2014-10-21 19:09:01 +00:00
<select name="layout" class="form-control form-control-inline input-sm" onchange="location = this.options[this.selectedIndex].value;">
2014-11-09 02:49:38 +00:00
<option value=" $ sbRoot /setComingEpsLayout/?layout=poster" #if ' poster ' == $ sickbeard . COMING_EPS_LAYOUT then ' selected= " selected " ' else ' ' # >Poster</option>
<option value=" $ sbRoot /setComingEpsLayout/?layout=calendar" #if ' calendar ' == $ sickbeard . COMING_EPS_LAYOUT then ' selected= " selected " ' else ' ' # >Calendar</option>
<option value=" $ sbRoot /setComingEpsLayout/?layout=banner" #if ' banner ' == $ sickbeard . COMING_EPS_LAYOUT then ' selected= " selected " ' else ' ' # >Banner</option>
<option value=" $ sbRoot /setComingEpsLayout/?layout=list" #if ' list ' == $ sickbeard . COMING_EPS_LAYOUT then ' selected= " selected " ' else ' ' # >List</option>
2014-10-21 19:09:01 +00:00
</select>
</span>
2014-11-09 02:49:38 +00:00
<span>Sort By:
2014-10-21 19:09:01 +00:00
<select name="sort" class="form-control form-control-inline input-sm" onchange="location = this.options[this.selectedIndex].value;">
2014-11-09 02:49:38 +00:00
<option value=" $ sbRoot /setComingEpsSort/?sort=date" #if ' date ' == $ sickbeard . COMING_EPS_SORT then ' selected= " selected " ' else ' ' # >Date</option>
<option value=" $ sbRoot /setComingEpsSort/?sort=network" #if ' network ' == $ sickbeard . COMING_EPS_SORT then ' selected= " selected " ' else ' ' # >Network</option>
<option value=" $ sbRoot /setComingEpsSort/?sort=show" #if ' show ' == $ sickbeard . COMING_EPS_SORT then ' selected= " selected " ' else ' ' # >Show</option>
2014-10-21 19:09:01 +00:00
</select>
</span>
2014-11-09 02:49:38 +00:00
<span>View Paused:
2014-10-21 19:09:01 +00:00
<select name="viewpaused" class="form-control form-control-inline input-sm" onchange="location = this.options[this.selectedIndex].value;">
2014-11-05 15:53:01 +00:00
<option value=" $ sbRoot /toggleComingEpsDisplayPaused"<%= (' selected="selected"', '')[True == sickbeard.COMING_EPS_DISPLAY_PAUSED] %>>Hidden</option>
<option value=" $ sbRoot /toggleComingEpsDisplayPaused"<%= ('', ' selected="selected"')[True == sickbeard.COMING_EPS_DISPLAY_PAUSED] %>>Shown</option>
2014-10-21 19:09:01 +00:00
</select>
</span>
</div>
<div class="key pull-right">
2014-11-09 02:49:38 +00:00
#if ' calendar ' != $ layout :
<b>Key:</b>
<span class="listing-key listing-overdue">Missed</span>
<span class="listing-key listing-current">Current</span>
<span class="listing-key listing-default">Future</span>
<span class="listing-key listing-toofar">Distant</span>
2014-10-15 15:45:55 +00:00
#end if
2014-10-21 19:09:01 +00:00
<a class="btn btn-inline forceBacklog" href="webcal:// $ sbHost : $ sbHttpPort /calendar">
2014-11-09 02:49:38 +00:00
<i class="icon-calendar icon-white"></i>Subscribe</a>
2014-03-10 05:18:05 +00:00
</div>
2014-10-21 19:09:01 +00:00
<br>
2014-11-09 02:49:38 +00:00
#if ' list ' == $ layout :
2014-03-10 05:18:05 +00:00
<!-- start list view //-->
2014-11-09 02:49:38 +00:00
2014-03-10 05:18:05 +00:00
<script type="text/javascript" src=" $ sbRoot /js/plotTooltip.js? $ sbPID "></script>
<script type="text/javascript" charset="utf-8">
<!--
\$.tablesorter.addParser({
id: 'loadingNames',
is: function(s) {
2014-11-09 02:49:38 +00:00
return false
2014-03-10 05:18:05 +00:00
},
format: function(s) {
2014-11-09 02:49:38 +00:00
if (0 == s.indexOf('Loading...'))
return s.replace('Loading...', '000')
#if not $ sickbeard . SORT_ARTICLE :
2014-11-27 03:30:00 +00:00
return (s || '').replace(/^(?:(?:A(?!\s+to)n?)|The)\s(\w)/i, '$1')
2014-11-09 02:49:38 +00:00
#else :
return (s || '')
#end if
2014-03-10 05:18:05 +00:00
},
type: 'text'
});
\$.tablesorter.addParser({
id: 'quality',
is: function(s) {
2014-11-09 02:49:38 +00:00
return false
2014-03-10 05:18:05 +00:00
},
format: function(s) {
2014-11-09 02:49:38 +00:00
return s.replace('hd1080p', 5).replace('hd720p', 4).replace('hd', 3).replace('sd', 2).replace('any', 1).replace('best', 0).replace('custom', 7)
2014-03-10 05:18:05 +00:00
},
type: 'numeric'
});
\$.tablesorter.addParser({
id: 'cDate',
is: function(s) {
2014-11-09 02:49:38 +00:00
return false
2014-03-10 05:18:05 +00:00
},
format: function(s) {
2014-11-09 02:49:38 +00:00
return s
2014-03-10 05:18:05 +00:00
},
type: 'numeric'
});
\$(document).ready(function(){
#set $ sort_codes = { ' date ' : 0 , ' show ' : 1 , ' network ' : 4 }
#if $ sort not in $ sort_codes :
$ sort = 'date'
#end if
2014-11-09 02:49:38 +00:00
sortList = [[ $ sort_codes [ $ sort ], 0]];
\$(' #showListTable : has ( tbody tr ) ' ).tablesorter( {
2014-03-10 05:18:05 +00:00
widgets: ['stickyHeaders'],
sortList: sortList,
textExtraction: {
2014-11-09 02:49:38 +00:00
0: function(node) { return \$(node).find('span').text().toLowerCase() },
4: function(node) { return \$(node).find('img').attr('alt') },
5: function(node) { return \$(node).find('span').text().toLowerCase() }
2014-03-10 05:18:05 +00:00
},
headers: {
0: { sorter: 'cDate' },
1: { sorter: 'loadingNames' },
2: { sorter: false },
3: { sorter: false },
4: { sorter: 'loadingNames' },
5: { sorter: 'quality' },
6: { sorter: false },
7: { sorter: false },
8: { sorter: false }
}
});
\$(' #sbRoot ' ).ajaxEpSearch();
2014-05-23 15:20:44 +00:00
#set $ fuzzydate = ' airdate '
#if $ sickbeard . FUZZY_DATING :
fuzzyMoment({
containerClass : '. ${ fuzzydate } ',
dateHasTime : true,
dateFormat : ' ${ sickbeard . DATE_PRESET } ',
timeFormat : ' ${ sickbeard . TIME_PRESET } ',
2014-11-09 02:49:38 +00:00
trimZero : #if $ sickbeard . TRIM_ZERO then ' true ' else ' false ' #
2014-05-23 15:20:44 +00:00
});
#end if
2014-03-10 05:18:05 +00:00
});
//-->
</script>
2014-11-09 02:49:38 +00:00
#set $ show_div = ' listing-default '
2014-03-10 05:18:05 +00:00
<input type="hidden" id="sbRoot" value=" $ sbRoot " />
2014-09-30 22:20:37 +00:00
<table id="showListTable" class="sickbeardTable tablesorter seasonstyle" cellspacing="1" border="0" cellpadding="0">
2014-11-09 02:49:38 +00:00
<thead>
2014-09-30 22:20:37 +00:00
<tr>
<th>Airdate</th>
<th>Show</th>
<th class="nowrap">Next Ep</th>
<th>Next Ep Name</th>
<th>Network</th>
<th>Quality</th>
<th>Indexers</th>
<th>Search</th>
</tr>
</thead>
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
<tbody style="text-shadow:none;">
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
#for $ cur_result in $ sql_results :
#set $ cur_indexer = int ( $ cur_result [ ' indexer ' ] )
#set $ runtime = $ cur_result [ ' runtime ' ]
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
#if int ( $ cur_result [ ' paused ' ] ) and not $ sickbeard . COMING_EPS_DISPLAY_PAUSED :
#continue
#end if
2014-05-23 10:00:45 +00:00
2014-11-09 02:49:38 +00:00
#set $ cur_ep_airdate = $ cur_result [ ' localtime ' ] . date ( )
#if $ runtime :
#set $ cur_ep_enddate = $ cur_result [ ' localtime ' ] + datetime . timedelta ( minutes = $ runtime )
#if $ cur_ep_enddate < $ today :
#set $ show_div = ' listing-overdue '
#elif $ cur_ep_airdate > = $ next_week . date ( ) :
#set $ show_div = ' listing-toofar '
#elif $ cur_ep_airdate > = $ today . date ( ) and $ cur_ep_airdate < $ next_week . date ( ) :
#if $ cur_ep_airdate == $ today . date ( ) :
#set $ show_div = ' listing-current '
#else :
#set $ show_div = ' listing-default '
2014-03-10 05:18:05 +00:00
#end if
2014-05-23 10:00:45 +00:00
#end if
2014-11-09 02:49:38 +00:00
#end if
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
<!-- start $ cur_result ['show_name'] //-->
2014-09-30 22:20:37 +00:00
<tr class=" $ show_div ">
## forced to use a div to wrap airdate, the column sort went crazy with a span
<td align="center" class="nowrap">
2014-11-09 02:49:38 +00:00
<div class=" ${ fuzzydate } "> $ sbdatetime . sbdatetime . sbfdatetime ( $ cur_result ['localtime']).decode( $ sickbeard . SYS_ENCODING )</div><span class="sort_data"> $ time . mktime ( $ cur_result ['localtime'].timetuple())</span>
2014-09-30 22:20:37 +00:00
</td>
2014-11-09 02:49:38 +00:00
<td class="tvShow"><a href=" $ sbRoot /home/displayShow?show= ${ cur_result [ ' showid ' ] } "> $ cur_result ['show_name']</a>
#if int ( $ cur_result [ ' paused ' ] ) :
<span class="pause">[paused]</span>
#end if
2014-09-30 22:20:37 +00:00
</td>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<td class="nowrap" align="center">
2014-11-09 02:49:38 +00:00
<%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %>
2014-09-30 22:20:37 +00:00
</td>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<td>
2014-11-09 02:49:38 +00:00
#if $ cur_result [ ' description ' ] :
<img alt='' src=' $ sbRoot /images/info32.png' height='16' width='16' class='plotInfo' id="plot_info_<%= '%s_%s_%s' % (str(cur_result['showid']), str(cur_result['season']), str(cur_result['episode'])) %>" />
#else :
<img alt="" src=" $ sbRoot /images/info32.png" width="16" height="16" class="plotInfoNone" />
#end if
$ cur_result ['name']
2014-09-30 22:20:37 +00:00
</td>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<td align="center">
2014-11-09 02:49:38 +00:00
$ cur_result ['network']
2014-09-30 22:20:37 +00:00
</td>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<td align="center">
2014-11-09 02:49:38 +00:00
#if int ( $ cur_result [ ' quality ' ] ) in $ qualityPresets :
<span class="quality $ qualityPresetStrings [int( $ cur_result ['quality'])]"> $ qualityPresetStrings [int( $ cur_result ['quality'])]</span>
#else :
<span class="quality Custom">Custom</span>
#end if
2014-09-30 22:20:37 +00:00
</td>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<td align="center" style="vertical-align: middle;">
2014-11-09 02:49:38 +00:00
#if $ cur_result [ ' imdb_id ' ] :
<a href="<%= anon_url('http://www.imdb.com/title/', cur_result['imdb_id']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title="http://www.imdb.com/title/ ${ cur_result [ ' imdb_id ' ] } "><img alt="[imdb]" height="16" width="16" src=" $ sbRoot /images/imdb.png" />
#end if
<a href="<%= anon_url(sickbeard.indexerApi(cur_indexer).config['show_url'], cur_result['showid']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title=" $ sickbeard . indexerApi ( $ cur_indexer ).config['show_url'] ${ cur_result [ ' showid ' ] } "><img alt=" $ sickbeard . indexerApi ( $ cur_indexer ).name" height="16" width="16" src=" $ sbRoot /images/ $ sickbeard . indexerApi ( $ cur_indexer ).config['icon']" /></a>
2014-09-30 22:20:37 +00:00
</td>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<td align="center">
2014-11-09 02:49:38 +00:00
<a href=" $ sbRoot /home/searchEpisode?show= ${ cur_result [ ' showid ' ] } &season= $ cur_result ['season']&episode= $ cur_result ['episode']" title="Manual Search" id="forceUpdate- ${ cur_result [ ' showid ' ] } " class="forceUpdate epSearch"><img alt="[search]" height="16" width="16" src=" $ sbRoot /images/search16.png" id="forceUpdateImage- ${ cur_result [ ' showid ' ] } " /></a>
2014-09-30 22:20:37 +00:00
</td>
</tr>
2014-11-09 02:49:38 +00:00
<!-- end $ cur_result ['show_name'] //-->
#end for
</tbody>
2014-09-30 22:20:37 +00:00
<tfoot>
<tr>
<th rowspan="1" colspan="10" align="center"> </th>
</tr>
</tfoot>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
</table>
2014-03-10 05:18:05 +00:00
<!-- end list view //-->
2014-09-30 22:20:37 +00:00
2014-11-09 02:49:38 +00:00
2014-09-15 17:43:49 +00:00
#else if $ layout in [ ' banner ' , ' poster ' ] :
2014-09-30 22:20:37 +00:00
2014-11-09 02:49:38 +00:00
2014-03-10 05:18:05 +00:00
<!-- start non list view //-->
<script type="text/javascript" charset="utf-8">
<!--
2014-11-09 02:49:38 +00:00
\$(document).ready(function(){
2014-10-24 13:16:46 +00:00
\$(' #sbRoot ' ).ajaxEpSearch( { ' size ' : 16, ' loadingImage ' : ' loading16 ' + themeSpinner + ' . gif ' });
2014-11-09 02:49:38 +00:00
\$('.ep_summary').hide();
\$('.ep_summaryTrigger').click(function() {
\$(this).next('.ep_summary').slideToggle('normal', function() {
\$(this).prev('.ep_summaryTrigger').attr('src', function(i, src) {
return \$(this).next('.ep_summary').is(':visible') ? src.replace('plus','minus') : src.replace('minus','plus')
2014-09-30 22:20:37 +00:00
});
});
});
2014-10-14 04:13:59 +00:00
#set $ fuzzydate = ' airdate '
#if $ sickbeard . FUZZY_DATING :
fuzzyMoment({
dtInline : true,
dtGlue : ' at ',
containerClass : '. ${ fuzzydate } ',
dateHasTime : true,
dateFormat : ' ${ sickbeard . DATE_PRESET } ',
timeFormat : ' ${ sickbeard . TIME_PRESET } ',
2014-11-09 02:49:38 +00:00
trimZero : #if $ sickbeard . TRIM_ZERO then ' true ' else ' false ' #
2014-10-14 04:13:59 +00:00
});
#end if
2014-03-10 05:18:05 +00:00
});
//-->
</script>
2014-09-30 22:20:37 +00:00
#set $ cur_segment = None
#set $ too_late_header = False
#set $ missed_header = False
#set $ today_header = False
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-default '
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
#if ' show ' == $ sort :
<br /><br />
2014-09-30 22:20:37 +00:00
#end if
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
#for $ cur_result in $ sql_results :
2014-11-09 02:49:38 +00:00
#set $ cur_indexer = int ( $ cur_result [ ' indexer ' ] )
2014-03-26 04:15:10 +00:00
2014-11-09 02:49:38 +00:00
<!-- start $ cur_result ['show_name'] //-->
#if int ( $ cur_result [ ' paused ' ] ) and not $ sickbeard . COMING_EPS_DISPLAY_PAUSED :
2014-09-30 22:20:37 +00:00
#continue
#end if
2014-03-10 05:18:05 +00:00
2014-11-09 02:49:38 +00:00
#set $ runtime = $ cur_result [ ' runtime ' ]
2014-05-23 10:00:45 +00:00
2014-11-09 02:49:38 +00:00
#if ' network ' == $ sort :
2014-11-11 15:30:33 +00:00
#set $ show_network = $ cur_result [ ' network ' ] if $ cur_result [ ' network ' ] else ' no network '
#if $ cur_segment != $ show_network :
2014-09-30 22:20:37 +00:00
<div class="comingepheader">
2014-11-11 15:30:33 +00:00
<br><h2 class="network"> $ show_network </h2>
#set $ cur_segment = $ cur_result [ ' network ' ]
2014-09-30 22:20:37 +00:00
#end if
2014-11-09 02:49:38 +00:00
#set $ cur_ep_airdate = $ cur_result [ ' localtime ' ] . date ( )
2014-05-23 10:00:45 +00:00
2014-09-30 22:20:37 +00:00
#if $ runtime :
2014-11-09 02:49:38 +00:00
#set $ cur_ep_enddate = $ cur_result [ ' localtime ' ] + datetime . timedelta ( minutes = $ runtime )
2014-09-30 22:20:37 +00:00
#if $ cur_ep_enddate < $ today :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-overdue '
2014-09-30 22:20:37 +00:00
#elif $ cur_ep_airdate > = $ next_week . date ( ) :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-toofar '
2014-09-30 22:20:37 +00:00
#elif $ cur_ep_enddate > = $ today and $ cur_ep_airdate < $ next_week . date ( ) :
#if $ cur_ep_airdate == $ today . date ( ) :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-current '
2014-05-23 10:00:45 +00:00
#else :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-default '
2014-05-23 10:00:45 +00:00
#end if
2014-03-10 05:18:05 +00:00
#end if
#end if
2014-11-09 02:49:38 +00:00
#elif ' date ' == $ sort :
#set $ cur_ep_airdate = $ cur_result [ ' localtime ' ] . date ( )
2014-05-23 10:00:45 +00:00
2014-09-30 22:20:37 +00:00
#if $ cur_segment != $ cur_ep_airdate :
2014-08-22 06:26:49 +00:00
#if $ runtime :
2014-11-09 02:49:38 +00:00
#set $ cur_ep_enddate = $ cur_result [ ' localtime ' ] + datetime . timedelta ( minutes = $ runtime )
2014-09-30 22:20:37 +00:00
#if $ cur_ep_enddate < $ today and $ cur_ep_airdate != $ today . date ( ) and not $ missed_header :
2014-10-21 19:09:01 +00:00
<br /><h2 class="day">Missed</h2>
2014-09-30 22:20:37 +00:00
#set $ missed_header = True
#elif $ cur_ep_airdate > = $ next_week . date ( ) and not $ too_late_header :
2014-10-21 19:09:01 +00:00
<br /><h2 class="day">Later</h2>
2014-09-30 22:20:37 +00:00
#set $ too_late_header = True
2014-08-22 06:26:49 +00:00
#elif $ cur_ep_enddate > = $ today and $ cur_ep_airdate < $ next_week . date ( ) :
#if $ cur_ep_airdate == $ today . date ( ) :
2014-11-15 16:02:16 +00:00
<br /><h2 class="day"> $ sbdatetime . sbdatetime . sbfdate ( $ cur_ep_airdate , '%A').decode( $ sickbeard . SYS_ENCODING ).capitalize() <span style="font-size: 14px; vertical-align: top;">[Today]</span></h2>
2014-09-30 22:20:37 +00:00
#set $ today_header = True
2014-08-22 06:26:49 +00:00
#else :
2014-11-15 16:02:16 +00:00
<br /><h2 class="day"> $ sbdatetime . sbdatetime . sbfdate ( $ cur_ep_airdate , '%A').decode( $ sickbeard . SYS_ENCODING ).capitalize()</h2>
2014-08-22 06:26:49 +00:00
#end if
2014-05-23 10:00:45 +00:00
#end if
#end if
2014-09-30 22:20:37 +00:00
#set $ cur_segment = $ cur_ep_airdate
#end if
2014-11-09 02:49:38 +00:00
#if $ cur_ep_airdate == $ today . date ( ) and not $ today_header :
<div class="comingepheader">
2014-11-15 16:02:16 +00:00
<br /><h2 class="day"> $ sbdatetime . sbdatetime . sbfdate ( $ cur_ep_airdate , '%A').decode( $ sickbeard . SYS_ENCODING ).capitalize() <span style="font-size: 14px; vertical-align: top;">[Today]</span></h2>
2014-09-30 22:20:37 +00:00
#set $ today_header = True
#end if
2014-11-09 02:49:38 +00:00
#if $ runtime :
2014-11-24 00:55:00 +00:00
#set $ cur_ep_enddate = $ cur_result [ ' localtime ' ] + datetime . timedelta ( minutes = $ runtime )
2014-11-09 02:49:38 +00:00
#if $ cur_ep_enddate < $ today :
#set $ show_div = ' ep_listing listing-overdue '
#elif $ cur_ep_airdate > = $ next_week . date ( ) :
#set $ show_div = ' ep_listing listing-toofar '
#elif $ cur_ep_enddate > = $ today and $ cur_ep_airdate < $ next_week . date ( ) :
#if $ cur_ep_airdate == $ today . date ( ) :
#set $ show_div = ' ep_listing listing-current '
#else :
#set $ show_div = ' ep_listing listing-default '
#end if
#end if
#end if
#elif ' show ' == $ sort :
#set $ cur_ep_airdate = $ cur_result [ ' localtime ' ] . date ( )
2014-05-23 10:00:45 +00:00
#if $ runtime :
2014-11-09 02:49:38 +00:00
#set $ cur_ep_enddate = $ cur_result [ ' localtime ' ] + datetime . timedelta ( minutes = $ runtime )
2014-05-23 10:00:45 +00:00
#if $ cur_ep_enddate < $ today :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-overdue listingradius '
2014-05-23 10:00:45 +00:00
#elif $ cur_ep_airdate > = $ next_week . date ( ) :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-toofar listingradius '
2014-05-23 10:00:45 +00:00
#elif $ cur_ep_enddate > = $ today and $ cur_ep_airdate < $ next_week . date ( ) :
#if $ cur_ep_airdate == $ today . date ( ) :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-current listingradius '
2014-03-10 05:18:05 +00:00
#else :
2014-11-09 02:49:38 +00:00
#set $ show_div = ' ep_listing listing-default listingradius '
2014-03-10 05:18:05 +00:00
#end if
#end if
#end if
#end if
2014-11-09 02:49:38 +00:00
<div class=" $ show_div " id="listing- ${ cur_result [ ' showid ' ] } ">
2014-09-30 22:20:37 +00:00
<div class="tvshowDiv">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
2014-11-09 02:49:38 +00:00
<th #if ' banner ' == $ layout then ' class= " nobg " ' else ' rowspan= " 2 " ' # valign="top">
<a href=" $ sbRoot /home/displayShow?show= ${ cur_result [ ' showid ' ] } "><img alt="" class=" #if ' banner ' == $ layout then ' bannerThumb ' else ' posterThumb ' # " src=" $ sbRoot /showPoster/?show= ${ cur_result [ ' showid ' ] } &which= #if ' poster ' == $ layout then ' poster_thumb ' else $ layout # " /></a>
2014-09-30 22:20:37 +00:00
</th>
2014-11-09 02:49:38 +00:00
#if ' banner ' == $ layout :
2014-09-30 22:20:37 +00:00
</tr>
<tr>
2014-11-09 02:49:38 +00:00
#end if
2014-09-30 22:20:37 +00:00
<td class="next_episode">
<div class="clearfix">
2014-10-21 19:09:01 +00:00
<span class="tvshowTitle">
2014-11-10 11:15:36 +00:00
<a href=" $ sbRoot /home/displayShow?show= ${ cur_result [ ' showid ' ] } "> $ cur_result ['show_name']
2014-11-09 02:49:38 +00:00
#if int ( $ cur_result [ ' paused ' ] ) :
2014-09-30 22:20:37 +00:00
<span class="pause">[paused]</span>
2014-11-09 02:49:38 +00:00
#end if
2014-10-21 19:09:01 +00:00
</a></span>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<span class="tvshowTitleIcons">
2014-11-09 02:49:38 +00:00
#if $ cur_result [ ' imdb_id ' ] :
<a href="<%= anon_url('http://www.imdb.com/title/', cur_result['imdb_id']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title="http://www.imdb.com/title/ ${ cur_result [ ' imdb_id ' ] } "><img alt="[imdb]" height="16" width="16" src=" $ sbRoot /images/imdb.png" />
#end if
<a href="<%= anon_url(sickbeard.indexerApi(cur_indexer).config['show_url'], cur_result['showid']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title=" $ sickbeard . indexerApi ( $ cur_indexer ).config['show_url'] ${ cur_result [ ' showid ' ] } "><img alt=" $ sickbeard . indexerApi ( $ cur_indexer ).name" height="16" width="16" src=" $ sbRoot /images/ $ sickbeard . indexerApi ( $ cur_indexer ).config['icon']" /></a>
<span><a href=" $ sbRoot /home/searchEpisode?show= ${ cur_result [ ' showid ' ] } &season= $ cur_result ['season']&episode= $ cur_result ['episode']" title="Manual Search" id="forceUpdate- ${ cur_result [ ' showid ' ] } " class="epSearch forceUpdate"><img alt="[search]" height="16" width="16" src=" $ sbRoot /images/search16.png" id="forceUpdateImage- ${ cur_result [ ' showid ' ] } " /></a></span>
2014-09-30 22:20:37 +00:00
</span>
</div>
2014-11-09 02:49:38 +00:00
<span class="title">Next Episode:</span> <span><%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> - $ cur_result ['name']</span>
2014-09-30 22:20:37 +00:00
<div class="clearfix">
2014-10-14 04:13:59 +00:00
2014-11-11 15:30:33 +00:00
<span class="title">Airs: </span><span class=" ${ fuzzydate } "> $ sbdatetime . sbdatetime . sbfdatetime ( $ cur_result ['localtime']).decode( $ sickbeard . SYS_ENCODING )</span><%= ('', '<span> on %s</span>' % str(cur_result['network']))[None is not cur_result['network']] %>
2014-09-30 22:20:37 +00:00
</div>
2014-11-09 02:49:38 +00:00
2014-09-30 22:20:37 +00:00
<div class="clearfix">
<span class="title">Quality:</span>
2014-11-09 02:49:38 +00:00
#if int ( $ cur_result [ ' quality ' ] ) in $ qualityPresets :
<span class="quality $ qualityPresetStrings [int( $ cur_result ['quality'])]"> $ qualityPresetStrings [int( $ cur_result ['quality'])]</span>
2014-09-30 22:20:37 +00:00
#else :
<span class="quality Custom">Custom</span>
#end if
</div>
</td>
2014-11-09 02:49:38 +00:00
</tr>
<tr>
2014-09-30 22:20:37 +00:00
<td style="vertical-align: top;">
2014-11-09 02:49:38 +00:00
<div>
#if $ cur_result [ ' description ' ] :
2014-09-30 22:20:37 +00:00
<span class="title" style="vertical-align:middle;">Plot:</span>
2014-11-09 02:49:38 +00:00
<img class="ep_summaryTrigger" src=" $ sbRoot /images/plus.png" height="16" width="16" alt="" title="Toggle Summary" /><div class="ep_summary"> $ cur_result ['description']</div>
#else :
2014-09-30 22:20:37 +00:00
<span class="title ep_summaryTriggerNone" style="vertical-align:middle;">Plot:</span>
<img class="ep_summaryTriggerNone" src=" $ sbRoot /images/plus.png" height="16" width="16" alt="" />
2014-11-09 02:49:38 +00:00
#end if
2014-09-30 22:20:37 +00:00
</div>
2014-11-09 02:49:38 +00:00
</td>
</tr>
2014-09-30 22:20:37 +00:00
</table>
2014-11-09 02:49:38 +00:00
</div>
2014-09-30 22:20:37 +00:00
</div>
2014-11-09 02:49:38 +00:00
<!-- end $ cur_result ['show_name'] //-->
2014-09-30 22:20:37 +00:00
#end for
2014-03-10 05:18:05 +00:00
<!-- end non list view //-->
#end if
2014-11-09 02:49:38 +00:00
#if ' calendar ' == $ layout :
2014-09-15 17:43:49 +00:00
#set $ today = datetime . date . today ( )
2014-11-09 02:49:38 +00:00
#set $ dates = [ $ today + datetime . timedelta ( days = $ i ) for $ i in range ( 7 ) ]
2014-10-21 19:09:01 +00:00
#set $ tbl_day = 0
<br>
<br>
<div class="calendarWrapper">
2014-09-15 17:43:49 +00:00
<input type="hidden" id="sbRoot" value=" $ sbRoot " />
#for $ day in $ dates
2014-10-21 19:09:01 +00:00
#set $ tbl_day + = 1
2014-11-09 02:49:38 +00:00
<table class="sickbeardTable tablesorter calendarTable <%= 'cal-%s' % (('even', 'odd')[1 == tbl_day % 2]) %>" cellspacing="0" border="0" cellpadding="0">
2014-11-15 16:02:16 +00:00
<thead><tr><th> $ sbdatetime . sbdatetime . sbfdate ( $ day , '%A').decode( $ sickbeard . SYS_ENCODING ).capitalize()</th></tr></thead>
2014-11-09 02:49:38 +00:00
<tbody>
2014-10-15 15:45:55 +00:00
#set $ day_has_show = False
2014-09-15 17:43:49 +00:00
#for $ cur_result in $ sql_results :
2014-11-05 15:53:01 +00:00
#if int ( $ cur_result [ ' paused ' ] ) and not $ sickbeard . COMING_EPS_DISPLAY_PAUSED :
#continue
#end if
2014-11-09 02:49:38 +00:00
#set $ cur_indexer = int ( $ cur_result [ ' indexer ' ] )
#set $ runtime = $ cur_result [ ' runtime ' ]
#set $ airday = $ cur_result [ ' localtime ' ] . date ( )
2014-09-15 17:43:49 +00:00
#if $ airday == $ day :
2014-10-15 15:45:55 +00:00
#set $ day_has_show = True
2014-11-15 16:02:16 +00:00
#set $ airtime = $ sbdatetime . sbdatetime . sbftime ( $ cur_result [ ' localtime ' ] ) . decode ( $ sickbeard . SYS_ENCODING )
2014-10-15 15:45:55 +00:00
#if $ sickbeard . TRIM_ZERO :
2014-11-09 02:49:38 +00:00
#set $ airtime = re . sub ( r ' 0( \ d: \ d \ d) ' , r ' \ 1 ' , $ airtime , 0 , re . IGNORECASE | re . MULTILINE )
2014-10-15 15:45:55 +00:00
#end if
2014-11-09 02:49:38 +00:00
<tr>
<td class="calendarShow">
<div class="poster">
<a title=" ${ cur_result [ ' show_name ' ] } " href=" $ sbRoot /home/displayShow?show= ${ cur_result [ ' showid ' ] } "><img alt="" src=" $ sbRoot /showPoster/?show= ${ cur_result [ ' showid ' ] } &which=poster_thumb" /></a>
</div>
<div class="text">
<span class="airtime">
${ airtime } on $ cur_result ["network"]
</span>
<span class="episode-title" title=" $ cur_result ['name']">
<%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> - $ cur_result ['name']
</span>
</div>
</td> <!-- end $ cur_result ['show_name'] -->
</tr>
#end if
2014-10-15 15:45:55 +00:00
2014-09-15 17:43:49 +00:00
#end for
2014-10-15 15:45:55 +00:00
#if not $ day_has_show :
2014-10-21 19:09:01 +00:00
<tr><td class="calendarShow"><span class="show-status">No shows for this day</span></td></tr>
2014-10-15 15:45:55 +00:00
#end if
2014-09-15 17:43:49 +00:00
</tbody>
</table>
#end for
<!-- end calender view //-->
2014-10-21 19:09:01 +00:00
</div>
2014-09-15 17:43:49 +00:00
#end if
2014-10-21 19:09:01 +00:00
<div class="clearfix"></div>
2014-03-10 05:18:05 +00:00
<script type="text/javascript" charset="utf-8">
<!--
2014-11-09 02:49:38 +00:00
window.setInterval('location.reload(true)', 600000); // Refresh every 10 minutes
2014-03-10 05:18:05 +00:00
//-->
</script>
2014-11-09 02:49:38 +00:00
#include $ os . path . join ( $ sickbeard . PROG_DIR , ' gui/slick/interfaces/default/inc_bottom.tmpl ' )