Merge pull request #1094 from dhruvb14/dev

Break out Mass Email feature into its own settings tab
pull/1105/head
Jamie 8 years ago committed by GitHub
commit 2b931f15c1

@ -1,13 +1,13 @@
/*!
* Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
/* FONT PATH
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot?v=4.5.0');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
@ -118,31 +118,31 @@
}
}
.fa-rotate-90 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
.fa-rotate-180 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
.fa-rotate-270 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
}
.fa-flip-horizontal {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
-webkit-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.fa-flip-vertical {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
-webkit-transform: scale(1, -1);
-ms-transform: scale(1, -1);
transform: scale(1, -1);
@ -1383,7 +1383,7 @@
.fa-digg:before {
content: "\f1a6";
}
.fa-pied-piper:before {
.fa-pied-piper-pp:before {
content: "\f1a7";
}
.fa-pied-piper-alt:before {
@ -1509,6 +1509,7 @@
content: "\f1ce";
}
.fa-ra:before,
.fa-resistance:before,
.fa-rebel:before {
content: "\f1d0";
}
@ -1831,6 +1832,7 @@
content: "\f23e";
}
.fa-battery-4:before,
.fa-battery:before,
.fa-battery-full:before {
content: "\f240";
}
@ -2084,3 +2086,252 @@
.fa-percent:before {
content: "\f295";
}
.fa-gitlab:before {
content: "\f296";
}
.fa-wpbeginner:before {
content: "\f297";
}
.fa-wpforms:before {
content: "\f298";
}
.fa-envira:before {
content: "\f299";
}
.fa-universal-access:before {
content: "\f29a";
}
.fa-wheelchair-alt:before {
content: "\f29b";
}
.fa-question-circle-o:before {
content: "\f29c";
}
.fa-blind:before {
content: "\f29d";
}
.fa-audio-description:before {
content: "\f29e";
}
.fa-volume-control-phone:before {
content: "\f2a0";
}
.fa-braille:before {
content: "\f2a1";
}
.fa-assistive-listening-systems:before {
content: "\f2a2";
}
.fa-asl-interpreting:before,
.fa-american-sign-language-interpreting:before {
content: "\f2a3";
}
.fa-deafness:before,
.fa-hard-of-hearing:before,
.fa-deaf:before {
content: "\f2a4";
}
.fa-glide:before {
content: "\f2a5";
}
.fa-glide-g:before {
content: "\f2a6";
}
.fa-signing:before,
.fa-sign-language:before {
content: "\f2a7";
}
.fa-low-vision:before {
content: "\f2a8";
}
.fa-viadeo:before {
content: "\f2a9";
}
.fa-viadeo-square:before {
content: "\f2aa";
}
.fa-snapchat:before {
content: "\f2ab";
}
.fa-snapchat-ghost:before {
content: "\f2ac";
}
.fa-snapchat-square:before {
content: "\f2ad";
}
.fa-pied-piper:before {
content: "\f2ae";
}
.fa-first-order:before {
content: "\f2b0";
}
.fa-yoast:before {
content: "\f2b1";
}
.fa-themeisle:before {
content: "\f2b2";
}
.fa-google-plus-circle:before,
.fa-google-plus-official:before {
content: "\f2b3";
}
.fa-fa:before,
.fa-font-awesome:before {
content: "\f2b4";
}
.fa-handshake-o:before {
content: "\f2b5";
}
.fa-envelope-open:before {
content: "\f2b6";
}
.fa-envelope-open-o:before {
content: "\f2b7";
}
.fa-linode:before {
content: "\f2b8";
}
.fa-address-book:before {
content: "\f2b9";
}
.fa-address-book-o:before {
content: "\f2ba";
}
.fa-vcard:before,
.fa-address-card:before {
content: "\f2bb";
}
.fa-vcard-o:before,
.fa-address-card-o:before {
content: "\f2bc";
}
.fa-user-circle:before {
content: "\f2bd";
}
.fa-user-circle-o:before {
content: "\f2be";
}
.fa-user-o:before {
content: "\f2c0";
}
.fa-id-badge:before {
content: "\f2c1";
}
.fa-drivers-license:before,
.fa-id-card:before {
content: "\f2c2";
}
.fa-drivers-license-o:before,
.fa-id-card-o:before {
content: "\f2c3";
}
.fa-quora:before {
content: "\f2c4";
}
.fa-free-code-camp:before {
content: "\f2c5";
}
.fa-telegram:before {
content: "\f2c6";
}
.fa-thermometer-4:before,
.fa-thermometer:before,
.fa-thermometer-full:before {
content: "\f2c7";
}
.fa-thermometer-3:before,
.fa-thermometer-three-quarters:before {
content: "\f2c8";
}
.fa-thermometer-2:before,
.fa-thermometer-half:before {
content: "\f2c9";
}
.fa-thermometer-1:before,
.fa-thermometer-quarter:before {
content: "\f2ca";
}
.fa-thermometer-0:before,
.fa-thermometer-empty:before {
content: "\f2cb";
}
.fa-shower:before {
content: "\f2cc";
}
.fa-bathtub:before,
.fa-s15:before,
.fa-bath:before {
content: "\f2cd";
}
.fa-podcast:before {
content: "\f2ce";
}
.fa-window-maximize:before {
content: "\f2d0";
}
.fa-window-minimize:before {
content: "\f2d1";
}
.fa-window-restore:before {
content: "\f2d2";
}
.fa-times-rectangle:before,
.fa-window-close:before {
content: "\f2d3";
}
.fa-times-rectangle-o:before,
.fa-window-close-o:before {
content: "\f2d4";
}
.fa-bandcamp:before {
content: "\f2d5";
}
.fa-grav:before {
content: "\f2d6";
}
.fa-etsy:before {
content: "\f2d7";
}
.fa-imdb:before {
content: "\f2d8";
}
.fa-ravelry:before {
content: "\f2d9";
}
.fa-eercast:before {
content: "\f2da";
}
.fa-microchip:before {
content: "\f2db";
}
.fa-snowflake-o:before {
content: "\f2dc";
}
.fa-superpowers:before {
content: "\f2dd";
}
.fa-wpexplorer:before {
content: "\f2de";
}
.fa-meetup:before {
content: "\f2e0";
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}

File diff suppressed because one or more lines are too long

@ -225,7 +225,9 @@ namespace Ombi.UI.Modules.Admin
Get["/newsletter", true] = async (x, ct) => await Newsletter();
Post["/newsletter", true] = async (x, ct) => await SaveNewsletter();
Post["/testnewsletteradminemail"] = x => TestNewsletterAdminEmail();
Post["/testnewsletteradminemail"] = x => TestNewsletterAdminEmail();
Get["/massemail"] = _ => MassEmailView();
Post["/testmassadminemail"] = x => TestMassAdminEmail();
Post["/sendmassemail"] = x => SendMassEmail();
@ -930,6 +932,10 @@ namespace Ombi.UI.Modules.Admin
var settings = await NewsLetterService.GetSettingsAsync();
return View["NewsletterSettings", settings];
}
private Negotiator MassEmailView()
{
return View["MassEmail"];
}
private async Task<Response> SaveNewsletter()
{

@ -876,6 +876,9 @@
<Content Include="Views\Integration\Watcher.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Views\Admin\MassEmail.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Views\Admin\NewsletterSettings.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

@ -0,0 +1,105 @@
@using System.Linq
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.NewletterSettings>
@Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<form id="massemail" class="form-horizontal">
<fieldset>
<legend>Mass Email</legend>
<!-- Mass Email Section -->
<div style="padding:10px">
<div class="form-group">
<small>Note: This will require you to setup your email notifications</small>
</div>
<div class="form-group">
<label for="massEmailSubject" class="control-label">Subject</label>
<div>
<input type="text" class="form-control form-control-custom " placeholder="A Message from the Admin" id="massEmailSubject" name="massEmailSubject" value="">
</div>
</div>
<div class="form-group">
<label for="massEmailBody" class="control-label">Body</label>
<textarea id="massEmailBody" class="form-control" rows="5"></textarea>
<small>Supports HTML</small>
</div>
<div class="form-group">
<div>
<button id="testSendMassEmailBtn" class="btn btn-primary-outline">Send Test to Admin<div id="testSendMassEmailSpinner"></div></button>
</div>
</div>
<div class="form-group">
<div>
<button id="sendMassEmailBtn" class="btn btn-primary-outline">Send To All Users<div id="sendMassEmailSpinner"></div></button>
</div>
</div>
</div>
<!-- Mass Email Section -->
</fieldset>
</form>
</div>
<script>
$(function () {
$('#testSendMassEmailBtn').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/testmassadminemail');
$('#testSendMassEmailSpinner').attr("class", "fa fa-spinner fa-spin");
var data = { "Users": "", "Body": $("#massEmailBody").val(), "Subject": $("#massEmailSubject").val() };
$.ajax({
type: "post",
url: url,
data: data,
dataType: "json",
success: function (response) {
if (response.result) {
generateNotify(response.message, "success");
$('#testSendMassEmailSpinner').attr("class", "fa fa-check");
} else {
generateNotify(response.message, "danger");
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
}
});
});
$('#sendMassEmailBtn').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/sendmassemail');
$('#sendMassEmailSpinner').attr("class", "fa fa-spinner fa-spin");
var data = { "Users": "", "Body": $("#massEmailBody").val(), "Subject": $("#massEmailSubject").val() };
$.ajax({
type: "post",
url: url,
data: data,
dataType: "json",
success: function (response) {
if (response.result) {
generateNotify(response.message, "success");
$('#sendMassEmailSpinner').attr("class", "fa fa-check");
} else {
generateNotify(response.message, "danger");
$('#sendMassEmailSpinner').attr("class", "fa fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
$('#sendMassEmailSpinner').attr("class", "fa fa-times");
}
});
});
});
</script>

@ -9,7 +9,7 @@
<legend>Newsletter Settings</legend>
<div style="padding:10px">
<!-- Email Nofication Section -->
<!-- Newsletter Section -->
<div class="form-group">
<div class="checkbox">
@ -51,42 +51,7 @@
</div>
</div>
</div>
<!-- Email Nofication Section -->
</fieldset>
</form>
<form id="massemail" class="form-horizontal">
<fieldset>
<legend>Mass Email</legend>
<div style="padding:10px">
<div class="form-group">
<small>Note: This will require you to setup your email notifications</small>
</div>
<div class="form-group">
<label for="massEmailSubject" class="control-label">Subject</label>
<div>
<input type="text" class="form-control form-control-custom " placeholder="A Message from the Admin" id="massEmailSubject" name="massEmailSubject" value="">
</div>
</div>
<div class="form-group">
<label for="massEmailBody" class="control-label">Body</label>
<textarea id="massEmailBody" class="form-control" rows="5"></textarea>
<small>Supports HTML</small>
</div>
<div class="form-group">
<div>
<button id="testSendMassEmailBtn" class="btn btn-primary-outline">Send Test to Admin<div id="testSendMassEmailSpinner"></div></button>
</div>
</div>
<div class="form-group">
<div>
<button id="sendMassEmailBtn" class="btn btn-primary-outline">Send To All Users<div id="sendMassEmailSpinner"></div></button>
</div>
</div>
</div>
<!-- Newsletter Section -->
</fieldset>
</form>
</div>
@ -94,8 +59,6 @@
<script>
$(function () {
var base = '@Html.GetBaseUrl()';
$('#save').click(function (e) {
e.preventDefault();
@ -149,62 +112,5 @@
});
});
$('#testSendMassEmailBtn').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/testmassadminemail');
$('#testSendMassEmailSpinner').attr("class", "fa fa-spinner fa-spin");
var data = { "Users": "", "Body": $("#massEmailBody").val(), "Subject": $("#massEmailSubject").val() };
$.ajax({
type: "post",
url: url,
data: data,
dataType: "json",
success: function (response) {
if (response.result) {
generateNotify(response.message, "success");
$('#testSendMassEmailSpinner').attr("class", "fa fa-check");
} else {
generateNotify(response.message, "danger");
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
}
});
});
$('#sendMassEmailBtn').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/sendmassemail');
$('#sendMassEmailSpinner').attr("class", "fa fa-spinner fa-spin");
var data = { "Users": "", "Body": $("#massEmailBody").val(), "Subject": $("#massEmailSubject").val() };
$.ajax({
type: "post",
url: url,
data: data,
dataType: "json",
success: function (response) {
if (response.result) {
generateNotify(response.message, "success");
$('#sendMassEmailSpinner').attr("class", "fa fa-check");
} else {
generateNotify(response.message, "danger");
$('#sendMassEmailSpinner').attr("class", "fa fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
$('#sendMassEmailSpinner').attr("class", "fa fa-times");
}
});
});
});
</script>

@ -17,6 +17,7 @@
@Html.GetSidebarUrl(Context, "/admin/sickrage", "SickRage", "fa fa-tv")
@Html.GetSidebarUrl(Context, "/admin/headphones", "Headphones (beta)", "glyphicon glyphicon-headphones")
@Html.GetSidebarUrl(Context, "/admin/newsletter", "Newsletter Settings", "fa fa-newspaper-o")
@Html.GetSidebarUrl(Context, "/admin/massemail", "Mass Email", "fa fa-reply-all")
<div id="sidebar" >
<a href="#notifications" class="list-group-item" data-parent="#sidebar">

Loading…
Cancel
Save