SickGear/gui/slick/interfaces/default/inc_bottom.tmpl
JackDandy b2f475e99f Add a link from the footer number of snatched to episode snatched overview page.
The link to the Episode Overview page is available on all pages except on the Episode Overview page.
Change the default state for all check boxes on the Episode Overview page to not checked.
Add validation to Go button to ensure at least one item is checked on Episode Overview page.
Add highlight to current status text in header on Episode Overview page.
Cleanup manageEpisodeStatuses Javascript.
2014-12-13 18:45:10 +00:00

73 lines
2.8 KiB
Cheetah

#import sickbeard
#import datetime
#from sickbeard import db, sbdatetime
#from sickbeard.common import *
</div> <!-- /content -->
</div> <!-- /contentWrapper -->
<footer>
<div class="footer clearfix">
#set $my_db = $db.DBConnection()
#set $today = str($datetime.date.today().toordinal())
#set status_quality = '(' + ','.join([str(quality) for quality in $Quality.SNATCHED + $Quality.SNATCHED_PROPER]) + ')'
#set status_download = '(' + ','.join([str(quality) for quality in $Quality.DOWNLOADED + [$ARCHIVED]]) + ')'
#set $sql_statement = 'SELECT '
#set $sql_statement += '(SELECT COUNT(*) FROM tv_episodes WHERE season > 0 AND episode > 0 AND airdate > 1 AND status IN ' + $status_quality + ') AS ep_snatched, '
#set $sql_statement += '(SELECT COUNT(*) FROM tv_episodes WHERE season > 0 AND episode > 0 AND airdate > 1 AND status IN ' + $status_download + ') AS ep_downloaded, '
#set $sql_statement += '(SELECT COUNT(*) FROM tv_episodes WHERE season > 0 AND episode > 0 AND airdate > 1 '
#set $sql_statement += ' AND ((airdate <= ' + $today + ' AND (status = ' + str($SKIPPED) + ' OR status = ' + str($WANTED) + ')) '
#set $sql_statement += ' OR (status IN ' + status_quality + ') OR (status IN ' + status_download + '))) AS ep_total '
#set $sql_statement += ' FROM tv_episodes tv_eps LIMIT 1'
#set $sql_result = $my_db.select($sql_statement)
#set $shows_total = len($sickbeard.showList)
#set $shows_active = len([show for show in $sickbeard.showList if show.paused == 0 and show.status != "Ended"])
#if $sql_result:
#set $ep_snatched = $sql_result[0]['ep_snatched']
#set $ep_downloaded = $sql_result[0]['ep_downloaded']
#set $ep_total = $sql_result[0]['ep_total']
#else
#set $ep_snatched = 0
#set $ep_downloaded = 0
#set $ep_total = 0
#end if
#try
#set $localRoot = $sbRoot
#except NotFound
#set $localRoot = ''
#end try
#try
#set $localheader = $header
#except NotFound
#set $localheader = ''
#end try
<span class="footerhighlight">$shows_total</span> shows (<span class="footerhighlight">$shows_active</span> active)
| <span class="footerhighlight"><%= ep_downloaded %></span>
<%= (
'',\
' (<span class="footerhighlight">+%s</span> snatched)' % \
(
str(ep_snatched),
'<a href="%s/manage/episodeStatuses?whichStatus=2" title="View overview of snatched episodes">%s</a>' % \
(localRoot, str(ep_snatched))
)['Episode Overview' != localheader]
)[0 < ep_snatched]
%>
&nbsp;/&nbsp;<span class="footerhighlight">$ep_total</span> episodes downloaded
| daily search: <span class="footerhighlight"><%= str(sickbeard.dailySearchScheduler.timeLeft()).split('.')[0] %></span>
| backlog search: <span class="footerhighlight">$sbdatetime.sbdatetime.sbfdate($sickbeard.backlogSearchScheduler.nextRun())</span>
</div>
</footer>
</body>
</html>