diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index af29bd968..005585fd1 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -614,18 +614,10 @@ + + - - - - - - - - - - - + Designer @@ -667,6 +659,14 @@ + + + + + + + + diff --git a/NzbDrone.Web/Views/AddSeries/AddNew.cshtml b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml index c1c5ba653..54e6a41e6 100644 --- a/NzbDrone.Web/Views/AddSeries/AddNew.cshtml +++ b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml @@ -57,7 +57,7 @@ var seriesSearch = $('#new_series_id'); $("#result").text("Searching..."); - $("#result").load('<%=Url.Action("SearchForSeries", "Series")%>', { + $("#result").load('@Url.Action("SearchForSeries", "Series")', { seriesName: seriesSearch.val() }); @@ -71,7 +71,7 @@ var seriesName = $(id).val(); var qualityProfileId = $("#QualityProfileId").val(); - $("#addResult").load('<%=Url.Action("AddSeries", "Series")%>', { + $("#addResult").load('@Url.Action("AddSeries", "AddSeries")', { dir: checkedDir, seriesId: checkedSeries, seriesName: seriesName, 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/Shared/Error.aspx b/NzbDrone.Web/Views/Shared/Error.aspx deleted file mode 100644 index 26b89d445..000000000 --- a/NzbDrone.Web/Views/Shared/Error.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> - - EPIC FAIL!!! - - -

- <%:Model.Exception.Message%> -

-
- <%:Model.Exception.ToString()%> -
diff --git a/NzbDrone.Web/Views/Shared/Error.cshtml b/NzbDrone.Web/Views/Shared/Error.cshtml new file mode 100644 index 000000000..0afa1dc46 --- /dev/null +++ b/NzbDrone.Web/Views/Shared/Error.cshtml @@ -0,0 +1,15 @@ +@model System.Web.Mvc.HandleErrorInfo + +@section TitleContent +{ + EPIC FAIL!!! +} + +@section MainContent +{ +

+ @Model.Exception.Message +

+
+ @Model.Exception.ToString() +} \ No newline at end of file