diff --git a/NzbDrone.Core/Providers/QualityProvider.cs b/NzbDrone.Core/Providers/QualityProvider.cs index e7ced8ee8..8be07272e 100644 --- a/NzbDrone.Core/Providers/QualityProvider.cs +++ b/NzbDrone.Core/Providers/QualityProvider.cs @@ -21,9 +21,9 @@ namespace NzbDrone.Core.Providers _sonicRepo = sonicRepo; } - public virtual void Add(QualityProfile profile) + public virtual int Add(QualityProfile profile) { - _sonicRepo.Add(profile); + return Convert.ToInt32(_sonicRepo.Add(profile)); } public virtual void Update(QualityProfile profile) diff --git a/NzbDrone.Core/Repository/Episode.cs b/NzbDrone.Core/Repository/Episode.cs index e0992d5e4..39e4e0daa 100644 --- a/NzbDrone.Core/Repository/Episode.cs +++ b/NzbDrone.Core/Repository/Episode.cs @@ -24,9 +24,9 @@ namespace NzbDrone.Core.Repository public string Language { get; set; } public EpisodeStatusType Status { get; set; } - public DayOfWeek? LastInfoSync { get; set; } + public DateTime? LastInfoSync { get; set; } - public DayOfWeek? LastDiskSync { get; set; } + public DateTime? LastDiskSync { get; set; } [SubSonicToOneRelation(ThisClassContainsJoinKey = true)] public virtual Season Season { get; set; } diff --git a/NzbDrone.Web/Content/style.css b/NzbDrone.Web/Content/style.css index 1e0e80e92..7f44c4fa0 100644 --- a/NzbDrone.Web/Content/style.css +++ b/NzbDrone.Web/Content/style.css @@ -268,3 +268,9 @@ button, input[type="button"], input[type="submit"], input[type="reset"] { width: 400px; } + +/* Set the font size for Grids */ +.Grid +{ + font-size: 13px; +} \ No newline at end of file diff --git a/NzbDrone.Web/Controllers/AddSeriesController.cs b/NzbDrone.Web/Controllers/AddSeriesController.cs index 6e6182309..cee3db2c5 100644 --- a/NzbDrone.Web/Controllers/AddSeriesController.cs +++ b/NzbDrone.Web/Controllers/AddSeriesController.cs @@ -94,7 +94,6 @@ namespace NzbDrone.Web.Controllers "QualityProfileId", "Name", defaultQuality); - ; return PartialView("AddSeriesItem", suggestions); } diff --git a/NzbDrone.Web/Controllers/HistoryController.cs b/NzbDrone.Web/Controllers/HistoryController.cs index 8b526ba49..02977f0bf 100644 --- a/NzbDrone.Web/Controllers/HistoryController.cs +++ b/NzbDrone.Web/Controllers/HistoryController.cs @@ -38,7 +38,10 @@ namespace NzbDrone.Web.Controllers [GridAction] public ActionResult _AjaxBinding() { - var history = _historyProvider.AllItems().Select(h => new HistoryModel + + //TODO: possible subsonic bug, IQuarible causes some issues so ToList() is called + + var history = _historyProvider.AllItems().ToList().Select(h => new HistoryModel { HistoryId = h.HistoryId, SeasonNumber = h.Episode.SeasonNumber, @@ -47,11 +50,13 @@ namespace NzbDrone.Web.Controllers EpisodeOverview = h.Episode.Overview, SeriesTitle = h.Episode.Series.Title, NzbTitle = h.NzbTitle, - Quality = h.Quality.ToString("G"), + Quality = h.Quality.ToString(), IsProper = h.IsProper, Date = h.Date }); + history.ToList(); + return View(new GridModel(history)); } } diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index 017f7db44..18acf4a13 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -69,22 +69,15 @@ namespace NzbDrone.Web.Controllers var episodes = _episodeProvider.GetEpisodeBySeason(seasonId).Select(c => new EpisodeModel { EpisodeId = c.EpisodeId, - EpisodeNumber = - c.EpisodeNumber, - SeasonNumber = - c.SeasonNumber, + EpisodeNumber = c.EpisodeNumber, + SeasonNumber = c.SeasonNumber, Title = c.Title, Overview = c.Overview, AirDate = c.AirDate, - Path = - GetEpisodePath( - c.EpisodeFile), - Quality = - c.EpisodeFile == null + Path = GetEpisodePath(c.EpisodeFile), + Quality = c.EpisodeFile == null ? String.Empty - : c.EpisodeFile. - Quality. - ToString() + : c.EpisodeFile.Quality.ToString() }); return View(new GridModel(episodes)); } diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 15c4a13a4..7505c71f5 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -210,7 +210,35 @@ namespace NzbDrone.Web.Controllers ViewData["Qualities"] = qualityTypes; - return View("UserProfileSection", new QualityProfile { Name = "New Profile", UserProfile = true }); + var qualityProfile = new QualityProfile + { + Name = "New Profile", + UserProfile = true, + Allowed = new List {QualityTypes.Unknown}, + Cutoff = QualityTypes.Unknown, + }; + + var id = _qualityProvider.Add(qualityProfile); + qualityProfile.QualityProfileId = id; + qualityProfile.Allowed = null; + + ViewData["ProfileId"] = id; + + return View("UserProfileSection", qualityProfile); + } + + public ActionResult GetQualityProfileView(QualityProfile profile) + { + var qualityTypes = new List(); + + foreach (QualityTypes qual in Enum.GetValues(typeof(QualityTypes))) + { + qualityTypes.Add(qual); + } + ViewData["Qualities"] = qualityTypes; + ViewData["ProfileId"] = profile.QualityProfileId; + + return PartialView("UserProfileSection", profile); } public ViewResult AddRootDir() @@ -233,6 +261,21 @@ namespace NzbDrone.Web.Controllers return new QualityModel { DefaultQualityProfileId = defaultQualityQualityProfileId, SelectList = selectList }; } + public JsonResult DeleteQualityProfile(int profileId) + { + try + { + _qualityProvider.Delete(profileId); + } + + catch (Exception) + { + return new JsonResult { Data = "failed" }; + } + + return new JsonResult { Data = "ok" }; + } + [HttpPost] public ActionResult SaveGeneral(SettingsModel data) { @@ -343,12 +386,6 @@ namespace NzbDrone.Web.Controllers if (data.UserProfiles == null) return Content(SETTINGS_SAVED); - foreach (var dbProfile in _qualityProvider.GetAllProfiles().Where(q => q.UserProfile)) - { - if (!data.UserProfiles.Exists(p => p.QualityProfileId == dbProfile.QualityProfileId)) - _qualityProvider.Delete(dbProfile.QualityProfileId); - } - foreach (var profile in data.UserProfiles) { Logger.Debug(String.Format("Updating User Profile: {0}", profile)); @@ -365,14 +402,9 @@ namespace NzbDrone.Web.Controllers return Content("Error Saving Settings, please fix any errors"); //profile.Cutoff = profile.Allowed.Last(); - if (profile.QualityProfileId > 0) - _qualityProvider.Update(profile); - - else - _qualityProvider.Add(profile); - - return Content(SETTINGS_SAVED); + _qualityProvider.Update(profile); } + return Content(SETTINGS_SAVED); } return Content(SETTINGS_FAILED); diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index ed8d6dda5..fa91d0073 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -631,17 +631,9 @@ + + - - - - - - - - - - Designer @@ -659,8 +651,6 @@ - - @@ -678,11 +668,20 @@ - + + + + + + + + + + diff --git a/NzbDrone.Web/NzbDrone.Web.csproj.orig b/NzbDrone.Web/NzbDrone.Web.csproj.orig new file mode 100644 index 000000000..a7c07c9be --- /dev/null +++ b/NzbDrone.Web/NzbDrone.Web.csproj.orig @@ -0,0 +1,854 @@ + + + + Debug + AnyCPU + + + 2.0 + {43BD3BBD-1531-4D8F-9C08-E1CD544AB2CD} + {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + NzbDrone.Web + NzbDrone.Web + v4.0 + true + false + + false + + + true + full + false + Bin\ + DEBUG;TRACE + prompt + 4 + AnyCPU + false + true + false + true + + + pdbonly + true + bin\ + TRACE + prompt + 4 + true + false + + + + ..\NzbDrone.Core\Libraries\Castle.Core.dll + + + True + + + False + ..\packages\Ninject.2.2.1.0\lib\.NetFramework 4.0\Ninject.dll + + + + + D:\My Dropbox\Git\NzbDrone\NzbDrone.Core\Libraries\SubSonic.Core.dll + + + + + + ..\NzbDrone.Core\Libraries\System.Data.SQLite.dll + True + + + + + + + 3.5 + + + + + True + + + True + + + True + + + True + + + True + + + True + + + + + + + + ..\packages\TelerikMvcExtensions.2011.1.315\lib\net40\Telerik.Web.Mvc.dll + + + True + + + True + + + ..\NzbDrone.Core\Libraries\TvdbLib.dll + + + + + True + True + EditorLocalization.bg-BG.resx + + + True + True + EditorLocalization.de-DE.resx + + + True + True + EditorLocalization.en-US.resx + + + True + True + EditorLocalization.fr-FR.resx + + + True + True + EditorLocalization.pl-PL.resx + + + True + True + EditorLocalization.pt-BR.resx + + + True + True + EditorLocalization.ru-RU.resx + + + True + True + EditorLocalization.uk-UA.resx + + + True + True + GridLocalization.bg-BG.resx + + + True + True + GridLocalization.de-DE.resx + + + True + True + GridLocalization.en-US.resx + + + True + True + GridLocalization.es-ES.resx + + + True + True + GridLocalization.fr-FR.resx + + + True + True + GridLocalization.pl-PL.resx + + + True + True + GridLocalization.pt-BR.resx + + + True + True + GridLocalization.pt-PT.resx + + + True + True + GridLocalization.ru-RU.resx + + + True + True + GridLocalization.uk-UA.resx + + + True + True + UploadLocalization.bg-BG.resx + + + True + True + UploadLocalization.en-US.resx + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<<<<<<< HEAD + + + + + + + + + + +======= +>>>>>>> markus101 + + Designer + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205} + NzbDrone.Core + + + + + Designer + + + + + + + + GlobalResourceProxyGenerator + UploadLocalization.en-US.designer.cs + + + + + GlobalResourceProxyGenerator + UploadLocalization.bg-BG.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.uk-UA.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.ru-RU.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.pt-PT.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.pt-BR.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.pl-PL.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.fr-FR.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.es-ES.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.en-US.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.de-DE.designer.cs + + + + + GlobalResourceProxyGenerator + GridLocalization.bg-BG.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.uk-UA.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.ru-RU.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.pt-BR.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.pl-PL.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.fr-FR.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.en-US.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.de-DE.designer.cs + + + + + GlobalResourceProxyGenerator + EditorLocalization.bg-BG.designer.cs + + + + + + + + + + + + + True + + + + + \ No newline at end of file diff --git a/NzbDrone.Web/Views/AddSeries/AddExisting.aspx b/NzbDrone.Web/Views/AddSeries/AddExisting.aspx deleted file mode 100644 index eabe101b0..000000000 --- a/NzbDrone.Web/Views/AddSeries/AddExisting.aspx +++ /dev/null @@ -1,44 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage>" %> - - Add Existing Series - - - <% - if (Model.Count() == 0) - Html.DisplayText("No Series to Add"); -%> - - <%:Html.DropDownList("masterDropbox", (SelectList) ViewData["qualities"], - new {style = "width: 100px;", id = "masterDropboxId"})%> - - <%: - @Html.Telerik().DropDownList().Name("tester").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes( - new {style = "width: 100px", @class = "qualityDropbox"})%> - - - - <% - foreach (var path in Model) - { - Html.RenderAction("RenderPartial", "AddSeries", new {path}); - } - -%> - - - - \ No newline at end of file diff --git a/NzbDrone.Web/Views/AddSeries/AddExisting.cshtml b/NzbDrone.Web/Views/AddSeries/AddExisting.cshtml new file mode 100644 index 000000000..3c6e98df7 --- /dev/null +++ b/NzbDrone.Web/Views/AddSeries/AddExisting.cshtml @@ -0,0 +1,35 @@ +@model IEnumerable + +@section TitleContent{ + Add Existing Series +} + +@section MainContent{ + + @if (Model.Count() == 0) + { + @Html.DisplayText("No Series to Add"); + } + + @Html.DropDownList("masterDropbox", (SelectList) ViewData["qualities"], + new {style = "width: 100px;", id = "masterDropboxId"}) + + @Html.Telerik().DropDownList().Name("tester").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes( + new {style = "width: 100px", @class = "qualityDropbox"}) + + @foreach (var path in Model) + { + Html.RenderAction("RenderPartial", "AddSeries", new {path}); + } + + +} \ No newline at end of file diff --git a/NzbDrone.Web/Views/AddSeries/AddNew.aspx b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml similarity index 58% rename from NzbDrone.Web/Views/AddSeries/AddNew.aspx rename to NzbDrone.Web/Views/AddSeries/AddNew.cshtml index 995b545c8..54e6a41e6 100644 --- a/NzbDrone.Web/Views/AddSeries/AddNew.aspx +++ b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml @@ -1,48 +1,50 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> - +@model NzbDrone.Web.Models.AddNewSeriesModel + +@section TitleContent{ Add New Series + - - +} + +@section MainContent{
- <%=Html.Label("Enter a Series Name")%> - <%=Html.TextBox("new_series_name", String.Empty, new {id = "new_series_id"})%> + @Html.Label("Enter a Series Name") + @Html.TextBox("new_series_name", String.Empty, new {id = "new_series_id"})
- <%=Html.LabelFor(m => m.QualityProfileId)%> - <%:Html.DropDownListFor(m => m.QualityProfileId, Model.QualitySelectList)%> + @Html.LabelFor(m => m.QualityProfileId) + @Html.DropDownListFor(m => m.QualityProfileId, Model.QualitySelectList)
-
-
+ +
+ -
-
+ +
+ -
-
-
+} \ No newline at end of file diff --git a/NzbDrone.Web/Views/History/Index.aspx b/NzbDrone.Web/Views/History/Index.cshtml similarity index 60% rename from NzbDrone.Web/Views/History/Index.aspx rename to NzbDrone.Web/Views/History/Index.cshtml index c4d4c1b08..51747ccaf 100644 --- a/NzbDrone.Web/Views/History/Index.aspx +++ b/NzbDrone.Web/Views/History/Index.cshtml @@ -1,7 +1,7 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage>" %> -<%@ Import Namespace="NzbDrone.Web.Models" %> +@model List +@using NzbDrone.Web.Models - +@section Scripts{ - - +} + +@section TitleContent{ History - - - <% - Html.Telerik().Menu().Name("historyMenu").Items(items => - { - items.Add().Text("Trim History").Action("Trim", - "History"); - items.Add().Text("Purge History").Action("Purge", - "History"); - }).Render(); -%> - - - <% - Html.Telerik().Grid().Name("history") +} + +@section ActionMenu{ + @{Html.Telerik().Menu().Name("historyMenu").Items(items => + { + items.Add().Text("Trim History").Action("Trim", "History"); + items.Add().Text("Purge History").Action("Purge", "History"); + }).Render();} +} + +@section MainContent{ + @{Html.Telerik().Grid().Name("history") .Columns(columns => { columns.Bound(c => c.SeriesTitle).Title("Series Name").Width(120); @@ -61,6 +59,5 @@ c.PageSize(50).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious)) //.Filterable() //.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) - .Render(); -%> - + .Render();} +} \ No newline at end of file diff --git a/NzbDrone.Web/Views/Log/Index.aspx b/NzbDrone.Web/Views/Log/Index.cshtml similarity index 63% rename from NzbDrone.Web/Views/Log/Index.aspx rename to NzbDrone.Web/Views/Log/Index.cshtml index f68469054..f8aa1c182 100644 --- a/NzbDrone.Web/Views/Log/Index.aspx +++ b/NzbDrone.Web/Views/Log/Index.cshtml @@ -1,6 +1,5 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage>" %> - - +@model IEnumerable +@section Scripts{ - - - Logs - - - <% - Html.Telerik().Menu().Name("logMenu").Items(items => items.Add().Text("Clear Logs").Action("Clear", "Log")). - Render(); - %> - - - <% - Html.Telerik().Grid(Model).Name("logs") +} +@section TitleContent{ +Logs +} +@section ActionMenu{ + @{Html.Telerik().Menu().Name("logMenu").Items(items => items.Add().Text("Clear Logs").Action("Clear", "Log")) + .Render();} +} +@section MainContent{ + @{Html.Telerik().Grid(Model).Name("logsGrid") + .TableHtmlAttributes(new { @class = "Grid" }) .Columns(columns => { columns.Bound(c => c.Time).Title("Time").Width(190); @@ -40,7 +37,8 @@ }) .DetailView(detailView => detailView.ClientTemplate( "
<#= Logger #>
" + - "
<#= ExceptionString #>
" + "
<#= ExceptionType #>
" + + "
<#= Exception #>
" )).DataBinding(data => data.Ajax().Select("_AjaxBinding", "Log")) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Time).Descending()).Enabled(true)) .Pageable( @@ -48,6 +46,5 @@ c.PageSize(50).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious)) .Filterable() .ClientEvents(c => c.OnRowDataBound("onRowDataBound")) - .Render(); - %> -
+ .Render();} +} diff --git a/NzbDrone.Web/Views/Series/Details.aspx b/NzbDrone.Web/Views/Series/Details.cshtml similarity index 82% rename from NzbDrone.Web/Views/Series/Details.aspx rename to NzbDrone.Web/Views/Series/Details.cshtml index 0ce7b7c69..2de7aa9ad 100644 --- a/NzbDrone.Web/Views/Series/Details.aspx +++ b/NzbDrone.Web/Views/Series/Details.cshtml @@ -1,12 +1,14 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> -<%@ Import Namespace="NzbDrone.Core.Repository" %> -<%@ Import Namespace="NzbDrone.Web.Models" %> - - <%:Model.Title%> - - - <% - Html.Telerik().Menu().Name("SeriesMenu").Items(items => +@model NzbDrone.Core.Repository.Series +@using NzbDrone.Core.Repository +@using NzbDrone.Web.Models + +@section TitleContent{ + @Model.Title +} + +@section ActionMenu{ + + @{Html.Telerik().Menu().Name("SeriesMenu").Items(items => { items.Add().Text("Edit").Action("Edit", "Series", new @@ -31,49 +33,47 @@ Model. SeriesId }); - }).Render(); -%> - - + }).Render();} +} + +@section MainContent{ +
ID
- <%:Model.SeriesId%>
+ @Model.SeriesId
Overview
- <%:Model.Overview%>
+ @Model.Overview
Status
- <%:Model.Status%>
+ @Model.Status
AirTimes
- <%:Model.AirTimes%>
+ @Model.AirTimes
Language
- <%:Model.Language.ToUpper()%>
+ @Model.Language.ToUpper()
Location
- <%:Model.Path%>
+ @Model.Path
- <% - //Todo: This breaks when using SQLServer... thoughts? - //Normal Seasons - foreach (var season in Model.Seasons.Where(s => s.SeasonNumber > 0).Reverse()) + @*Todo: This breaks when using SQLServer... thoughts?*@ + + @foreach (var season in Model.Seasons.Where(s => s.SeasonNumber > 0).Reverse()) { -%> +
-

- Season - <%:season.SeasonNumber%>

- <% +

Season @season.SeasonNumber

Season season1 = season; Html.Telerik().Grid().Name("seasons_" + season.SeasonNumber) + .TableHtmlAttributes(new { @class = "Grid" }) .Columns(columns => { columns.Bound(o => o.EpisodeId) @@ -107,17 +107,16 @@ } //Specials - var specialSeasons = Model.Seasons.Where(s => s.SeasonNumber == 0).FirstOrDefault(); + @{var specialSeasons = Model.Seasons.Where(s => s.SeasonNumber == 0).FirstOrDefault();} - if (specialSeasons != null) + @if (specialSeasons != null) { -%> +

Specials

- <% - Html.Telerik().Grid(specialSeasons.Episodes).Name("seasons_specials") + .TableHtmlAttributes(new { @class = "Grid" }) .Columns(columns => { columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode"); @@ -129,14 +128,13 @@ .Footer(false) .Render(); } -%> -
- - - +} diff --git a/NzbDrone.Web/Views/Series/Edit.aspx b/NzbDrone.Web/Views/Series/Edit.aspx deleted file mode 100644 index 9290a69a5..000000000 --- a/NzbDrone.Web/Views/Series/Edit.aspx +++ /dev/null @@ -1,115 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> - - - Edit - - - - - - - - - -

<%:Html.DisplayTextFor(model => model.Title)%>

- - <% - Html.EnableClientValidation();%> - <% - using (Html.BeginForm("Edit", "Series", FormMethod.Post, new {id = "form", name = "form"})) - {%> - -
- Edit - -
- <%:Html.LabelFor(model => model.Path)%> -
-
- <%:Html.TextBoxFor(model => model.Path)%> - <%:Html.ValidationMessageFor(model => model.Path)%> -
- -
- <%:Html.LabelFor(model => model.Monitored)%> -
-
- <%:Html.CheckBoxFor(model => model.Monitored)%> - <%:Html.ValidationMessageFor(model => model.Monitored)%> -
- -
- <%:Html.LabelFor(model => model.SeasonFolder)%> -
-
- <%:Html.CheckBoxFor(model => model.SeasonFolder)%> - <%:Html.ValidationMessageFor(model => model.SeasonFolder)%> -
- -
- <%:Html.LabelFor(model => model.QualityProfileId)%> -
-
- <%:Html.DropDownListFor(model => model.QualityProfileId, (SelectList) ViewData["SelectList"])%> - <%:Html.ValidationMessageFor(model => model.QualityProfileId)%> -
- - - -

- -

-
- <% - }%> - -
- <%:Html.ActionLink("Back to Show", "Details", new {seriesId = Model.SeriesId})%> | - <%:Html.ActionLink("Back to List", "Index")%> - <%:Html.ActionLink("Delete Series", "Delete", new {seriesId = Model.SeriesId})%> -
- -
- -
- - - - - - - - - - diff --git a/NzbDrone.Web/Views/Series/Edit.cshtml b/NzbDrone.Web/Views/Series/Edit.cshtml new file mode 100644 index 000000000..8346c013f --- /dev/null +++ b/NzbDrone.Web/Views/Series/Edit.cshtml @@ -0,0 +1,98 @@ +@model NzbDrone.Core.Repository.Series + +@section TitleContent{ + Edit +} + +@section Scripts{ + +} + +@section MainContent{ +

@Html.DisplayTextFor(model => model.Title)

+ + @using (Html.BeginForm("Edit", "Series", FormMethod.Post, new { id = "form", name = "form" })) + { + +
+ Edit + +
+ @Html.LabelFor(model => model.Path) +
+
+ @Html.TextBoxFor(model => model.Path) + @Html.ValidationMessageFor(model => model.Path) +
+ +
+ @Html.LabelFor(model => model.Monitored) +
+
+ @Html.CheckBoxFor(model => model.Monitored) + @Html.ValidationMessageFor(model => model.Monitored) +
+ +
+ @Html.LabelFor(model => model.SeasonFolder) +
+
+ @Html.CheckBoxFor(model => model.SeasonFolder) + @Html.ValidationMessageFor(model => model.SeasonFolder) +
+ +
+ @Html.LabelFor(model => model.QualityProfileId) +
+
+ @Html.DropDownListFor(model => model.QualityProfileId, (SelectList) ViewData["SelectList"]) + @Html.ValidationMessageFor(model => model.QualityProfileId) +
+ + + +

+ +

+
+ } + +
+ @Html.ActionLink("Back to Show", "Details", new {seriesId = Model.SeriesId}) | + @Html.ActionLink("Back to List", "Index") + @Html.ActionLink("Delete Series", "Delete", new {seriesId = Model.SeriesId}) +
+ +
+} \ No newline at end of file diff --git a/NzbDrone.Web/Views/Series/Index.cshtml b/NzbDrone.Web/Views/Series/Index.cshtml new file mode 100644 index 000000000..6c55cf444 --- /dev/null +++ b/NzbDrone.Web/Views/Series/Index.cshtml @@ -0,0 +1,27 @@ +@model IEnumerable + +@section TitleContent{ + Series +} + +@section ActionMenu{ + @{Html.RenderPartial("SubMenu");} +} + +@section MainContent{ + @{Html.Telerik().Grid(Model).Name("Grid") + .TableHtmlAttributes(new { @class = "Grid" }) + .Columns(columns => + { + columns.Template(c => @Html.ActionLink(c.Title ?? "New Series", "Details", + new {seriesId = c.SeriesId}) + ).Title("Title"); + columns.Bound(o => o.Seasons.Count).Title("Seasons"); + columns.Bound(o => o.QualityProfile.Name).Title("Quality"); + columns.Bound(o => o.Status); + columns.Bound(o => o.AirsDayOfWeek); + columns.Bound(o => o.Path); + }) + .Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(false)) + .Render();} +} diff --git a/NzbDrone.Web/Views/Series/SeriesSearchResults.ascx b/NzbDrone.Web/Views/Series/SeriesSearchResults.ascx deleted file mode 100644 index e2bc6a17a..000000000 --- a/NzbDrone.Web/Views/Series/SeriesSearchResults.ascx +++ /dev/null @@ -1,30 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl>" %> -
-
- Search Results - <% - if (Model.Count == 0) - {%> - No results found for the series name - <% - } -%> - <% - int r = 0;%> - <% - foreach (var result in Model) - {%> - <%:Html.RadioButton("selectedSeries", result.TvDbId, r == 0, - new {@class = "searchRadio examplePart", id = "searchRadio_" + r})%> - - <%:result.TvDbName + " (" + result.FirstAired.ToShortDateString()%>) - <%:Html.TextBox(result.TvDbName + "_text", result.TvDbName, - new {id = result.TvDbId + "_text", style = "display:none"})%> - <% - - r++;%> -
- <% - }%> -
-
diff --git a/NzbDrone.Web/Views/Series/SeriesSearchResults.cshtml b/NzbDrone.Web/Views/Series/SeriesSearchResults.cshtml new file mode 100644 index 000000000..ee5f5297b --- /dev/null +++ b/NzbDrone.Web/Views/Series/SeriesSearchResults.cshtml @@ -0,0 +1,30 @@ +@model List + +
+
+ Search Results + @if (Model.Count == 0) + { + No results found for the series name + } + + @{var open = "(";} + @{var close = ")";} + @{int r = 0;} + @foreach (var result in Model) + { + @Html.RadioButton("selectedSeries", result.TvDbId, r == 0, + new {@class = "searchRadio examplePart", id = "searchRadio_" + r}) + + + @result.TvDbName @open @result.FirstAired.ToShortDateString() @close + + +
+ + @Html.TextBox(result.TvDbName + "_text", result.TvDbName, new { id = result.TvDbId + "_text", style = "display:none" }) + r++; + } + +
+
diff --git a/NzbDrone.Web/Views/Series/SubMenu.ascx b/NzbDrone.Web/Views/Series/SubMenu.ascx deleted file mode 100644 index cfa5edc81..000000000 --- a/NzbDrone.Web/Views/Series/SubMenu.ascx +++ /dev/null @@ -1,21 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> -<%@ Import Namespace="NzbDrone.Web.Controllers" %> -<% - Html.Telerik().Menu().Name("telerikGrid").Items(items => - { - items.Add().Text("Add Series") - .Items( - subItem => - subItem.Add().Text("New Series").Action - (c => c.AddNew())) - .Items( - subItem => - subItem.Add().Text("Existing Series").Action - (c => c.AddExisting())); - - items.Add().Text("Start RSS Sync").Action( - c => c.RssSync()); - items.Add().Text("Rename All").Action( - c => c.RenameAll()); - }).Render(); -%> \ No newline at end of file diff --git a/NzbDrone.Web/Views/Series/SubMenu.cshtml b/NzbDrone.Web/Views/Series/SubMenu.cshtml new file mode 100644 index 000000000..020c5e754 --- /dev/null +++ b/NzbDrone.Web/Views/Series/SubMenu.cshtml @@ -0,0 +1,17 @@ +@using NzbDrone.Web.Controllers + +@{Html.Telerik().Menu().Name("telerikGrid").Items(items => + { + items.Add().Text("Add Series") + .Items( + subItem => + subItem.Add().Text("New Series").Action(c => c.AddNew())) + .Items( + subItem => + subItem.Add().Text("Existing Series").Action(c => c.AddExisting())); + + items.Add().Text("Start RSS Sync").Action( + c => c.RssSync()); + items.Add().Text("Rename All").Action( + c => c.RenameAll()); + }).Render();} \ No newline at end of file diff --git a/NzbDrone.Web/Views/Series/index.aspx b/NzbDrone.Web/Views/Series/index.aspx deleted file mode 100644 index a72599ec3..000000000 --- a/NzbDrone.Web/Views/Series/index.aspx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage>" %> - - Series - - - <% - Html.RenderPartial("SubMenu"); -%> - - - <% - Html.Telerik().Grid(Model) - .Name("Grid") - .Columns(columns => - { - columns.Template(c => - { -%> - <%:Html.ActionLink(c.Title ?? "New Series", - "Details", - new {seriesId = c.SeriesId})%> - <% - }).Title("Title"); - columns.Bound(o => o.Seasons.Count).Title("Seasons"); - columns.Bound(o => o.QualityProfile.Name).Title("Quality"); - columns.Bound(o => o.Status); - columns.Bound(o => o.AirsDayOfWeek); - columns.Bound(o => o.Path); - }) - .Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(false)) - .Render(); -%> - diff --git a/NzbDrone.Web/Views/Settings/Quality.cshtml b/NzbDrone.Web/Views/Settings/Quality.cshtml index c65215dc9..4fe3b6a28 100644 --- a/NzbDrone.Web/Views/Settings/Quality.cshtml +++ b/NzbDrone.Web/Views/Settings/Quality.cshtml @@ -49,11 +49,10 @@
- - @foreach (var item in Model.UserProfiles) - { - Html.RenderPartial("UserProfileSection", item); - } + @foreach (var item in Model.UserProfiles) + { + Html.RenderAction("GetQualityProfileView", item); + }
@@ -77,8 +76,27 @@ return false; }); - $("a.deleteRow").live("click", function () { - $(this).parents("div.userProfileSectionEditor:first").remove(); - return false; - }); +// $("a.deleteRow").live("click", function () { +// $(this).parents("div.userProfileSectionEditor:first").remove(); +// return false; + // }); + + var deleteQualityProfileUrl = '@Url.Action("DeleteQualityProfile", "Settings")'; + + function deleteProfile(id) { + //$(this).parents("div.userProfileSectionEditor:first").remove(); + sendToServer(id); + $("#div_" + id).hide(); + } + + function sendToServer(id) { + $.ajax({ + type: "POST", + url: deleteQualityProfileUrl, + data: jQuery.param({ profileId: id }), + error: function (req, status, error) { + alert("Sorry! We could not add " + path + " at this time. " + error); + } + }); + } \ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/RootDir.cshtml b/NzbDrone.Web/Views/Settings/RootDir.cshtml index b1f2da5ee..5ebe8ed1f 100644 --- a/NzbDrone.Web/Views/Settings/RootDir.cshtml +++ b/NzbDrone.Web/Views/Settings/RootDir.cshtml @@ -1,5 +1,9 @@ @model NzbDrone.Core.Repository.RootDir @using NzbDrone.Web.Helpers; + +@{ + Layout = null; +}