2014-03-10 05:18:05 +00:00
#import sickbeard
2015-05-07 00:36:40 +00:00
#from sickbeard import subtitles
2014-11-09 02:49:38 +00:00
#from sickbeard . helpers import anon_url
2015-05-07 00:36:40 +00:00
##
#set global $ title = ' Config - Subtitles '
#set global $ header = ' Subtitles '
#set global $ sbPath = ' ../.. '
#set global $ topmenu = ' config '
##
2014-03-10 05:18:05 +00:00
#import os . path
2015-05-07 00:36:40 +00:00
#include $ os . path . join ( $ sickbeard . PROG_DIR , ' gui/slick/interfaces/default/inc_top.tmpl ' )
2014-03-10 05:18:05 +00:00
<script type="text/javascript" src=" $ sbRoot /js/configSubtitles.js? $ sbPID "></script>
<script type="text/javascript" src=" $ sbRoot /js/config.js"></script>
<script type="text/javascript" src=" $ sbRoot /js/lib/jquery.tokeninput.js"></script>
<script type="text/javascript">
\$(document).ready(function() {
\$(" #subtitles _languages " ).tokenInput(
[
2014-05-15 01:41:08 +00:00
<%=",\r\n".join("{id: \"" + lang[2] + "\", name: \"" + lang[3] + "\"}" for lang in subtitles.subtitleLanguageFilter())%>
2014-03-10 05:18:05 +00:00
],
{
method: "POST",
hintText: "Write to search a language and select it",
preventDuplicates: true,
prePopulate:
2015-05-07 00:36:40 +00:00
2014-03-10 05:18:05 +00:00
[
<%=
",\r\n".join("{id: \"" + lang + "\", name: \"" + subtitles.getLanguageName(lang) + "\"}" for lang in sickbeard.SUBTITLES_LANGUAGES) if sickbeard.SUBTITLES_LANGUAGES != '' else ''
%>
]
}
);
});
</script>
2014-10-21 19:09:01 +00:00
2015-05-07 00:36:40 +00:00
#if $ varExists ( ' header ' )
2014-03-10 05:18:05 +00:00
<h1 class="header"> $ header </h1>
2015-05-07 00:36:40 +00:00
#else
2014-03-10 05:18:05 +00:00
<h1 class="title"> $ title </h1>
#end if
<div id="config">
<div id="config-content">
<form id="configForm" action="saveSubtitles" method="post">
<div id="config-components">
<ul>
<li><a href=" #core - component - group4 " >Subtitles Search</a></li>
<li><a href=" #core - component - group2 " >Subtitles Plugin</a></li>
</ul>
2015-05-07 00:36:40 +00:00
2014-10-21 19:09:01 +00:00
<div id="core-component-group4" class="component-group">
2014-03-10 05:18:05 +00:00
<div class="component-group-desc">
<h3>Subtitles Search</h3>
2014-11-12 16:43:14 +00:00
<p>Settings that dictate how SickGear handles subtitles search results.</p>
2014-03-10 05:18:05 +00:00
</div>
2015-05-07 00:36:40 +00:00
2014-03-10 05:18:05 +00:00
<fieldset class="component-group-list">
<div class="field-pair">
<input type="checkbox" class="enabler" #if $ sickbeard . USE_SUBTITLES then " checked= \" checked \" " else " " # id="use_subtitles" name="use_subtitles">
<label for="use_subtitles" class="clearfix">
<span class="component-title">Search Subtitles</span>
</label>
</div>
<div id="content_use_subtitles">
<div class="field-pair">
2014-10-21 19:09:01 +00:00
<label class="nocheck">
2014-03-10 05:18:05 +00:00
<span class="component-title">Subtitle Languages</span>
2014-10-21 19:09:01 +00:00
<span class="component-desc"><input type="text" id="subtitles_languages" name="subtitles_languages" /></span>
2014-03-10 05:18:05 +00:00
</label>
</div>
<div class="field-pair">
2014-10-21 19:09:01 +00:00
<label class="nocheck">
2014-03-10 05:18:05 +00:00
<span class="component-title">Subtitle Directory</span>
2014-10-21 19:09:01 +00:00
<input type="text" value=" $ sickbeard . SUBTITLES_DIR " id="subtitles_dir" name="subtitles_dir" class="form-control input-sm input350">
2014-03-10 05:18:05 +00:00
</label>
2014-10-21 19:09:01 +00:00
<label class="nocheck">
2014-03-10 05:18:05 +00:00
<span class="component-title"> </span>
2014-11-12 16:43:14 +00:00
<span class="component-desc">The directory where SickGear should store your <i>Subtitles</i> files.</span>
2014-03-10 05:18:05 +00:00
</label>
2014-10-21 19:09:01 +00:00
<label class="nocheck">
2014-03-10 05:18:05 +00:00
<span class="component-title"> </span>
<span class="component-desc"><b>NOTE:</b> Leave empty if you want store subtitle in episode path.</span>
</label>
</div>
<div class="field-pair">
2014-10-21 19:09:01 +00:00
<label class="nocheck">
2014-03-10 05:18:05 +00:00
<span class="component-title">Subtitle Find Frequency</span>
2014-10-21 19:09:01 +00:00
<input type="number" name="subtitles_finder_frequency" value=" $ sickbeard . SUBTITLES_FINDER_FREQUENCY " hours="1" class="form-control input-sm input75" />
2014-03-10 05:18:05 +00:00
</label>
2014-10-21 19:09:01 +00:00
<label class="nocheck">
2014-03-10 05:18:05 +00:00
<span class="component-title"> </span>
<span class="component-desc">Time in hours between scans (hours. 1)</span>
</label>
</div>
<div class="field-pair">
<input type="checkbox" name="subtitles_history" id="subtitles_history" #if $ sickbeard . SUBTITLES_HISTORY then " checked= \" checked \" " else " " # />
<label class="clearfix" for="subtitles_history">
<span class="component-title">Subtitles History</span>
<span class="component-desc">Log downloaded Subtitle on History page?</span>
</label>
2015-05-07 00:36:40 +00:00
</div>
2014-03-10 05:18:05 +00:00
<br/><input type="submit" class="btn config_submitter" value="Save Changes" /><br/>
</div>
</fieldset>
</div><!-- /component-group1 //-->
2014-10-21 19:09:01 +00:00
<div id="core-component-group2" class="component-group">
2014-03-10 05:18:05 +00:00
<div class="component-group-desc">
<h3>Subtitle Plugins</h3>
<p>Check off and drag the plugins into the order you want them to be used.</p>
<p class="note">At least one plugin is required.</p>
2014-09-30 22:20:37 +00:00
<p class="note"><span style="font-size: 16px;">*</span> Web-scraping plugin</p>
2014-03-10 05:18:05 +00:00
</div>
<fieldset class="component-group-list" style="margin-left: 50px; margin-top:36px">
<ul id="service_order_list">
#for $ curService in $ sickbeard . subtitles . sortedServiceList ( ) :
#set $ curName = $ curService . id
<li class="ui-state-default" id=" $ curName ">
<input type="checkbox" id="enable_ $ curName " class="service_enabler" #if $ curService . enabled then " checked= \" checked \" " else " " # />
2014-11-09 02:49:38 +00:00
#set $ provider_url = $ curService . url
<a href="<%= anon_url(provider_url) %>" class="imgLink" target="_new">
2014-09-30 22:20:37 +00:00
<img src=" $ sbRoot /images/subtitles/ $ curService . image " alt=" $ curService . name " title=" $ curService . name " width="16" height="16" style="vertical-align:middle;"/>
2014-05-15 01:41:08 +00:00
</a>
2014-09-30 22:20:37 +00:00
<span style="vertical-align:middle;"> $ curService . name . capitalize ()</span>
2014-05-15 01:41:08 +00:00
#if not $ curService . api_based then " * " else " " #
2014-09-30 22:20:37 +00:00
<span class="ui-icon ui-icon-arrowthick-2-n-s pull-right" style="vertical-align:middle;"></span>
2014-03-10 05:18:05 +00:00
</li>
#end for
</ul>
<input type="hidden" name="service_order" id="service_order" value="<%=" ".join([x.get('id')+':'+str(int(x.get('enabled'))) for x in sickbeard.subtitles.sortedServiceList()])%>"/>
<br/><input type="submit" class="btn config_submitter" value="Save Changes" /><br/>
</fieldset>
</div><!-- /component-group2 //-->
<br/><input type="submit" class="btn config_submitter" value="Save Changes" /><br/>
</div><!-- /config-components //-->
</form>
2014-10-21 19:09:01 +00:00
</div>
</div>
2014-03-10 05:18:05 +00:00
<div class="clearfix"></div>
<script type="text/javascript" charset="utf-8">
<!--
2015-05-07 00:36:40 +00:00
jQuery(' #config - components ' ).tabs();
jQuery(' #subtitles _dir ' ).fileBrowser( { title: ' Select Subtitles Download Directory ' });
2014-03-10 05:18:05 +00:00
//-->
</script>
2015-05-07 00:36:40 +00:00
#include $ os . path . join ( $ sickbeard . PROG_DIR , ' gui/slick/interfaces/default/inc_bottom.tmpl ' )