diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 3dfa2420..b2cb59d9 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -1,6 +1,7 @@ m<%inherit file="base.html"/> <%! import headphones + import string %> <%def name="headerIncludes()"> @@ -505,9 +506,30 @@ m<%inherit file="base.html"/>
Miscellaneous
- - -
+ + +
+ %for extra in config['extras']: + ${string.capwords(extra)}
+ %endfor +
+
@@ -707,6 +729,13 @@ m<%inherit file="base.html"/> } }; + function openExtrasDialog() { + $("#dialog").dialog({ close: function(){ + var elem = ''; + doAjaxCall('configUpdate', elem,'tabs',true); + }}).dialog("open"); + }; + function initThisPage() { @@ -830,6 +859,25 @@ m<%inherit file="base.html"/> $(this).parent().parent().remove(); deletedNewznabs = deletedNewznabs + 1; }); + + $("#modify_extras").click(openExtrasDialog); + + $("#include_extras").click(function(){ + if ($("#include_extras").is(":checked")){ + openExtrasDialog(); + } + }); + + %for extra in config['extras']: + $("#${extra}_temp").click(function(){ + if ($(this).is(":checked")){ + $("#${extra}").attr("checked", true); + } + else { + $("${extra}").attr("checked", false); + } + }); + %endfor $("#add_newznab").click(function() { var intId = $("#newznab_providers > div").size() + deletedNewznabs + 1; diff --git a/headphones/webserve.py b/headphones/webserve.py index 944c51bd..38e61e9d 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -610,12 +610,13 @@ class WebInterface(object): headphones.EXTRA_NEWZNABS.append((newznab_host, newznab_api, newznab_enabled)) - # Convert the extras to list then string + # Convert the extras to list then string. Coming in as 0 or 1 temp_extras_list = [] - extras_list = [ single, ep, compilation, soundtrack, live, remix, spokenword, audiobook] + extras_list = [single, ep, compilation, soundtrack, live, remix, spokenword, audiobook] i = 1 for extra in extras_list: + print repr(extra) if extra: temp_extras_list.append(i) i+=1