mirror of https://github.com/Ombi-app/Ombi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
4.8 KiB
133 lines
4.8 KiB
8 years ago
|
@using System.Linq
|
||
8 years ago
|
@using Ombi.UI.Helpers
|
||
|
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.NewletterSettings>
|
||
8 years ago
|
@Html.Partial("Shared/Partial/_Sidebar")
|
||
8 years ago
|
|
||
|
<div class="col-sm-8 col-sm-push-1">
|
||
|
<form class="form-horizontal" method="POST" id="mainForm">
|
||
|
<fieldset>
|
||
|
<legend>Newsletter Settings</legend>
|
||
8 years ago
|
|
||
8 years ago
|
<!-- Email Nofication Section -->
|
||
|
<div class="form-group">
|
||
|
<div class="checkbox">
|
||
|
|
||
|
<small>Note: This will require you to setup your email notifications</small>
|
||
8 years ago
|
<br />
|
||
8 years ago
|
@if (Model.SendRecentlyAddedEmail)
|
||
|
{
|
||
8 years ago
|
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail" checked="checked"><label for="SendRecentlyAddedEmail">Enable the newsletter of recently added content</label>
|
||
8 years ago
|
}
|
||
|
else
|
||
|
{
|
||
8 years ago
|
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail"><label for="SendRecentlyAddedEmail">Enable the newsletter of recently added content</label>
|
||
8 years ago
|
}
|
||
8 years ago
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group">
|
||
|
<div class="checkbox">
|
||
8 years ago
|
@if (Model.SendToPlexUsers)
|
||
|
{
|
||
|
<input type="checkbox" id="SendToPlexUsers" name="SendToPlexUsers" checked="checked"><label for="SendToPlexUsers">Send to all of your Plex 'Friends'</label>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input type="checkbox" id="SendToPlexUsers" name="SendToPlexUsers"><label for="SendToPlexUsers">Send to all of your Plex 'Friends'</label>
|
||
|
}
|
||
|
|
||
8 years ago
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
8 years ago
|
|
||
|
<br>
|
||
|
<br>
|
||
|
<label for="CustomUsers" class="control-label">Email Addresses to Send to (For users that are not in your Plex Friends)</label>
|
||
|
<small>You can add multiple email address by using the ; delimiter</small>
|
||
|
<div>
|
||
|
<input type="text" class="form-control form-control-custom " placeholder="first@address.com;second@address.com" id="CustomUsers" name="CustomUsers" value="@Model.CustomUsers">
|
||
8 years ago
|
</div>
|
||
|
</div>
|
||
8 years ago
|
|
||
8 years ago
|
<div class="form-group">
|
||
|
<div>
|
||
8 years ago
|
<button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin <div id="spinner"></div></button>
|
||
8 years ago
|
</div>
|
||
|
</div>
|
||
8 years ago
|
|
||
|
<br />
|
||
8 years ago
|
<br />
|
||
|
<div class="form-group">
|
||
|
<div>
|
||
|
<button type="submit" id="save" class="btn btn-primary-outline">Submit</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- Email Nofication Section -->
|
||
8 years ago
|
|
||
8 years ago
|
</fieldset>
|
||
8 years ago
|
|
||
8 years ago
|
</form>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<script>
|
||
|
$(function () {
|
||
|
|
||
|
|
||
|
var base = '@Html.GetBaseUrl()';
|
||
|
$('#save').click(function (e) {
|
||
|
e.preventDefault();
|
||
|
|
||
|
var $form = $("#mainForm");
|
||
|
var data = $form.serialize();
|
||
|
|
||
|
$.ajax({
|
||
|
type: $form.prop("method"),
|
||
|
data: data,
|
||
|
url: $form.prop("action"),
|
||
|
dataType: "json",
|
||
|
success: function (response) {
|
||
|
if (response.result === true) {
|
||
|
generateNotify(response.message, "success");
|
||
|
} else {
|
||
|
generateNotify(response.message, "warning");
|
||
|
}
|
||
|
},
|
||
|
error: function (e) {
|
||
|
console.log(e);
|
||
|
generateNotify("Something went wrong!", "danger");
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
8 years ago
|
$('#recentlyAddedBtn').click(function (e) {
|
||
|
e.preventDefault();
|
||
|
var base = '@Html.GetBaseUrl()';
|
||
|
var url = createBaseUrl(base, '/admin/recentlyAddedTest');
|
||
8 years ago
|
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||
8 years ago
|
$.ajax({
|
||
|
type: "post",
|
||
|
url: url,
|
||
|
dataType: "json",
|
||
|
success: function (response) {
|
||
|
if (response) {
|
||
|
generateNotify(response.message, "success");
|
||
8 years ago
|
$('#spinner').attr("class", "fa fa-check");
|
||
8 years ago
|
} else {
|
||
|
|
||
|
generateNotify(response.message, "danger");
|
||
8 years ago
|
$('#spinner').attr("class", "fa fa-times");
|
||
8 years ago
|
}
|
||
|
},
|
||
|
error: function (e) {
|
||
|
console.log(e);
|
||
|
generateNotify("Something went wrong!", "danger");
|
||
8 years ago
|
$('#spinner').attr("class", "fa fa-times");
|
||
8 years ago
|
}
|
||
|
});
|
||
|
});
|
||
8 years ago
|
|
||
|
});
|
||
|
</script>
|