You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
4.0 KiB
108 lines
4.0 KiB
14 years ago
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AddNewSeriesModel>" %>
|
||
14 years ago
|
|
||
14 years ago
|
<%@ Import Namespace="NzbDrone.Web.Models" %>
|
||
|
<%@ Import Namespace="Telerik.Web.Mvc.UI" %>
|
||
14 years ago
|
<%@ Import Namespace="NzbDrone.Core.Repository" %>
|
||
14 years ago
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
||
|
Add New Series
|
||
14 years ago
|
<script type="text/javascript">
|
||
|
jQuery(document).ready(function () {
|
||
|
$('#searchButton').attr('disabled', '');
|
||
|
});
|
||
|
</script>
|
||
14 years ago
|
</asp:Content>
|
||
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
||
14 years ago
|
<div style="width: 60%">
|
||
14 years ago
|
<div style="display: inline">
|
||
14 years ago
|
<%= Html.Label("Enter a Series Name") %>
|
||
|
<%= Html.TextBox("new_series_name", String.Empty, new { id="new_series_id" }) %>
|
||
14 years ago
|
<button class="t.button" id="searchButton" disabled="disabled" onclick="searchSeries ()">
|
||
|
Search</button>
|
||
14 years ago
|
</div>
|
||
14 years ago
|
<div style="display: inline; float: right;">
|
||
14 years ago
|
<%= Html.LabelFor(m => m.QualityProfileId)%>
|
||
|
<%: Html.DropDownListFor(m => m.QualityProfileId, Model.QualitySelectList)%>
|
||
|
</div>
|
||
|
</div>
|
||
14 years ago
|
<div id="result">
|
||
|
</div>
|
||
|
<div id="RootDirectories" class="rootDirectories" style="display: none">
|
||
|
<fieldset>
|
||
|
<legend>Root TV Folders</legend>
|
||
|
<% int d = 0; %>
|
||
|
<% foreach (var dir in Model.RootDirectories)
|
||
|
{ %>
|
||
|
<%: Html.RadioButton("selectedRootDir", dir.Path, d ==0 , new { @class="dirList examplePart", id="dirRadio_" + d }) %>
|
||
|
<%: Html.Label(dir.Path) %>
|
||
|
<% } %>
|
||
|
</fieldset>
|
||
|
<div id="example">
|
||
|
</div>
|
||
|
<button class="t.button" onclick="addSeries ()">
|
||
|
Add New Series</button>
|
||
|
</div>
|
||
|
<div id="addResult">
|
||
|
</div>
|
||
14 years ago
|
<script type="text/javascript" language="javascript">
|
||
|
|
||
14 years ago
|
$('#new_series_id').bind('keydown', function (e) {
|
||
|
if (e.keyCode == 13) {
|
||
|
$('#searchButton').click();
|
||
|
}
|
||
|
});
|
||
14 years ago
|
|
||
14 years ago
|
function searchSeries() {
|
||
14 years ago
|
var seriesSearch = $('#new_series_id');
|
||
14 years ago
|
|
||
14 years ago
|
$("#result").text("Searching...");
|
||
14 years ago
|
|
||
14 years ago
|
$("#result").load('<%=Url.Action("SearchForSeries", "Series") %>', {
|
||
|
seriesName: seriesSearch.val()
|
||
14 years ago
|
});
|
||
14 years ago
|
|
||
|
document.getElementById('RootDirectories').style.display = 'inline';
|
||
14 years ago
|
}
|
||
14 years ago
|
|
||
14 years ago
|
function addSeries() {
|
||
|
//Get the selected tvdbid + selected root folder
|
||
|
//jquery bit below doesn't want to work...
|
||
14 years ago
|
|
||
14 years ago
|
var checkedSeries = $("input[name='selectedSeries']:checked").val();
|
||
|
//var checkedSeries = $('input.searchRadio:checked').val();
|
||
|
//var checkedSeries = $('input:radio[name=selectedSeries]:checked').val();
|
||
|
//var checkedSeries = $('input:radio[class=searchRadio]:checked').val();
|
||
14 years ago
|
|
||
14 years ago
|
var checkedDir = $("input[name='selectedRootDir']:checked").val();
|
||
|
|
||
|
var id = "#" + checkedSeries + "_text";
|
||
|
var seriesName = $(id).val();
|
||
14 years ago
|
var qualityProfileId = $("#QualityProfileId").val();
|
||
14 years ago
|
|
||
14 years ago
|
$("#addResult").load('<%=Url.Action("AddSeries", "Series") %>', {
|
||
14 years ago
|
dir: checkedDir,
|
||
|
seriesId: checkedSeries,
|
||
14 years ago
|
seriesName: seriesName,
|
||
|
qualityProfileId: qualityProfileId
|
||
14 years ago
|
});
|
||
14 years ago
|
}
|
||
14 years ago
|
|
||
|
//Need to figure out how to use 'ViewData["DirSep"]' instead of hardcoding '\'
|
||
|
$(".examplePart").live("change", function () {
|
||
|
var dir = $("input[name='selectedRootDir']:checked").val();
|
||
|
var series = $("input[name='selectedSeries']:checked").val();
|
||
|
|
||
|
var id = "#" + series + "_text";
|
||
|
var seriesName = $(id).val();
|
||
|
|
||
|
var sep = "\\";
|
||
|
|
||
14 years ago
|
var str = "Target: " + dir + sep + seriesName;
|
||
14 years ago
|
|
||
|
$('#example').text(str);
|
||
|
|
||
|
});
|
||
14 years ago
|
</script>
|
||
14 years ago
|
<div id="tester">
|
||
|
</div>
|
||
14 years ago
|
</asp:Content>
|