Work on mass messaging

This commit is contained in:
Rick Falkvinge
2016-12-29 15:54:19 +01:00
parent 650467ea82
commit ffabd99524
5 changed files with 74 additions and 6 deletions
+19 -1
View File
@@ -19,7 +19,7 @@ namespace Resources.Pages {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option or rebuild the Visual Studio project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Comms {
@@ -87,6 +87,15 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to Type your message here. Standard markup like *bold*, _italic_, ==headers== and similar can be used. Two newlines begin a new paragraph. The mail will be sent as dual-mode cleartext and HTML..
/// </summary>
internal static string SendMassMessage_MessageHint {
get {
return ResourceManager.GetString("SendMassMessage_MessageHint", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This message would have been sent to the recipients. For the time being, this is a mock-up interface..
/// </summary>
@@ -132,6 +141,15 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to Subject.
/// </summary>
internal static string SendMassMessage_Subject {
get {
return ResourceManager.GetString("SendMassMessage_Subject", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test.
/// </summary>
@@ -126,6 +126,9 @@
<data name="SendMassMessage_Info" xml:space="preserve">
<value>Send a message to a group of people in the organization. You can send the message by mail (good for newsletters and general information) or to their phones (very intrusive, and also costs a bit).</value>
</data>
<data name="SendMassMessage_MessageHint" xml:space="preserve">
<value>Type your message here. Standard markup like *bold*, _italic_, ==headers== and similar can be used. Two newlines begin a new paragraph. The mail will be sent as dual-mode cleartext and HTML.</value>
</data>
<data name="SendMassMessage_MockMessageResult" xml:space="preserve">
<value>This message would have been sent to the recipients. For the time being, this is a mock-up interface.</value>
</data>
@@ -143,6 +146,10 @@
<data name="SendMassMessage_SendMessageResult" xml:space="preserve">
<value>Your message is now being distributed to recipients. You will be notified when transmission is complete.</value>
</data>
<data name="SendMassMessage_Subject" xml:space="preserve">
<value>Subject</value>
<comment>Subject of message (if applicable; depends on transmission mode)</comment>
</data>
<data name="SendMassMessage_TestMessage" xml:space="preserve">
<value>Test</value>
<comment>Keep SHORT- it's a small button. 6-7 letters max</comment>
+26 -3
View File
@@ -14,9 +14,11 @@
});
updateRecipientCount(selectedReceipientClass, selectedGeographyId);
});
var selectedReceipientClass = 1;
$('#<%=this.TextSubject.ClientID%>').focus();
});
var selectedRecipientClass = 1;
var selectedGeographyId = 1; // TODO: SET ROOT GEOGRAPHY BY AUTHORITY/ACCESS
function onGeographyChange(newGeographyId) {
@@ -32,11 +34,30 @@
}
function onClickTest() {
var jsonData = {
recipientTypeId: selectedRecipientClass,
geographyId: selectedGeographyId,
mode: "Mail",
subject: "Test Subject",
body: "SHAKAZAM *IT WORKS*\r\n\r\nMaybe?",
dummyMail: "rick@falkvinge.net",
live: false
};
SwarmopsJS.ajaxCall
("/Pages/v5/Comms/SendMassMessage.aspx/ExecuteSend",
jsonData,
function (result) {
$('#spanRecipientCount').text(result);
});
alertify.alert(SwarmopsJS.unescape('<%= this.Localized_TestMessageResult %>'));
return false;
}
function onRecipientChange(newRecipientClass) {
selectedRecipientClass = newRecipientClass;
updateRecipientCount(newRecipientClass, selectedGeographyId);
}
@@ -62,13 +83,15 @@
<div class="entryFields" style="padding-top:4px">
<Swarmops5:DropDown runat="server" ID="DropRecipientClasses" OnClientChange="onRecipientChange"/>&thinsp;<br/>
<Swarmops5:ComboGeographies ID="ComboGeographies" runat="server" OnClientSelect="onGeographyChange" />&thinsp;<br/>
<asp:TextBox ID="TextSubject" runat="server"/>&thinsp;
</div>
<div class="entryLabels" style="padding-top:10px">
<asp:Label ID="LabelRecipientType" runat="server" /><br/>
<asp:Label ID="LabelGeography" runat="server" /><br/>
<asp:Label ID="LabelSubject" runat="server"/>
</div>
<h2 style="padding-top:15px"><asp:Label ID="LabelHeaderMessage" runat="server" /> (<span id="spanRecipientCount">...</span>)</h2>
<asp:TextBox runat="server" TextMode="MultiLine" Rows="10" ID="TextMessage" Text="This page is a mockup for now; it doesn't actually send anything. What you want to try is to send to the [Regulars] recipients and see how the recipient count changes with choice of geography." />
<asp:TextBox runat="server" TextMode="MultiLine" Rows="10" ID="TextMessage" />
<asp:Button runat="server" CssClass="buttonAccentColor" Text="Foo" OnClientClick="onClickSend(); return false;" ID="ButtonSend" /><asp:Button runat="server" CssClass="buttonAccentColor" OnClientClick="onClickTest(); return false;" Text="Bar" ID="ButtonTest" />
<div style="clear:both"></div>
</asp:Content>
@@ -1,4 +1,6 @@
using System;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -33,6 +35,7 @@ namespace Swarmops.Frontend.Pages.Comms
this.LabelGeography.Text = Resources.Pages.Comms.SendMassMessage_Geography;
this.LabelRecipientType.Text = Resources.Pages.Comms.SendMassMessage_RecipientType;
this.LabelHeaderMessage.Text = Resources.Pages.Comms.SendMassMessage_HeaderMessage;
this.LabelSubject.Text = Resources.Pages.Comms.SendMassMessage_Subject;
this.DropRecipientClasses.Items.Clear();
this.DropRecipientClasses.Items.Add (new ListItem (Participant.Localized(CurrentOrganization.RegularLabel, TitleVariant.Plural), "1"));
@@ -43,6 +46,7 @@ namespace Swarmops.Frontend.Pages.Comms
this.ButtonSend.Text = Resources.Pages.Comms.SendMassMessage_SendMessage;
this.ButtonTest.Text = Resources.Pages.Comms.SendMassMessage_TestMessage;
this.TextMessage.Attributes["Placeholder"] = Resources.Pages.Comms.SendMassMessage_MessageHint;
}
[WebMethod]
@@ -98,6 +102,13 @@ namespace Swarmops.Frontend.Pages.Comms
return result;
}
[WebMethod]
public static AjaxCallResult ExecuteSend(int recipientTypeId, int geographyId, string mode, string subject,
string body, string dummyMail, bool live)
{
return new AjaxCallResult {Success = false};
}
public struct ConfirmPayoutResult
{
public int AssignedId;
+11 -2
View File
@@ -38,7 +38,7 @@ namespace Swarmops.Frontend.Pages.Comms {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelRecipientType;
/// <summary>
/// LabelGeography control.
/// </summary>
@@ -47,7 +47,16 @@ namespace Swarmops.Frontend.Pages.Comms {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelGeography;
/// <summary>
/// LabelGeography control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelSubject;
/// <summary>
/// LabelHeaderMessage control.
/// </summary>