2011-03-10 07:49:59 +00:00
|
|
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AddNewSeriesModel>" %>
|
2011-03-28 23:38:05 +00:00
|
|
|
|
2011-03-10 07:49:59 +00:00
|
|
|
<%@ Import Namespace="NzbDrone.Web.Models" %>
|
|
|
|
<%@ Import Namespace="Telerik.Web.Mvc.UI" %>
|
2011-03-17 07:40:23 +00:00
|
|
|
<%@ Import Namespace="NzbDrone.Core.Repository" %>
|
2011-03-10 07:49:59 +00:00
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
|
|
|
Add New Series
|
2011-03-17 07:40:23 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
jQuery(document).ready(function () {
|
|
|
|
$('#searchButton').attr('disabled', '');
|
|
|
|
});
|
|
|
|
</script>
|
2011-03-10 07:49:59 +00:00
|
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
2011-03-28 20:22:12 +00:00
|
|
|
<div style="width: 60%">
|
2011-03-28 23:38:05 +00:00
|
|
|
<div style="display: inline">
|
2011-03-28 20:22:12 +00:00
|
|
|
<%= Html.Label("Enter a Series Name") %>
|
|
|
|
<%= Html.TextBox("new_series_name", String.Empty, new { id="new_series_id" }) %>
|
2011-03-28 23:38:05 +00:00
|
|
|
<button class="t.button" id="searchButton" disabled="disabled" onclick="searchSeries ()">
|
|
|
|
Search</button>
|
2011-03-28 20:22:12 +00:00
|
|
|
</div>
|
2011-03-28 23:38:05 +00:00
|
|
|
<div style="display: inline; float: right;">
|
2011-03-28 20:22:12 +00:00
|
|
|
<%= Html.LabelFor(m => m.QualityProfileId)%>
|
|
|
|
<%: Html.DropDownListFor(m => m.QualityProfileId, Model.QualitySelectList)%>
|
|
|
|
</div>
|
|
|
|
</div>
|
2011-03-28 23:38:05 +00:00
|
|
|
<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>
|
2011-03-11 09:04:56 +00:00
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
2011-03-17 07:40:23 +00:00
|
|
|
$('#new_series_id').bind('keydown', function (e) {
|
|
|
|
if (e.keyCode == 13) {
|
|
|
|
$('#searchButton').click();
|
|
|
|
}
|
|
|
|
});
|
2011-03-11 09:04:56 +00:00
|
|
|
|
2011-03-17 07:40:23 +00:00
|
|
|
function searchSeries() {
|
2011-03-28 23:38:05 +00:00
|
|
|
var seriesSearch = $('#new_series_id');
|
2011-03-11 09:04:56 +00:00
|
|
|
|
2011-03-17 07:40:23 +00:00
|
|
|
$("#result").text("Searching...");
|
2011-03-29 00:12:48 +00:00
|
|
|
|
2011-03-11 09:04:56 +00:00
|
|
|
$("#result").load('<%=Url.Action("SearchForSeries", "Series") %>', {
|
|
|
|
seriesName: seriesSearch.val()
|
2011-03-17 07:40:23 +00:00
|
|
|
});
|
2011-03-29 00:12:48 +00:00
|
|
|
|
|
|
|
document.getElementById('RootDirectories').style.display = 'inline';
|
2011-03-17 07:40:23 +00:00
|
|
|
}
|
2011-03-28 23:38:05 +00:00
|
|
|
|
2011-03-17 07:40:23 +00:00
|
|
|
function addSeries() {
|
|
|
|
//Get the selected tvdbid + selected root folder
|
|
|
|
//jquery bit below doesn't want to work...
|
2011-03-11 09:04:56 +00:00
|
|
|
|
2011-03-17 07:40:23 +00:00
|
|
|
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();
|
2011-03-11 09:04:56 +00:00
|
|
|
|
2011-03-17 07:40:23 +00:00
|
|
|
var checkedDir = $("input[name='selectedRootDir']:checked").val();
|
|
|
|
|
|
|
|
var id = "#" + checkedSeries + "_text";
|
|
|
|
var seriesName = $(id).val();
|
2011-03-28 20:22:12 +00:00
|
|
|
var qualityProfileId = $("#QualityProfileId").val();
|
2011-03-17 07:40:23 +00:00
|
|
|
|
2011-04-01 06:36:34 +00:00
|
|
|
$("#addResult").load('<%=Url.Action("AddSeries", "Series") %>', {
|
2011-03-17 07:40:23 +00:00
|
|
|
dir: checkedDir,
|
|
|
|
seriesId: checkedSeries,
|
2011-03-28 20:22:12 +00:00
|
|
|
seriesName: seriesName,
|
|
|
|
qualityProfileId: qualityProfileId
|
2011-03-17 07:40:23 +00:00
|
|
|
});
|
2011-03-11 09:04:56 +00:00
|
|
|
}
|
2011-03-17 07:40:23 +00:00
|
|
|
|
|
|
|
//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 = "\\";
|
|
|
|
|
2011-03-28 23:38:05 +00:00
|
|
|
var str = "Target: " + dir + sep + seriesName;
|
2011-03-17 07:40:23 +00:00
|
|
|
|
|
|
|
$('#example').text(str);
|
|
|
|
|
|
|
|
});
|
2011-03-11 09:04:56 +00:00
|
|
|
</script>
|
2011-03-28 23:38:05 +00:00
|
|
|
<div id="tester">
|
|
|
|
</div>
|
2011-03-10 07:49:59 +00:00
|
|
|
</asp:Content>
|