Skip to content

Commit

Permalink
Use new setting for coming eps view, add submenu items for it
Browse files Browse the repository at this point in the history
  • Loading branch information
midgetspy committed Jan 17, 2011
1 parent a49de4e commit 5977cad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
10 changes: 5 additions & 5 deletions data/interfaces/default/comingEpisodes.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span class="listing_unknown">Unknown</span>
</div><br/>

#if $sickbeard.USE_LISTVIEW:
#if $sickbeard.COMING_EPS_FORMAT == 'list':
<!-- start list view -->
<script type="text/javascript" src="$sbRoot/js/plotTooltip.js"></script>
<script type="text/javascript" charset="utf-8">
Expand Down Expand Up @@ -224,7 +224,7 @@ Custom
<div class="tvshowDiv">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th #if $sickbeard.USE_BANNER then "" else "colspan=\"2\""#>
<th #if $sickbeard.COMING_EPS_FORMAT == 'banner' then "" else "colspan=\"2\""#>
<span class="tvshowTitle"><a href="$sbRoot/home/displayShow?show=${cur_result["showid"]}">$cur_result["show_name"]
#if int($cur_result["paused"]):
<span class="pause">[paused]</span>
Expand All @@ -234,10 +234,10 @@ Custom
</th>
</tr>
<tr>
<th #if $sickbeard.USE_BANNER then "class=\"nobg\"" else "rowspan=\"2\""# style="background-color: #efefef;">
<a href="$sbRoot/home/displayShow?show=${cur_result["showid"]}"><img alt="" class="#if $sickbeard.USE_BANNER then "bannerThumb" else "posterThumb"#" src="$sbRoot/showPoster/?show=${cur_result["showid"]}" /></a>
<th #if $sickbeard.COMING_EPS_FORMAT == 'banner' then "class=\"nobg\"" else "rowspan=\"2\""# style="background-color: #efefef;">
<a href="$sbRoot/home/displayShow?show=${cur_result["showid"]}"><img alt="" class="#if $sickbeard.COMING_EPS_FORMAT == 'banner' then "bannerThumb" else "posterThumb"#" src="$sbRoot/showPoster/?show=${cur_result["showid"]}&which=$sickbeard.COMING_EPS_FORMAT" /></a>
</th>
#if $sickbeard.USE_BANNER:
#if $sickbeard.COMING_EPS_FORMAT == 'banner':
</tr>
<tr>
#end if
Expand Down
8 changes: 1 addition & 7 deletions sickbeard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,8 @@ def initialize(consoleLogging=True):
NAMING_EP_NAME, NAMING_SEP_TYPE, NAMING_USE_PERIODS, WOMBLE, \
NZBSRUS, NZBSRUS_UID, NZBSRUS_HASH, BINREQ, NAMING_QUALITY, providerList, newznabProviderList, \
NAMING_DATES, EXTRA_SCRIPTS, USE_TWITTER, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, \
<<<<<<< HEAD
USE_BANNER, METADATA_XBMC, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, COMING_EPS_FORMAT
=======
USE_BANNER, USE_LISTVIEW, METADATA_XBMC, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES
>>>>>>> 327afa53fcf8b1c51f04e2b2a9a70a3647d95432

NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, COMING_EPS_FORMAT

if __INITIALIZED__:
return False
Expand Down
22 changes: 7 additions & 15 deletions sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,21 +1829,12 @@ def showPoster(self, show=None, which=None):
logger.log(u"No image available for show "+show.name, logger.WARNING) #TODO: make it return a standard image

@cherrypy.expose
def toggleBanners(self):
def setComingEpsFormat(self, format):
if format not in ('poster', 'banner', 'list'):
format = 'banner'

# toggle the setting
sickbeard.USE_BANNER = not sickbeard.USE_BANNER
sickbeard.COMING_EPS_FORMAT = format

# forward to the coming eps page
redirect("/comingEpisodes")

@cherrypy.expose
def toggleList(self):

# toggle the setting
sickbeard.USE_LISTVIEW = not sickbeard.USE_LISTVIEW

# forward to the coming eps page
redirect("/comingEpisodes")

@cherrypy.expose
Expand Down Expand Up @@ -1884,8 +1875,9 @@ def comingEpisodes(self, sort="date"):
{ 'title': 'Sort by Date', 'path': 'comingEpisodes/?sort=date' },
{ 'title': 'Sort by Show', 'path': 'comingEpisodes/?sort=show' },
{ 'title': 'Sort by Network', 'path': 'comingEpisodes/?sort=network' },
{ 'title': 'Toggle Banner View', 'path': 'toggleBanners/' },
{ 'title': 'Toggle List View', 'path': 'toggleList/' },
{ 'title': 'Use Banner View', 'path': 'setComingEpsFormat/?format=banner' },
{ 'title': 'Use Poster View', 'path': 'setComingEpsFormat/?format=poster' },
{ 'title': 'Use List View', 'path': 'setComingEpsFormat/?format=list' },
]
t.sort = sort
#t.epList = epList
Expand Down

0 comments on commit 5977cad

Please sign in to comment.