From 95402f3d4feba93725cc448e64522220975adc9f Mon Sep 17 00:00:00 2001 From: KZ Date: Wed, 29 Jul 2015 20:30:28 +0100 Subject: [PATCH] #93 Change IPT to be category aware and render availible categories to the front end. --- src/Jackett/Content/custom.css | 9 +++ src/Jackett/Content/custom.js | 17 ++---- src/Jackett/Content/index.html | 57 ++++++++++++------ src/Jackett/Controllers/AdminController.cs | 2 + src/Jackett/Indexers/BaseIndexer.cs | 14 +++++ src/Jackett/Indexers/IPTorrents.cs | 70 ++++++++++++++++++++-- src/Jackett/Models/TorznabCapabilities.cs | 13 +++- src/Jackett/Models/TorznabCatType.cs | 8 ++- src/Jackett/Models/TorznabCategory.cs | 11 +++- 9 files changed, 165 insertions(+), 36 deletions(-) diff --git a/src/Jackett/Content/custom.css b/src/Jackett/Content/custom.css index 1ac9fb8f7..56b458fde 100644 --- a/src/Jackett/Content/custom.css +++ b/src/Jackett/Content/custom.css @@ -210,4 +210,13 @@ hr { .modal-fillwidth { width: 1200px; +} + +.indexer-caps { + padding: 0px 15px 15px 15px; + border-top: 1px solid #e5e5e5; +} + +.indexer-caps table { + border-bottom: 1px solid #ddd; } \ No newline at end of file diff --git a/src/Jackett/Content/custom.js b/src/Jackett/Content/custom.js index 9cb3c4349..3ffc91b93 100644 --- a/src/Jackett/Content/custom.js +++ b/src/Jackett/Content/custom.js @@ -211,7 +211,7 @@ function displayIndexerSetup(id) { return; } - populateSetupForm(id, data.name, data.config); + populateSetupForm(id, data.name, data.config, data.caps); }).fail(function () { doNotify("Request to Jackett server failed", "danger", "glyphicon glyphicon-alert"); @@ -236,17 +236,12 @@ function populateConfigItems(configForm, config) { } } -function newConfigModal(title, config) { - //config-setup-modal - var configTemplate = Handlebars.compile($("#templates > .config-setup-modal")[0].outerHTML); - var configForm = $(configTemplate({ title: title })); - +function newConfigModal(title, config, caps) { + var configTemplate = Handlebars.compile($("#jackett-config-setup-modal").html()); + var configForm = $(configTemplate({ title: title, caps: caps })); $("#modals").append(configForm); - populateConfigItems(configForm, config); - return configForm; - //modal.remove(); } function getConfigModalJson(configForm) { @@ -267,8 +262,8 @@ function getConfigModalJson(configForm) { return configJson; } -function populateSetupForm(indexerId, name, config) { - var configForm = newConfigModal(name, config); +function populateSetupForm(indexerId, name, config, caps) { + var configForm = newConfigModal(name, config, caps); var $goButton = configForm.find(".setup-indexer-go"); $goButton.click(function () { var data = { indexer: indexerId, name: name }; diff --git a/src/Jackett/Content/index.html b/src/Jackett/Content/index.html index 7a4cfd93b..3ae4f9727 100644 --- a/src/Jackett/Content/index.html +++ b/src/Jackett/Content/index.html @@ -70,6 +70,45 @@ + + Jackett @@ -149,24 +188,6 @@
- -