mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 08:53:37 +00:00
216 lines
No EOL
9.7 KiB
Cheetah
216 lines
No EOL
9.7 KiB
Cheetah
#import sickbeard
|
|
#from sickbeard.common import *
|
|
##
|
|
#set global $title = 'Mass Update'
|
|
#set global $header = 'Mass Update'
|
|
#set global $sbPath = '../..'
|
|
#set global $topmenu = 'manage'
|
|
##
|
|
#import os.path
|
|
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
|
|
##
|
|
#set $has_any_sports = False
|
|
#set $has_any_anime = False
|
|
#set $has_any_flat_folders = False
|
|
#set $myShowList = $sickbeard.showList
|
|
$myShowList.sort(lambda x, y: cmp(x.name, y.name))
|
|
#for $curShow in $myShowList
|
|
#set $has_any_sports |= bool($curShow.sports)
|
|
#set $has_any_anime |= bool($curShow.anime)
|
|
#set $has_any_flat_folders |= $bool(curShow.flatten_folders)
|
|
#end for
|
|
<script type="text/javascript" charset="utf-8">
|
|
<!--
|
|
\$.tablesorter.addParser({
|
|
id: 'showNames',
|
|
is: function(s) {
|
|
return false;
|
|
},
|
|
format: function(s) {
|
|
#if not $sickbeard.SORT_ARTICLE
|
|
return (s || '').replace(/^(?:(?:A(?!\s+to)n?)|The)\s(\w)/i, '$1');
|
|
#else
|
|
return (s || '');
|
|
#end if
|
|
},
|
|
type: 'text'
|
|
});
|
|
|
|
\$.tablesorter.addParser({
|
|
id: 'quality',
|
|
is: function(s) {
|
|
return false;
|
|
},
|
|
format: function(s) {
|
|
return s.replace('hd1080p', 5).replace('hd720p', 4).replace('hd', 3).replace('sd', 2).replace('any', 1).replace('best', 0).replace('custom', 7);
|
|
},
|
|
type: 'numeric'
|
|
});
|
|
##
|
|
#set $columns_total = 15 - ((1, 0)[$has_any_sports] + (1, 0)[$has_any_anime] + (1, 0)[$has_any_flat_folders] + (1, 0)[$sickbeard.USE_SUBTITLES])
|
|
#set $column_headers = [('false', False), ("'showNames'", False), ("'quality'", False),
|
|
((None, "'sports'")[$has_any_sports], True),
|
|
("'scene'", True), ((None, "'anime'")[$has_any_anime], True),
|
|
((None, "'flatfold'")[$has_any_flat_folders], True), ("'paused'", True),
|
|
("'status'", False), ('false', False), ('false', False), ('false', False),
|
|
((None, 'false')[$sickbeard.USE_SUBTITLES], False), ('false', False), ('false', False)]
|
|
#set $headers = []
|
|
#set $text_extract = []
|
|
#set $column = -1
|
|
#for $k, ($c, $img_extract) in enumerate($column_headers)
|
|
#if None is $c
|
|
#continue
|
|
#end if
|
|
#set $column += 1
|
|
#set void = $headers.append('\t\t\t%s: { sorter: %s }' % ($column, $c))
|
|
#if $img_extract
|
|
#set void = $text_extract.append('\t\t\t%s%s' % ($column, ": function(node) {return $(node).find('img').attr('alt')}"))
|
|
#end if
|
|
#end for
|
|
|
|
\$(document).ready(function()
|
|
{
|
|
\$('#massUpdateTable:has(tbody tr)').tablesorter({
|
|
widgets: ['zebra'],
|
|
sortList: [[1,0]],
|
|
headers: {
|
|
#echo ',\n'.join($headers)#
|
|
},
|
|
textExtraction: {
|
|
2: function(node) {return \$(node).find('span').text().toLowerCase()},
|
|
#echo ',\n'.join($text_extract)#
|
|
}
|
|
});
|
|
});
|
|
//-->
|
|
</script>
|
|
<script type="text/javascript" src="$sbRoot/js/massUpdate.js?$sbPID"></script>
|
|
#if $varExists('header')
|
|
<h1 class="header">$header</h1>
|
|
#else
|
|
<h1 class="title">$title</h1>
|
|
#end if
|
|
<form name="massUpdateForm" method="post" action="massUpdate">
|
|
|
|
<table id="massUpdateTable" class="sickbeardTable tablesorter" cellspacing="1" border="0" cellpadding="0">
|
|
<thead>
|
|
<tr>
|
|
<th class="col-checkbox">Edit<br /><input type="checkbox" class="bulkCheck" id="editCheck"></th>
|
|
<th class="nowrap narrow" style="text-align:left">Show Name</th>
|
|
<th class="col-legend narrow">Quality</th>
|
|
#if $has_any_sports
|
|
<th class="col-legend narrow">Sports</th>
|
|
#end if
|
|
<th class="col-legend narrow">Scene</th>
|
|
#if $has_any_anime
|
|
<th class="col-legend narrow">Anime</th>
|
|
#end if
|
|
#if $has_any_flat_folders
|
|
<th class="col-legend narrow">Flat<br /> Folders</th>
|
|
#end if
|
|
<th class="col-legend narrow">Paused</th>
|
|
<th class="col-legend narrow">Status</th>
|
|
<th width="1%">Update<br /><input type="checkbox" class="bulkCheck" id="updateCheck"></th>
|
|
<th width="1%">Rescan<br /><input type="checkbox" class="bulkCheck" id="refreshCheck"></th>
|
|
<th width="1%">Rename<br /><input type="checkbox" class="bulkCheck" id="renameCheck"></th>
|
|
#if $sickbeard.USE_SUBTITLES
|
|
<th width="1%">Search<br />Subtitle<br /><input type="checkbox" class="bulkCheck" id="subtitleCheck"></th>
|
|
#end if
|
|
## <!-- <th>Force Metadata Regen <input type="checkbox" class="bulkCheck" id="metadataCheck"></th>//-->
|
|
<th width="1%">Delete<br /><input type="checkbox" class="bulkCheck" id="deleteCheck"></th>
|
|
<th width="1%">Remove<br /><input type="checkbox" class="bulkCheck" id="removeCheck"></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tfoot>
|
|
<tr>
|
|
<td rowspan="1" colspan="2" class="align-center alt"><input class="btn pull-left" type="button" value="Edit Selected" id="submitMassEdit"></td>
|
|
<td rowspan="1" colspan="#echo $columns_total-2#" class="align-right alt"><input class="btn pull-right" type="button" value="Submit" id="submitMassUpdate"></td>
|
|
</tr>
|
|
</tfoot>
|
|
|
|
<tbody>
|
|
|
|
#set $disabled = ' disabled="disabled"'
|
|
#set $disabled_inprogress_tip = ' title="%s action is currently in progress for this show"'
|
|
#set $disabled_subtitles_tip = ' title="Use edit to enable subtitle search for this show"'
|
|
#set $no = 'no16.png" title="No" alt="No'
|
|
#set $yes = 'yes16.png" title="Yes" alt="Yes'
|
|
#for $curShow in $myShowList
|
|
#set $option_state = '<input type="checkbox" class="%sCheck" id="%s-{0:s}"%s>'.format(str($curShow.indexerid))
|
|
##
|
|
#set $curUpdate_disabled = $sickbeard.showQueueScheduler.action.isBeingUpdated($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInUpdateQueue($curShow)
|
|
#set $reason = $disabled_inprogress_tip % 'Update'
|
|
#set $curUpdate = '%s>%s' % (('', $reason)[$curUpdate_disabled],
|
|
$option_state % ('update', 'update', ('', $disabled + $reason)[$curUpdate_disabled]))
|
|
##
|
|
#set $curRefresh_disabled = $sickbeard.showQueueScheduler.action.isBeingRefreshed($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInRefreshQueue($curShow)
|
|
#set $reason = $disabled_inprogress_tip % 'Rescan'
|
|
#set $curRefresh = '%s>%s' % (('', $reason)[$curRefresh_disabled],
|
|
$option_state % ('refresh', 'refresh', ('', $disabled + $reason)[$curRefresh_disabled]))
|
|
##
|
|
#set $curRename_disabled = $sickbeard.showQueueScheduler.action.isBeingRenamed($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInRenameQueue($curShow)
|
|
#set $reason = $disabled_inprogress_tip % 'Rename'
|
|
#set $curRename = '%s>%s' % (('', $reason)[$curRename_disabled],
|
|
$option_state % ('rename', 'rename', ('', $disabled + $reason)[$curRename_disabled]))
|
|
##
|
|
#set $subtitles_disabled = not $curShow.subtitles\
|
|
or $sickbeard.showQueueScheduler.action.isBeingSubtitled($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInSubtitleQueue($curShow)
|
|
#set $reason = ($disabled_inprogress_tip % 'Search subtitle', $disabled_subtitles_tip)[not $curShow.subtitles]
|
|
#set $curSubtitle = '%s>%s' % (('', $reason)[$subtitles_disabled],
|
|
$option_state % ('subtitle', 'subtitle', ('', $disabled + $reason)[$subtitles_disabled]))
|
|
##
|
|
#set $curDelete_disabled = $sickbeard.showQueueScheduler.action.isBeingRenamed($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInRenameQueue($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInRefreshQueue($curShow)
|
|
#set $reason = $disabled_inprogress_tip % 'Rename or rescan'
|
|
#set $curDelete = '%s>%s' % (('', $reason)[$curDelete_disabled],
|
|
$option_state % ('delete', 'delete', ('', $disabled + $reason)[$curDelete_disabled]))
|
|
##
|
|
#set $curRemove_disabled = $sickbeard.showQueueScheduler.action.isBeingRenamed($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInRenameQueue($curShow)\
|
|
or $sickbeard.showQueueScheduler.action.isInRefreshQueue($curShow)
|
|
##set $reason = $disabled_inprogress_tip % 'Rename or rescan'
|
|
#set $curRemove = '%s>%s' % (('', $reason)[$curRemove_disabled],
|
|
$option_state % ('remove', 'remove', ('', $disabled + $reason)[$curRemove_disabled]))
|
|
<tr>
|
|
<td align="center"><input type="checkbox" class="editCheck" id="edit-$curShow.indexerid"></td>
|
|
<td class="tvShow"><a href="$sbRoot/home/displayShow?show=$curShow.indexerid">$curShow.name</a></td>
|
|
#if $curShow.quality in $qualityPresets
|
|
<td align="center"><span class="quality $qualityPresetStrings[$curShow.quality]">$qualityPresetStrings[$curShow.quality]</span></td>
|
|
#else
|
|
<td align="center"><span class="quality Custom">Custom</span></td>
|
|
#end if
|
|
#if $has_any_sports
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.is_sports) then $yes else $no#" width="16" height="16" /></td>
|
|
#end if
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.is_scene) then $yes else $no#" width="16" height="16" /></td>
|
|
#if $has_any_anime
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.is_anime) then $yes else $no#" width="16" height="16" /></td>
|
|
#end if
|
|
#if $has_any_flat_folders
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.flatten_folders) then $yes else $no#" width="16" height="16" /></td>
|
|
#end if
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.paused) then $yes else $no#" width="16" height="16" /></td>
|
|
<td align="center">$curShow.status</td>
|
|
<td align="center"$curUpdate</td>
|
|
<td align="center"$curRefresh</td>
|
|
<td align="center"$curRename</td>
|
|
#if $sickbeard.USE_SUBTITLES
|
|
<td align="center"$curSubtitle</td>
|
|
#end if
|
|
<td align="center"$curDelete</td>
|
|
<td align="center"$curRemove</td>
|
|
</tr>
|
|
#end for
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl') |