mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Add first revision of calendar to coming episodes
This commit is contained in:
parent
68bd6d87e2
commit
9f92601262
2 changed files with 47 additions and 3 deletions
|
@ -199,7 +199,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<!-- end list view //-->
|
||||
#else:
|
||||
#else if $layout in ['banner', 'poster']:
|
||||
<!-- start non list view //-->
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
<!--
|
||||
|
@ -387,6 +387,43 @@
|
|||
<!-- end non list view //-->
|
||||
#end if
|
||||
|
||||
#if $layout == 'calendar':
|
||||
|
||||
#set $today = datetime.date.today()
|
||||
#set $dates = [$today + datetime.timedelta(days=$i) for $i in range(7)]
|
||||
|
||||
<input type="hidden" id="sbRoot" value="$sbRoot" />
|
||||
#for $day in $dates
|
||||
<table class="sickbeardTable tablesorter" cellspacing="0" border="0" cellpadding="0" style="float:left;width:125px;white-space: nowrap; table-layout: fixed;">
|
||||
<thead><tr><th>$day.strftime("%A").decode($sickbeard.SYS_ENCODING).capitalize()</th></tr></thead>
|
||||
<tbody>
|
||||
|
||||
#for $cur_result in $sql_results:
|
||||
#set $cur_indexer = int($cur_result["indexer"])
|
||||
#set $runtime = $cur_result["runtime"]
|
||||
#set $airday = $cur_result["localtime"].date()
|
||||
|
||||
#if $airday == $day:
|
||||
|
||||
<tr>
|
||||
<td style="overflow: hidden; text-overflow: ellipsis; font-size: 11px; LINE-HEIGHT:12px";>
|
||||
<a href="$sbRoot/home/displayShow?show=${cur_result["showid"]}"><img alt="" src="$sbRoot/showPoster/?show=${cur_result["showid"]}&which=poster_thumb" width="125" /></a>
|
||||
<br> $cur_result["localtime"].strftime("%H:%M") on $cur_result["network"]
|
||||
#set $episodestring = "%sx%s %s" % ($cur_result["season"], $cur_result["episode"], $cur_result["name"])
|
||||
<br> $episodestring
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
|
||||
<!-- end $cur_result["show_name"] //-->
|
||||
#end for
|
||||
</tbody>
|
||||
</table>
|
||||
#end for
|
||||
|
||||
<!-- end calender view //-->
|
||||
#end if
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
<!--
|
||||
window.setInterval( "location.reload(true)", 600000); // Refresh every 10 minutes
|
||||
|
|
|
@ -305,9 +305,12 @@ class MainHandler(RequestHandler):
|
|||
redirect("/home/displayShow?show=" + show)
|
||||
|
||||
def setComingEpsLayout(self, layout):
|
||||
if layout not in ('poster', 'banner', 'list'):
|
||||
if layout not in ('poster', 'banner', 'list', 'calendar'):
|
||||
layout = 'banner'
|
||||
|
||||
if layout == 'calendar':
|
||||
sickbeard.COMING_EPS_SORT = 'date'
|
||||
|
||||
sickbeard.COMING_EPS_LAYOUT = layout
|
||||
|
||||
redirect("/comingEpisodes/")
|
||||
|
@ -321,6 +324,9 @@ class MainHandler(RequestHandler):
|
|||
def setComingEpsSort(self, sort):
|
||||
if sort not in ('date', 'network', 'show'):
|
||||
sort = 'date'
|
||||
|
||||
if sickbeard.COMING_EPS_LAYOUT == 'calendar':
|
||||
sort = 'date'
|
||||
|
||||
sickbeard.COMING_EPS_SORT = sort
|
||||
|
||||
|
@ -390,6 +396,7 @@ class MainHandler(RequestHandler):
|
|||
{'title': 'Layout:', 'path': {'Banner': 'setComingEpsLayout/?layout=banner',
|
||||
'Poster': 'setComingEpsLayout/?layout=poster',
|
||||
'List': 'setComingEpsLayout/?layout=list',
|
||||
'Calendar': 'setComingEpsLayout/?layout=calendar',
|
||||
}},
|
||||
paused_item,
|
||||
]
|
||||
|
@ -399,7 +406,7 @@ class MainHandler(RequestHandler):
|
|||
t.sql_results = sql_results
|
||||
|
||||
# Allow local overriding of layout parameter
|
||||
if layout and layout in ('poster', 'banner', 'list'):
|
||||
if layout and layout in ('poster', 'banner', 'list','calendar'):
|
||||
t.layout = layout
|
||||
else:
|
||||
t.layout = sickbeard.COMING_EPS_LAYOUT
|
||||
|
|
Loading…
Reference in a new issue