#import sickbeard
#import datetime
#import re
#import urllib
#from sickbeard import WEB_ROOT, THEME_NAME
#from sickbeard.common import *
#from sickbeard import sbdatetime
#from sickbeard.helpers import anon_url
<% def sg_var(varname, default=False): return getattr(sickbeard, varname, default) %>#slurp#
<% def sg_str(varname, default=''): return getattr(sickbeard, varname, default) %>#slurp#
##
#set global $title='Browse %s Shows' % $browse_type
#set global $header='Browse Shows'
#set global $sbPath='..'
#set global $topmenu='home'
#set global $page_body_attr = 'browse-list'
#set sg_root = $getVar('sbRoot', WEB_ROOT)
##
#import os.path
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_top.tmpl')
#if $varExists('header')
#set $heading = ('header', $header)
#else
#set $heading = ('title', $title)
#end if
%s' % $heading#
#set $mode = $kwargs and $kwargs.get('mode', '')
#if $all_shows or ($kwargs and $kwargs.get('show_header'))
#if 'Ani' not in $browse_type
#end if
$browse_title
#if $kwargs and $kwargs.get('oldest')
First aired from $kwargs['oldest'] until $kwargs['newest']
#end if
#end if
#if $all_shows
#set $poster_id = 0
#for $this_show in $all_shows
#set $poster_id += 1
#set $title_html = $this_show['title'].replace('"', '"').replace("'", ''')
#if 'newseasons' == $mode
#set $overview = '%s: %s' % (
('Season %s' % $this_show['episode_season'], 'Brand-new')[1 == $this_show['episode_season']],
($this_show['overview'], $this_show['episode_overview'])[any($this_show['episode_overview']) and 1 != $this_show['episode_season']])
#else
#set $overview = $this_show['overview']
#end if
#set $known = 'not'
#set $show_id = $this_show['show_id']
#if ':' in $show_id
#set $known = ''
#set $show_id = $show_id[2:]
#end if
#set $hide = ('', 'hide ')[$show_id in $sickbeard.BROWSELIST_HIDDEN]
#echo ((re.sub('^((?:A(?!\s+to)n?)|The)\s(\w)', r'\1 \2', $this_show['title']), $this_show['title'])[$sg_var('SORT_ARTICLE')], ' ')['' == $this_show['title']]#
#if 'Ani' not in $browse_type
#end if
$this_show['rating']%$this_show['votes'] votes
#if 'url_tvdb' in $this_show and $this_show['url_tvdb']
#end if
#if ':' in $this_show['show_id']
In library
#else
Add Show
#end if
#set $state = 'progress-%s0" title="%s"' % (('2', 'Upcoming'), ('8', 'Started'))[$this_show['when_past']]
$kwargs['footnote']
#end if
#else
#if $kwargs and $kwargs.get('error_msg')
$kwargs['error_msg']
#else
$browse_type API did not return results, this can happen from time to time.
This view should auto refresh every 10 mins.
#end if
#end if
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_bottom.tmpl')