1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-11 03:45:01 -05:00

Merge pull request #804 from adam111316/calendar

Add first revision of calendar to coming episodes
This commit is contained in:
adam111316 2014-09-16 17:34:18 +08:00
commit 9e20c33013
2 changed files with 47 additions and 3 deletions

View File

@ -199,7 +199,7 @@
</tbody> </tbody>
</table> </table>
<!-- end list view //--> <!-- end list view //-->
#else: #else if $layout in ['banner', 'poster']:
<!-- start non list view //--> <!-- start non list view //-->
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
<!-- <!--
@ -387,6 +387,43 @@
<!-- end non list view //--> <!-- end non list view //-->
#end if #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"]}&amp;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"> <script type="text/javascript" charset="utf-8">
<!-- <!--
window.setInterval( "location.reload(true)", 600000); // Refresh every 10 minutes window.setInterval( "location.reload(true)", 600000); // Refresh every 10 minutes

View File

@ -305,9 +305,12 @@ class MainHandler(RequestHandler):
redirect("/home/displayShow?show=" + show) redirect("/home/displayShow?show=" + show)
def setComingEpsLayout(self, layout): def setComingEpsLayout(self, layout):
if layout not in ('poster', 'banner', 'list'): if layout not in ('poster', 'banner', 'list', 'calendar'):
layout = 'banner' layout = 'banner'
if layout == 'calendar':
sickbeard.COMING_EPS_SORT = 'date'
sickbeard.COMING_EPS_LAYOUT = layout sickbeard.COMING_EPS_LAYOUT = layout
redirect("/comingEpisodes/") redirect("/comingEpisodes/")
@ -321,6 +324,9 @@ class MainHandler(RequestHandler):
def setComingEpsSort(self, sort): def setComingEpsSort(self, sort):
if sort not in ('date', 'network', 'show'): if sort not in ('date', 'network', 'show'):
sort = 'date' sort = 'date'
if sickbeard.COMING_EPS_LAYOUT == 'calendar':
sort = 'date'
sickbeard.COMING_EPS_SORT = sort sickbeard.COMING_EPS_SORT = sort
@ -390,6 +396,7 @@ class MainHandler(RequestHandler):
{'title': 'Layout:', 'path': {'Banner': 'setComingEpsLayout/?layout=banner', {'title': 'Layout:', 'path': {'Banner': 'setComingEpsLayout/?layout=banner',
'Poster': 'setComingEpsLayout/?layout=poster', 'Poster': 'setComingEpsLayout/?layout=poster',
'List': 'setComingEpsLayout/?layout=list', 'List': 'setComingEpsLayout/?layout=list',
'Calendar': 'setComingEpsLayout/?layout=calendar',
}}, }},
paused_item, paused_item,
] ]
@ -399,7 +406,7 @@ class MainHandler(RequestHandler):
t.sql_results = sql_results t.sql_results = sql_results
# Allow local overriding of layout parameter # 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 t.layout = layout
else: else:
t.layout = sickbeard.COMING_EPS_LAYOUT t.layout = sickbeard.COMING_EPS_LAYOUT