Fixed #561 and a small bit of work on #569

This commit is contained in:
tidusjar 2016-10-09 14:50:15 +01:00
commit e563b5bf3d
12 changed files with 108 additions and 31 deletions

View file

@ -160,6 +160,7 @@
$('#requestToken').click(function (e) {
e.preventDefault();
debugger;
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
@ -167,7 +168,7 @@
data: $form.serialize(),
dataType: "json",
success: function (response) {
if (response.result === true) {
if (response.apiKey) {
generateNotify("Success!", "success");
$('#ApiKey').val(response.apiKey);
} else {

View file

@ -76,21 +76,22 @@
</div>
<br/>
<br/>
<div class="form-group">
<div class="checkbox">
<div class="form-group">
<div class="checkbox">
<small>Note: This will require you to setup your email notifications</small>
@if (Model.SendRecentlyAddedEmail)
{
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail" checked="checked"><label for="SendRecentlyAddedEmail">Send out a weekly email of recently added content to all your Plex 'Friends'</label>
}
else
{
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail"><label for="SendRecentlyAddedEmail">Send out a weekly email of recently added content to all your Plex 'Friends'</label>
}
<small>Note: This will require you to setup your email notifications</small>
@if (Model.SendRecentlyAddedEmail)
{
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail" checked="checked"><label for="SendRecentlyAddedEmail">Send out a weekly email of recently added content to all your Plex 'Friends'</label>
}
else
{
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail"><label for="SendRecentlyAddedEmail">Send out a weekly email of recently added content to all your Plex 'Friends'</label>
}
</div>
</div>
</div>
<button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin</button>
<div class="form-group">
<div class="checkbox">
@ -372,5 +373,29 @@
}
});
});
$('#recentlyAddedBtn').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/recentlyAddedTest');
$.ajax({
type: "post",
url: url,
dataType: "json",
success: function (response) {
if (response) {
generateNotify(response.message, "success");
} else {
generateNotify(response.message, "danger");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
});
</script>