2011-04-21 01:43:09 +00:00
|
|
|
@model NzbDrone.Web.Models.QualityModel
|
2011-02-03 02:49:52 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
var options = {
|
|
|
|
target: '#result',
|
|
|
|
beforeSubmit: showRequest,
|
|
|
|
success: showResponse,
|
|
|
|
type: 'post',
|
|
|
|
resetForm: false
|
|
|
|
};
|
|
|
|
$('#form').ajaxForm(options);
|
2011-02-15 01:59:23 +00:00
|
|
|
$('#save_button').attr('disabled', '');
|
2011-02-03 02:49:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function showRequest(formData, jqForm, options) {
|
|
|
|
$("#result").empty().html('Saving...');
|
|
|
|
$("#form :input").attr("disabled", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function showResponse(responseText, statusText, xhr, $form) {
|
|
|
|
$("#result").empty().html(responseText);
|
|
|
|
$("#form :input").attr("disabled", false);
|
2011-02-12 06:10:38 +00:00
|
|
|
}
|
2011-02-03 02:49:52 +00:00
|
|
|
</script>
|
|
|
|
|
2011-04-21 01:43:09 +00:00
|
|
|
@using (Html.BeginForm("SaveQuality", "Settings", FormMethod.Post, new {id = "form", name = "form"}))
|
|
|
|
{
|
2011-02-05 06:07:25 +00:00
|
|
|
<fieldset>
|
2011-04-21 01:43:09 +00:00
|
|
|
<legend>Quality</legend>
|
2011-02-03 18:28:14 +00:00
|
|
|
|
2011-02-08 07:08:38 +00:00
|
|
|
<div class="rightSide" style="float: right; width: 65%;">
|
|
|
|
<div id="defaultQualityDiv" style="float: left; margin: 30px;">
|
|
|
|
|
|
|
|
<div class="config-group" style="width: 250px; margin-bottom: 5px; margin-left: 5px;">
|
2011-04-21 01:43:09 +00:00
|
|
|
<div class="config-title">@Html.LabelFor(m => m.DefaultQualityProfileId)</div>
|
|
|
|
<div class="config-value">@Html.DropDownListFor(m => m.DefaultQualityProfileId, Model.SelectList)</div>
|
|
|
|
<div class="config-validation">@Html.ValidationMessageFor(m => m.DefaultQualityProfileId)</div>
|
2011-02-08 07:08:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2011-02-05 06:07:25 +00:00
|
|
|
</div>
|
2011-02-05 18:27:14 +00:00
|
|
|
|
2011-02-08 07:08:38 +00:00
|
|
|
<div id="leftSide" style="width:35%;">
|
|
|
|
<div style="padding-top: 10px;">
|
|
|
|
<div style="padding-left: 7px; margin-bottom: 5px;">
|
2011-04-21 01:43:09 +00:00
|
|
|
<a id="addItem" style="text-decoration:none;" href="@Url.Action("AddUserProfile", "Settings")">
|
2011-02-08 07:08:38 +00:00
|
|
|
<img src="../../Content/Images/Plus.png" alt="Add New Profile" />
|
|
|
|
<h4 style="margin-left: 3px; display: inline; color: Black;">Add New Profile</h4></a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="user-profiles">
|
2011-04-22 00:30:19 +00:00
|
|
|
@foreach (var item in Model.UserProfiles)
|
|
|
|
{
|
|
|
|
Html.RenderAction("GetQualityProfileView", item);
|
|
|
|
}
|
2011-02-08 07:08:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2011-02-06 02:52:49 +00:00
|
|
|
|
2011-02-08 07:08:38 +00:00
|
|
|
<div style="margin-top: 10px; padding-left: 5px;">
|
2011-02-15 01:59:23 +00:00
|
|
|
<input type="submit" id="save_button" value="Save" disabled="disabled" />
|
2011-02-05 18:27:14 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2011-02-06 02:52:49 +00:00
|
|
|
|
2011-02-05 06:07:25 +00:00
|
|
|
</fieldset>
|
2011-04-21 01:43:09 +00:00
|
|
|
}
|
2011-02-05 18:27:14 +00:00
|
|
|
<div id="result"></div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
$("#addItem").click(function () {
|
|
|
|
$.ajax({
|
|
|
|
url: this.href,
|
|
|
|
cache: false,
|
|
|
|
success: function (html) { $("#user-profiles").prepend(html); }
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2011-04-22 00:30:19 +00:00
|
|
|
// $("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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2011-02-05 18:27:14 +00:00
|
|
|
</script>
|