1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 01:38:24 +00:00

Removed Edit page and Delete (w/o AJAX) from Series Controller.

Series grid now shows seasons count without counting season 0 (specials).
This commit is contained in:
Mark McDowall 2011-05-11 22:21:48 -07:00
parent d97382ad0c
commit c5ea0dee17
5 changed files with 2 additions and 133 deletions

View file

@ -228,29 +228,6 @@ public ActionResult Details(int seriesId)
return View(series);
}
public ActionResult Edit(int seriesId)
{
var profiles = _qualityProvider.GetAllProfiles();
ViewData["SelectList"] = new SelectList(profiles, "QualityProfileId", "Name");
var series = _seriesProvider.GetSeries(seriesId);
return View(series);
}
[HttpPost]
public ActionResult Edit(Series series)
{
//Need to add seriesProvider.Update
_seriesProvider.UpdateSeries(series);
return Content("Series Updated Successfully");
}
public ActionResult Delete(int seriesId)
{
_jobProvider.BeginExecute(typeof(DeleteSeriesJob), seriesId);
return RedirectToAction("Index", "Series");
}
public ActionResult SyncEpisodesOnDisk(int seriesId)
{
//Syncs the episodes on disk for the specified series
@ -317,7 +294,7 @@ private List<SeriesModel> GetSeriesModels(List<Series> seriesInDb)
Path = s.Path,
QualityProfileId = s.QualityProfileId,
QualityProfileName = s.QualityProfile.Name,
SeasonsCount = s.Seasons.Count,
SeasonsCount = s.Seasons.Where(x => x.SeasonNumber > 0).Count(),
SeasonFolder = s.SeasonFolder,
Status = s.Status
}));

View file

@ -687,7 +687,6 @@
<Content Include="Views\Log\index.cshtml" />
<Content Include="Views\Upcoming\Index.cshtml" />
<Content Include="Views\Series\Details.cshtml" />
<Content Include="Views\Series\Edit.cshtml" />
<Content Include="Views\Series\Index.cshtml" />
<Content Include="Views\Series\SubMenu.cshtml" />
<Content Include="Views\Series\SeriesSearchResults.cshtml" />

View file

@ -7,12 +7,6 @@
@section ActionMenu{
@{Html.Telerik().Menu().Name("SeriesMenu").Items(items =>
{
items.Add().Text("Edit").Action("Edit", "Series",
new
{
seriesId =
Model.SeriesId
});
items.Add().Text("Back to Series List").Action("Index",
"Series");
items.Add().Text("Scan For Episodes on Disk").Action(

View file

@ -1,98 +0,0 @@
@model NzbDrone.Core.Repository.Series
@section TitleContent{
Edit
}
@section Scripts{
<script type="text/javascript">
$(document).ready(function () {
var options = {
target: '#result',
beforeSubmit: showRequest,
success: showResponse,
type: 'post',
resetForm: false
};
$('#form').ajaxForm(options);
$('#save_button').attr('disabled', '');
});
function showRequest(formData, jqForm, options) {
$("#result").empty().html('Saving Series...');
$("#form :input").attr("disabled", true);
}
function showResponse(responseText, statusText, xhr, $form) {
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
}
</script>
}
@section MainContent{
<h2>@Html.DisplayTextFor(model => model.Title)</h2>
@using (Html.BeginForm("Edit", "Series", FormMethod.Post, new { id = "form", name = "form" }))
{
<fieldset>
<legend>Edit</legend>
<div class="editor-label">
@Html.LabelFor(model => model.Path)
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.Path, new { style = "width: 250" })
@Html.ValidationMessageFor(model => model.Path)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Monitored)
</div>
<div class="editor-field">
@Html.CheckBoxFor(model => model.Monitored)
@Html.ValidationMessageFor(model => model.Monitored)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.SeasonFolder)
</div>
<div class="editor-field">
@Html.CheckBoxFor(model => model.SeasonFolder)
@Html.ValidationMessageFor(model => model.SeasonFolder)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.QualityProfileId)
</div>
<div class="editor-field">
@Html.DropDownListFor(model => model.QualityProfileId, (SelectList) ViewData["SelectList"])
@Html.ValidationMessageFor(model => model.QualityProfileId)
</div>
<div class="hidden" style="display:none;">
@Html.TextBoxFor(model => model.SeriesId)
@Html.TextBoxFor(model => model.Title)
@Html.TextBoxFor(model => model.CleanTitle)
@Html.TextBoxFor(model => model.Status)
@Html.TextBoxFor(model => model.Overview)
@Html.TextBoxFor(model => model.AirsDayOfWeek)
@Html.TextBoxFor(model => model.AirTimes)
@Html.TextBoxFor(model => model.Language)
</div>
<p>
<input type="submit" id="save_button" value="Save" disabled="disabled" />
</p>
</fieldset>
}
<div>
@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})
</div>
<div id="result"></div>
}

View file

@ -13,10 +13,7 @@
@section MainContent{
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
.TableHtmlAttributes(new { @class = "Grid" })
.DataKeys(keys =>
{
keys.Add(p => p.SeriesId);
})
.DataKeys(keys => keys.Add(p => p.SeriesId))
.DataBinding(data => data.Ajax()
.Select("_AjaxSeriesGrid", "Series")
.Update("_SaveAjaxSeriesEditing", "Series")