Files
headphones/data/interfaces/brink/config.html
2012-07-05 15:13:18 +02:00

947 lines
30 KiB
HTML

<%inherit file="base.html"/>
<%!
import headphones
%>
<%def name="headIncludes()">
<script type="text/javascript" src="../interfaces/brink/js/configscript.js"></script>
</%def>
<%def name="headerIncludes()">
</%def>
<%def name="body()">
<form id="config" action="configUpdate" method="post">
<div id="config_wrapper"><!--config_wrapper-->
<div id="WebInterface"><!--Web Interface-->
<h1><span>C</span>Web Interface</h1>
<h3><span>W</span>Web Interface changes require a restart to take effect</h3>
<div>
<table><!--HTTP-->
<tr>
<td>
<h2>HTTP</h2>
<h3>Basic settings for Headphones.</h3>
</td>
<td></td>
</tr>
<tr>
<td>
<label for="http_host">Host:</label>
<h3>Localhost or 0.0.0.0</h3>
</td>
<td>
<input type="text" name="http_host" value="${config['http_host']}" size="25" maxlength="40" />
</td>
</tr>
<tr>
<td>
<label for="http_port">Port:</label>
<h3>Default is: 8181</h3>
</td>
<td>
<input type="text" name="http_port" value="${config['http_port']}" size="10" maxlength="40" />
</td>
</tr>
<tr>
<td>
<label for="http_username">Username:</label>
<h3>Enter a desired username at login, or leave blank for none.</p>
</td>
<td>
<input type="text" name="http_username" value="${config['http_user']}" size="30" maxlength="40" />
</td>
</tr>
<tr>
<td>
<label for="http_password">Password:</label>
<h3>Enter a desired password at login, or leave blank for none.</h3>
</td>
<td>
<input type="password" name="http_password" value="${config['http_pass']}" size="30" maxlength="40" />
</td>
</tr>
<tr>
<td>
<label for="launch_browser">Launch browser:</label><br />
<h3>Enabling this feature will open Headphones at startup.</h3>
</td>
<td>
<input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']} />
</td>
</tr>
<!--end Startup-->
<!--Layout/Theme-->
<tr>
<td><label for="interface">Interface:</label>
<h3>Choose from a verity of different themes</h3>
</td>
<td>
<select name="interface">
%for interface in config['interface_list']:
<%
if interface == headphones.INTERFACE:
selected = 'selected="selected"'
else:
selected = ''
%>
<option value="${interface}" ${selected}>
${interface}
</option>
%endfor
</select>
</td>
</tr>
<!--end layout-->
<!--API-->
<tr>
<td><h2>API:</h2>
<h3><label for="api_enabled">Enabled/Disabled</label></h3></td>
<td><input class="switch" type="checkbox" name="api_enabled" id="api_enabled" value="1" ${config['api_enabled']} /></td>
</tr>
<tr>
<td>
<h3>Visit <a href="https://github.com/rembo10/headphones/tree/" target="_blank"><span>D</span>repo</a> for more information.</h3>
</td>
<td>
<input type="text" name="api_key" value="${config['api_key']}" size="30"><input class="submit" type="button" value="Generate" id="generate_api">
</td>
</tr>
<!--end API-->
<!--Interval-->
<tr>
<td><h2><span>P</span>Scan Intervals</h2></td>
</tr>
<!--NZB Scan-->
<tr>
<td>
<label for="nzb_search_interval">NZB Search:</label>
<h3><label id="nzb_search_interval"></label></h3>
</td>
<td>
<div class="sliderInterval" for="nzb_search_interval"></div>
</td>
<td>
<input type="text" name="nzb_search_interval" value="${config['nzb_search_interval']}" size="2" maxlength="10" />
</td>
<td>
</td>
</tr>
<!--end NZB scan-->
<!--Download Scan-->
<tr>
<td>
<label for="download_scan_interval">Download folder scan every: </label>
<h3><label id="download_scan_interval"></label></h3>
</td>
<td>
<div class="sliderInterval" for="download_scan_interval"></div>
</td>
<td>
<input type="text" name="download_scan_interval" value="${config['download_scan_interval']}" size="2" maxlength="10" />
</td>
</tr>
<!--end Download Scan-->
<!--Library Scan-->
<tr>
<td><label for="library_scan_interval">Library scan:</label>
<h3><label id="libraryscan_interval"></label></h3>
</td>
<td>
<div class="sliderInterval" for="libraryscan_interval"></div>
</td>
<td>
<input type="text" name="libraryscan_interval" value="${config['libraryscan_interval']}" size="2" maxlength="10" />
</td>
</tr>
<!--end Interval-->
</table><!--end HTTP-->
</div>
</div>
<!--end Web Interface-->
<!--Download Settings-->
<div>
<h1><span>u</span>Download Settings</h1>
<h3>Setup SABnzbd or BitTorrent</h3>
<!--Sabnzdb-->
<div>
<table>
<tr>
<td>
<h2>SABnzbd</h2>
<h3></h3>
</td>
<td></td>
</tr>
<tr>
<td><label for="sab_host">Host:</label>
<h3>Usually http://localhost:8080</h3>
</td>
<td><input type="text" name="sab_host" value="${config['sab_host']}" size="30" maxlength="40" /></td>
</tr>
<tr>
<td><label for="sab_username">Username:</label>
<h3>Type the user name for SABnzbd</h3>
</td>
<td><input type="text" name="sab_username" value="${config['sab_user']}" size="20" maxlength="40" /></td>
</tr>
<tr>
<td><label for="sab_password">Password:</label>
<h3>Enter the password for SABnzbd</h3>
</td>
<td><input type="password" name="sab_password" value="${config['sab_pass']}" size="20" maxlength="40" /></td>
</tr>
<tr>
<td><label for="sab_apikey">API key:</label></td>
<td><input type="text" name="sab_apikey" value="${config['sab_api']}" size="36" maxlength="40" /></td>
</tr>
<tr>
<td><label for="sab_category">Category:</label>
<h3>Write the category label name from SABnzbd</h3>
</td>
<td><input type="text" name="sab_category" value="${config['sab_cat']}" size="20" maxlength="40" /></td>
</tr>
<tr>
<td>
<label for="download_dir">Download Directory:</label>
<h3>Full path to the directory where SAB downloads your music.</h3>
</td>
<td><input type="text" name="download_dir" value="${config['download_dir']}" size="40" /></td>
</tr>
</table>
</div>
<!--end Sabnzdb-->
<!--Torrents-->
<div>
<table>
<tr>
<td><h2><span>~</span>Torrents</h2></td>
<td></td>
</tr>
<tr>
<td>
<label for="blackhole_dir">Black Hole Directory:</label>
<h3>Folder your Download program watches for NZBs</h3>
</td>
<td>
<input type="text" name="blackhole_dir" value="${config['blackhole_dir']}" size="40" />
</td>
</tr>
<tr>
<td><label for="usenet_retention">Usenet Retention:</label>
<h3>Binary retention time</h3>
</td>
<td><input type="text" name="usenet_retention" value="${config['usenet_retention']}" size="5" maxlength="10" /></td>
</tr>
<tr>
<td>
<label for="torrentblackhole_dir">Black Hole Directory:</label>
<h3>Folder your Download program watches for Torrents</h3>
</td>
<td>
<input type="text" name="torrentblackhole_dir" value="${config['torrentblackhole_dir']}" size="40">
</td>
</tr>
<tr>
<td><label for="numberofseeders">Minimum seeders:</label>
<h3>Number of minimum seeders a torrent must have to be accepted</h3>
</td>
<td><input type="text" name="numberofseeders" value="${config['numberofseeders']}" size="5" /></td>
</tr>
<tr>
<td>
<label for="download_torent_dir">Music Download Directory:</label>
<h3>Full path to the directory where your torrent client downloads your music <br />i.e. /Users/name/Downloads/music</h3>
</td>
<td><input type="text" name="download_torrent_dir" value="${config['download_torrent_dir']}" size="40" /></td>
</tr>
</table>
</div>
<!--end Torrents-->
</div>
<!--end Download Settings-->
<div><!--Search Providers-->
<h1><span>L</span>Search Providers</h1>
<h3>"We provide you with a automated search service to locate binary files/secgments that can be found on the public access network called Usenet."</h3>
<!--NZB Matrix-->
<table id="nzbmatrix">
<tr>
<td>
<h2><a href="http://www.nzbmatrix.com" target="_blank"><span>D</span>NZBMatrix</a></h2>
<h3><label for="nzbmatrix">Enabled/Disabled</label></h3>
</td>
<td><input class="switch" type="checkbox" name="nzbmatrix" value="1" ${config['use_nzbmatrix']} /></td>
</tr>
<tr>
<td><label for="nzbmatrix_username">Username:</label></td>
<td><input type="text" name="nzbmatrix_username" value="${config['nzbmatrix_user']}" size="30" maxlength="40" /></td>
</tr>
<tr>
<td><label for="nzbmatrix_apikey">API:</label></td>
<td><input type="text" name="nzbmatrix_apikey" value="${config['nzbmatrix_api']}" size="36" maxlength="40" /></td>
</tr>
</table>
<!--end NZB Matrix-->
<!--Newznab-->
<table id="newznab" class="configtable">
<tr>
<td>
<h2><a href="http://www.newznab.com/" target="_blank"><span>D</span>Newznab</a></h2>
<h3><label for="newznab">Enabled/Disabled</label></h3>
</td>
<td><input class="switch" type="checkbox" name="newznab" value="1" ${config['use_newznab']} /></td>
</tr>
<tr>
<td><label for="newznab_host">Host:</label></td>
<td><input type="text" name="newznab_host" value="${config['newznab_host']}" size="30" maxlength="40" /></td>
</tr>
<tr>
<td><label for="newznab_apikey">API:</label></td>
<td><input type="text" name="newznab_apikey" value="${config['newznab_api']}" size="36" maxlength="40" /></td>
</tr>
</table>
<!--end Newznab-->
<!--NZBs.org-->
<table>
<tr>
<td>
<h2><a href="http://nzbs.org/" target="_blank"><span>D</span>Nzbs</a></h2>
<h3></h3>
</td>
<td><input class="switch" type="checkbox" name="nzbsorg" value="1" ${config['use_nzbsorg']} /><h3><label for="nzbsorg"></label></h3></td>
</tr>
</table>
<table id="nzbsorg">
<tr>
<td><label for="nzbsorg_hash">API Key:</label></td>
<td><input type="text" name="nzbsorg_hash" value="${config['nzbsorg_hash']}" size="30" maxlength="40"></td>
</tr>
</table>
<!--end NZBs.org-->
<!--Newzbin-->
<table>
<tr>
<td>
<h2><a href="http://www.newsbin.com/" target="_blank"><span>D</span>Newzbin</a></h2>
<h3><label for="newzbin">Enabled/Disabled</label></h3>
</td>
<td>
<input class="switch" type="checkbox" name="newzbin" value="1" ${config['use_newzbin']} />
</td>
</tr>
</table>
<table id="newsbin" class="configtable">
<tr>
<td><label for="newzbin_uid">UID:</label></td>
<td><input type="text" name="newzbin_uid" value="${config['newzbin_uid']}" size="30" maxlength="40" /></td>
</tr>
<tr>
<td><label for="newzbin_password">Password:</label></td>
<td><input type="text" name="newzbin_password" value="${config['newzbin_pass']}" size="36" maxlength="40" /></td>
</tr>
</table>
<!--end Newzbin-->
<!--Torrents-->
<table>
<tr>
<td>
<h2>BitTorrent:</h2>
<h3>A peer-to-peer file sharing (P2P) communications protocol</h3>
</td>
<td>
<input type="checkbox" name="use_isohunt" value="1" ${config['use_isohunt']} />
<label for="use_isohunt">Isohunt</label>
<br /><br />
<input type="checkbox" name="use_mininova" value="1" ${config['use_mininova']} />
<label for="use_mininova">Mininova</label>
<br /><br />
<input type="checkbox" name="use_kat" value="1" ${config['use_kat']} />
<label for="use_kat">Kick Ass Torrents:</label>
</td>
</tr>
</table>
<!--end Torrents-->
</div>
<!--end Search Providers-->
<!--Quality-->
<div id="Quality">
<h1><span>I</span>Quality & Post Processing</h1>
<h3></h3>
<table id="AlbumQuality">
<tr>
<td><h2>Album Quality:</h2>
<h3></h3>
</td>
<td></td>
</tr>
<tr>
<td><label for="prefered_quality">Prefered Quality:</label></td>
<td>
<input type="radio" name="preferred_quality" id="QualityExcluding" value="0" ${config['pref_qual_0']} />
<label for="QualityExcluding">Highest Quality excl. Lossless</label>
<br /><br />
<input type="radio" name="preferred_quality" id="QualityIncluding" value="1" ${config['pref_qual_1']} />
<label for="QualityIncluding">Highest Quality incl. Lossless</label>
<br /><br />
<input type="radio" name="preferred_quality" id="QualityLossless" value="2" ${config['pref_qual_2']} />
<label for="QualityLossless">Lossless Only</label>
<br /><br />
<input type="radio" name="preferred_quality" id="QualityPreferred" value="3" ${config['pref_qual_3']} />
<label for="QualityPreferred">Preferred Bitrate:
<input type="text" name="preferred_bitrate" value="${config['pref_bitrate']}" size="3" maxlength="5" />kbps
</label>
</td>
</tr>
<tr>
<td><label for="detect_bitrate">Auto-Detect Preferred Bitrate </label></td>
<td><input type="checkbox" name="detect_bitrate" value="1" ${config['detect_bitrate']} /></td>
</tr>
</table>
<!--PostProcessing-->
<table class="configtable">
<tr>
<td><h2>Post Processing:</h2>
<h3></h3>
</td>
<td>
<input type="checkbox" name="move_files" value="1" ${config['move_files']} />
<label for="move_files">Move Downloads</label>
<br /><br />
<input type="checkbox" name="rename_files" value="1" ${config['rename_files']} />
<label for="rename_files">Rename files</label>
<br /><br />
<input type="checkbox" name="correct_metadata" value="1" ${config['correct_metadata']} />
<label for="correct_metadata">Correct metadata</label>
<br /><br />
<input type="checkbox" name="cleanup_files" value="1" ${config['cleanup_files']} />
<label for="cleanup_files">Delete leftover files (.m3u, .nfo, .sfv, .nzb, etc.):</label>
<br /><br />
<input type="checkbox" name="add_album_art" value="1" ${config['add_album_art']} />
<label for="add_album_art">Add album art as 'folder.jpg' to album folder</label>
<br /><br />
<input type="checkbox" name="embed_album_art" value="1" ${config['embed_album_art']} />
<label for="embed_album_art">Embed album art in each file</label>
<br /><br />
<input type="checkbox" name="embed_lyrics" value="1" ${config['embed_lyrics']} />
<label for="embed_lyrics">Embed lyrics</label>
</td>
</tr>
<tr>
<td><label for="destination_dir">Music Folder:</label>
<h3>i.e. /Users/name/Music/iTunes or /Volumes/share/music</h3>
</td>
<td><input type="text" name="destination_dir" value="${config['dest_dir']}" size="40" /></td>
</tr>
</table><!--end PostProcessing-->
</div><!--end Quality-->
<div id="AdvancedSettings"><!--AdvancedSettings-->
<h1><span>S</span>Advanced Settings</h1>
<div><!--Renaming-->
<table class="configtable">
<tr>
<td><h2><span>T</span>Renaming</h2></td>
</tr>
<tr>
<td><label for="folder_format">Folder Format:</label>
<h3>Use: $Artist/$artist, $Album/$album, $Year/$year, $Type/$type (release type) and $First/$first (first letter in artist name) <br />
E.g.: $Type/$First/$artist/$album [$year] = Album/G/girl talk/all day [2010]</h3>
</td>
<td><input type="text" name="folder_format" value="${config['folder_format']}" size="43" /></td>
</tr>
<tr>
<td><label for="file_format">File Format:</label>
<h3>Use: $Track/$track (track #), $Title/$title, $Artist/$artist, $Album/$album and $Year/$year</h3>
</td>
<td><input type="text" name="file_format" value="${config['file_format']}" size="43" /></td>
</tr>
</table>
</div><!--end Renaming-->
<div><!--Miscellaneous-->
<table id="Miscellaneous" class="configtable">
<tr>
<td><h2><span>F</span>Miscellaneous</h2>
<h3>Customize what HP</h3>
</td>
<td></td>
</tr>
<tr>
<td>
<h2>Automatically:</h2>
<h3>EPs, Compilations, Live Albums, Remix Albums and Singles</h3>
</td>
<td>
<input type="checkbox" name="include_extras" value="1" ${config['include_extras']} />
<label for="include_extras">Include Extras When Adding an Artist</label>
<br /><br />
<input type="checkbox" name="autowant_upcoming" value="1" ${config['autowant_upcoming']} />
<label for="autowant_upcoming">Mark Upcoming Albums as Wanted</label>
<br /><br />
<input type="checkbox" name="autowant_all" value="1" ${config['autowant_all']} />
<label for="autowant_all">Mark All Albums as Wanted </label>
</td>
</tr>
<!--Logs-->
<tr>
<td>
<label for="log_dir">Log Directory:</label>
</td>
<td>
<input type="text" name="log_dir" value="${config['log_dir']}" size="40" />
</td>
</tr><!--end Logs-->
</table>
</div><!--end Miscellaneous-->
<!--Re-Encoding Options-->
<div id="Re-EncodingOptions">
<h2>Re-Encoding Options</h2>
<h3>Re-encode downloads during postprocessing.<br />This option requires the lame or ffmpeg encoder.</h3>
<div><!--Encoder Options-->
<table id="encoderoptions">
<tr>
<td><h2>Encoder Options</h2></td>
</tr>
<tr>
<td><label for="encoderlossless">Only re-encode lossless files (.flac)</label></td>
<td>
<input type="checkbox" name="encoderlossless" value="1" ${config['encoderlossless']} />
<%
if config['encoder'] == 'lame':
lameselect = 'selected="selected"'
ffmpegselect = ''
else:
lameselect = ''
ffmpegselect = 'selected="selected"'
%>
</td>
</tr>
<tr>
<td><label for="encoder">Encoder:</label></td>
<td>
<select name="encoder">
<option value="lame" ${lameselect}>lame</option>
<option value="ffmpeg" ${ffmpegselect}>ffmpeg</option>
</select>
</td>
</tr>
<tr>
<td><label for="encoderoutputformat">Format:</label></td>
<td>
<select name="encoderoutputformat">
%for x in ['mp3', 'ogg', 'm4a']:
<%
if config['encoderoutputformat'] == x:
outputselect = 'selected'
else:
outputselect = ''
%>
<option value="${x}" ${outputselect}>${x}</option>
%endfor
</select>
</td>
</tr>
</table>
</div><!--end Encoder Options-->
<div><!--Audio Properties-->
<h2>Audio Properties</h2>
<!--VBR/CBR-->
<table class="configtable">
<tr>
<td><label for="encodervbrcbr">VBR/CBR:</label></td>
<td><select name="encodervbrcbr">
%for x in ['cbr', 'vbr']:
<%
if config['encodervbrcbr'] == x:
outputselect = 'selected'
else:
outputselect = ''
%>
<option value=${x} ${outputselect}>${x}</option>
%endfor
</select></td>
</tr><!--end VBR/CBR-->
<tr><!--Quality-->
<td><label for="encoderquality">Quality:</label></td>
<td><select name="encoderquality">
%for x in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
<%
if config['encoderquality'] == x:
outputselect = 'selected'
else:
outputselect = ''
%>
<option value=${x} ${outputselect}>${x}</option>
%endfor
</select></td>
</tr><!--end quality-->
<!--Bitrate-->
<tr>
<td><label for="bitrate">Bitrate:</label></td>
<td><select name="bitrate">
%for x in [64, 128, 192, 256, 320]:
<%
if config["bitrate"] == x:
bitrateselected = "selected"
else:
bitrateselected = ''
%>
<option value=${x} ${bitrateselected}> ${x} kbps</option>
%endfor
</select>
<%
if config["samplingfrequency"] == 44100:
freq44100 = 'selected="selected"'
freq48000 = ''
else:
freq44100 = ''
freq48000 = 'selected="selected"'
%></td>
</tr><!--end Bitrate-->
<!--Samplings-->
<tr>
<td><label>Sampling: </label></td>
<td><select name="samplingfrequency">
<option value=44100 ${freq44100}>44.1 kHz</option>
<option value=48000 ${freq48000}>48.0 kHz</option>
</select></td>
</tr><!--end Samplings-->
<!--Advanced Encoding-->
<tr>
<td>
<label>Advanced Encoding Options:</label>
<h3>Ignores audio properties</h3>
</td>
<td><input type="text" name="advancedencoder" value="${config['advancedencoder']}" size="43" /></td>
</tr>
<tr>
<td><label>Path to Encoder:</label></td>
<td><input type="text" name="encoderfolder" value="${config['encoderfolder']}" size="43" /></td>
</tr><!--end Advanced Encoding-->
</table>
</div><!--Audio Properties-->
</div><!--Re-Encoding Options-->
<!--Notifications-->
<div id="Notifications">
<h1><span>W</span>Notifications</h1>
<h3></h3>
<!--Prowl-->
<table>
<tr>
<td><h2>Prowl Options</h2>
<h3><label for="prowl_enabled">Enabled/Disabled</label></h3>
</td>
<td><input class="switch" type="checkbox" name="prowl_enabled" id="prowl" value="1" ${config['prowl_enabled']} /></td>
</tr>
</table>
<table id="prowloptions">
<tr>
<td><label for="prowl_keys">API key:</label></td>
<td><input type="text" name="prowl_keys" value="${config['prowl_keys']}" size="50" /></td>
</tr>
<tr>
<td><label for="prowl_onsnatch">Notify on snatch</label></td>
<td><input type="checkbox" name="prowl_onsnatch" value="1" ${config['prowl_onsnatch']} /></td>
</tr>
<tr><td><label for="prowl_priority">Priority (-2,-1,0,1 or 2):</label></td>
<td><input type="text" name="prowl_priority" value="${config['prowl_priority']}" size="2"></td>
</tr>
</table><!--end Prowl-->
<!--XBMC-->
<table>
<tr>
<td><h2>XBMC</h2>
<h3><label for="xbmc_enabled">Enabled/Disabled</label></h3>
</td>
<td><input class="switch" type="checkbox" name="xbmc_enabled" id="xbmc" value="1" ${config['xbmc_enabled']} /></td>
</tr>
</table>
<table id="xbmcoptions">
<tr>
<td><label for="xbmc_host">XBMC Host:</label>
<h3>e.g. http://localhost:8080. Separate hosts with commas</h3>
</td>
<td><input type="text" name="xbmc_host" value="${config['xbmc_host']}" size="30">
</td>
</tr>
<tr>
<td><label>XBMC Username:</label></td>
<td><input type="text" name="xbmc_username" value="${config['xbmc_username']}" size="30"></td>
</tr>
<tr>
<td><label>XBMC Password:</label></td>
<td><input type="password" name="xbmc_password" value="${config['xbmc_password']}" size="30"></td>
</tr>
<tr>
<td><label>Update XBMC Library:</label></td>
<td><input type="checkbox" name="xbmc_update" value="1" ${config['xbmc_update']} /></td>
</tr>
<tr>
<td><label>Send Notification to XBMC:</label></td>
<td><input type="checkbox" name="xbmc_notify" value="1" ${config['xbmc_notify']} /></td>
</tr>
</table><!--end XBMC-->
<!--NMA Options-->
<table>
<tr>
<td>
<h2>Notify My Android</h2>
<h3><label for="nma_enabled">Enabled/Disabled</label></h3>
</td>
<td><input class="switch" type="checkbox" name="nma_enabled" id="nma" value="1" ${config['nma_enabled']} /></td>
</tr>
</table>
<table id="nmaoptions">
<tr>
<td><label for="nma_apikey">NotifyMyAndroid API Key:</label>
<h3>Separate multiple api keys with ",".</h3>
</td>
<td><input type="text" name="nma_apikey" value="${config['nma_apikey']}" size="30"></td>
</tr>
<tr>
<td><a href="https://play.google.com/store/apps/details?id=com.usk.app.notifymyandroid">Get NotifyMyAndroid</a></td>
</tr>
<!--Priority-->
<tr>
<td><label for="nma_priority">Priority:</label></td>
<td>
<select name="nma_priority">
%for x in [-2,-1,0,1,2]:
<%
if config['nma_priority'] == x:
nma_priority_selected = 'selected'
else:
nma_priority_selected = ''
if x == -2:
nma_priority_value = 'Very Low'
elif x == -1:
nma_priority_value = 'Moderate'
elif x == 0:
nma_priority_value = 'Normal'
elif x == 1:
nma_priority_value = 'High'
else:
nma_priority_value = 'Emergency'
%>
<option value=${x} ${nma_priority_selected}>${nma_priority_value}</option>
%endfor
</select>
</td>
</tr><!--end Priority-->
</table><!--end NMA Options-->
</div><!--end Notifications-->
<!--Mirror-->
<div id="Mirror">
<h2><span>K</span>Mirror</h2>
<!--Musicbrainz-->
<table>
<tr>
<td><label for="mirror">Musicbrainz Mirror:</label></td>
<td>
<select name="mirror" id="mirror">
%for mirror in config['mirror_list']:
<%
if mirror == headphones.MIRROR:
selected = 'selected="selected"'
else:
selected = ''
%>
<option value="${mirror}" ${selected}>${mirror}</option>
%endfor
</select>
</td>
</tr>
</table><!--end Musicbrainz-->
<!--Custom options-->
<table id="customoptions">
<tr><td colspan="2"><h2>Custom Options</h2></td></tr>
<tr>
<td><label for="customhost">Host:</label></td>
<td><input type="text" name="customhost" value="${config['customhost']}" size="20"></td>
</tr>
<tr>
<td><label for="customport">Port:</label></td>
<td><input type="text" name="customport" value="${config['customport']}" size="8"></td>
</tr>
<tr>
<td><label for="customsleep">Sleep Interval:</label></td>
<td><input type="text" name="customsleep" value="${config['customsleep']}" size="4"></td>
</tr>
</table>
<!--end Custom options-->
<!--Hp server options-->
<table id="hpserver">
<tr>
<td><h2>Headphones Server</h2>
<h3><a href="http://headphones.codeshy.com/vip" target="_blank"><span>D</span>Get an Account</a></h3>
</td>
<td></td>
</tr>
<tr>
<td><label for="hpuser">Username:</label></td>
<td><input type="text" name="hpuser" value="${config['hpuser']}" size="20"></td>
</tr>
<tr>
<td><label for="hppass">Password:</label></td>
<td><input type="password" name="hppass" value="${config['hppass']}" size="15"></td>
</tr>
</table>
<!--end hp server options-->
</div><!--End mirror-->
</div><!--end AdvancedSettings-->
<input type="submit" value="Save Changes" />
</div><!--end config wrapper-->
</form>
</%def>
<%def name="javascriptIncludes()">
<script>
$(document).ready(function(){
//nzbs.org
function nzbsorg(){
if( $('input[name="nzbsorg"]').is(":checked") ){
$("table#nzbsorg").show();
enit();
}
else {
$("table#nzbsorg").hide();
enit();
}
}
nzbsorg();
$('input[name="nzbsorg"]').change(function(){
nzbsorg();
});
//end nzbs.org
//Newzbin
function newzbin(){
if( $('input[name="newzbin"]').is(":checked") ){
$("table#newsbin").show();
enit();
}
else {
$("table#newsbin").hide();
enit();
}
}
newzbin();
$('input[name="newzbin"]').change(function(){
newzbin();
});
//end Newzbin
//Prowl
function prowl(){
if( $('input[name="prowl_enabled"]').is(":checked") ){
$("table#prowloptions").show();
enit();
}
else {
$("table#prowloptions").hide();
enit();
}
}
prowl();
$('input[name="prowl_enabled"]').change(function(){
prowl();
});
//end Prowl
//XBMC
function xbmc(){
if( $('input[name="xbmc_enabled"]').is(":checked") ) {
$("table#xbmcoptions").show();
enit();
} else {
$("table#xbmcoptions").hide();
enit();
}
}
xbmc();
$('input[name="xbmc_enabled"]').change(function(){
xbmc();
});
//end XBMC
//NMA
function nma(){
if( $("#nma").is(":checked") ){
$("#nmaoptions").show();
enit();
} else {
$("#nmaoptions").hide();
enit();
}
}
$("#nma").change(function(){
nma();
});
//end NMA
//Mirrors
function mirror(){
var value = $("#mirror").val();
if( value == "musicbrainz.org" ){
$("table#customoptions").hide();
$("table#hpserver").hide();
enit();
} else if ( value == "headphones" ){
$("table#customoptions").hide();
$("table#hpserver").show();
enit();
} else if ( value == "custom" ){
$("table#customoptions").show();
$("table#hpserver").hide();
enit();
}
}
mirror();
$("#mirror").change(function(){
mirror();
});
//end Mirrors
enit();
});
</script>
</%def>