SickGear/gui/slick/interfaces/default/testRename.tmpl

98 lines
No EOL
3.4 KiB
Cheetah

#import sickbeard
#from sickbeard import common
#from sickbeard import exceptions
##
#set global $title = 'Test Rename ' + $show.name
#set global $header = '<a href="' + $sbRoot + '/home/displayShow?show=%d">%s</a>' % ($show.indexerid, $show.name)
#set global $sbPath = '..'
#set global $topmenu = 'home'
#set global $page_body_attr = 'rename'
##
#import os.path
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
#if $varExists('header')
<h1 class="header">$header</h1>
#else
<h1 class="title">$title</h1>
#end if
<input type="hidden" id="showID" value="$show.indexerid" />
<script type="text/javascript" src="$sbRoot/js/testRename.js"></script>
<h3>Preview of the proposed name changes</h3>
<blockquote>
#if int($show.air_by_date) == 1 and $sickbeard.NAMING_CUSTOM_ABD:
$sickbeard.NAMING_ABD_PATTERN
#elif int($show.sports) == 1 and $sickbeard.NAMING_CUSTOM_SPORTS:
$sickbeard.NAMING_SPORTS_PATTERN
#else
$sickbeard.NAMING_PATTERN
#end if
</blockquote>
##
#set $curSeason = -1
#set $odd = False
<div class="clearfix padbottom">
<button class="btn seriesCheck">Select All Episodes</button>
<button class="btn clearAll">Clear All</button>
</div>
<input type="submit" value="Rename Selected" class="btn btn-success"> <a href="/home/displayShow?show=$show.indexerid" class="btn btn-danger">Cancel Rename</a>
<table id="testRenameTable" class="sickbeardTable" border="0">
##
#for $cur_ep_obj in $ep_obj_list
#set $curLoc = $cur_ep_obj.location[len($cur_ep_obj.show.location)+1:]
#set $curExt = $curLoc.split('.')[-1]
#set $newLoc = $cur_ep_obj.proper_path() + '.' + $curExt
#if int($cur_ep_obj.season) != $curSeason:
<thead>
<tr class="seasonheader" id="season-$cur_ep_obj.season">
<td colspan="4" class="text-left">
<h2>#if 0 == int($cur_ep_obj.season) then 'Specials' else 'Season %s' % $cur_ep_obj.season#</h2>
</td>
</tr>
<tr class="seasoncols" id="season-$cur_ep_obj.season-cols">
<th class="col-checkbox"><input type="checkbox" class="seasonCheck" id="$cur_ep_obj.season" /></th>
<th class="text-nowrap">Episode</th>
<th class="col-name">Old Location</th>
<th class="col-name">New Location</th>
</tr>
</thead>
#set $curSeason = int($cur_ep_obj.season)
#end if
##
#set $odd = not $odd
#set $epStr = str($cur_ep_obj.season) + 'x' + str($cur_ep_obj.episode)
#set $epList = sorted([cur_ep_obj.episode] + [x.episode for x in cur_ep_obj.relatedEps])
#if 1 < len($epList)
#set $epList = [$min($epList), $max($epList)]
#end if
<tbody>
<tr class="season-$curSeason #if $curLoc == $newLoc#good#else#wanted#end if# seasonstyle">
#if $curLoc != $newLoc
<td class="col-checkbox">
<input type="checkbox" class="epCheck" id="<%=str(cur_ep_obj.season) + 'x' + str(cur_ep_obj.episode)%>" name="<%=str(cur_ep_obj.season) + 'x' + str(cur_ep_obj.episode) %>">
</td>
#else
<td></td>
#end if
<td class="col-ep text-nowrap"><%= '-'.join(map(str, epList)) %></td>
<td class="col-name text-left">$curLoc</td>
<td class="col-name text-left">$newLoc</td>
</tr>
</tbody>
#end for
</table>
<div style="clear:both;margin-top:20px">
<input type="submit" value="Rename Selected" class="btn btn-success"> <a href="/home/displayShow?show=$show.indexerid" class="btn btn-danger">Cancel Rename</a>
</div>
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')