Checkpoint commit Signup

This commit is contained in:
Rick Falkvinge
2015-05-10 17:55:26 +02:00
parent a18f1683a5
commit e59e5bc01f
5 changed files with 90 additions and 17 deletions
+5 -5
View File
@@ -283,20 +283,20 @@ namespace Swarmops.Logic.Structure
set { OptionalData[ObjectOptionalDataType.OrgRegularLabel] = value.ToString(); }
}
public string ActivistLabel
public ParticipantTitle ActivistLabel
{
get
{
string optionalData = OptionalData[ObjectOptionalDataType.OrgActivistLabel];
if (string.IsNullOrEmpty (optionalData))
{
ActivistLabel = "Activist";
return "Activist";
ActivistLabel = ParticipantTitle.Activist;
return ParticipantTitle.Activist; // Legacy
}
return optionalData;
return (ParticipantTitle)(Enum.Parse(typeof(ParticipantTitle), optionalData));
}
set { OptionalData[ObjectOptionalDataType.OrgActivistLabel] = value; }
set { OptionalData[ObjectOptionalDataType.OrgActivistLabel] = value.ToString(); }
}
#region Public methods
+15 -4
View File
@@ -120,6 +120,10 @@
<data name="Signup_ActivationActive" xml:space="preserve">
<value>If you wish to engage further, you can make yourself available for calls-to-action, at no obligation whatsoever to show up, attend, or take part in any particular one of them.</value>
</data>
<data name="Signup_ActivationActiveHeader" xml:space="preserve">
<value>{0} At Opportunity</value>
<comment>{0} is the Activist label for the org.</comment>
</data>
<data name="Signup_ActivationLevel" xml:space="preserve">
<value>How much do you wish to engage?</value>
</data>
@@ -131,8 +135,12 @@
<value>This is the default level, and means you'll take normal part in the organization as a grassroots {0}.</value>
<comment>{0} is the Participantship name (membership, ambassadorship etc).</comment>
</data>
<data name="Signup_ActivationPassiveHeader" xml:space="preserve">
<value>Regular {0}</value>
<comment>{0} is the Regular Participant label for the org.</comment>
</data>
<data name="Signup_ActivationVolunteer" xml:space="preserve">
<value>If you wish to volunteer to take formal responsibility for some part of the organization, helping out where it's needed most, it's obviously most welcome. (You'll get a selection of positions to volunteer for on the next page.)</value>
<value>If you wish to volunteer for taking formal responsibility for some part of the organization, helping out where it's needed most, it's obviously most welcome. (You'll get a selection of positions to volunteer for on the next page.)</value>
</data>
<data name="Signup_ActivationVolunteerHeader" xml:space="preserve">
<value>Officer Volunteer</value>
@@ -143,6 +151,9 @@
<data name="Signup_Error_PasswordMismatch" xml:space="preserve">
<value>The two password copies do not match.</value>
</data>
<data name="Signup_Error_SelectActivationLevel" xml:space="preserve">
<value>Please select your desired activity level.</value>
</data>
<data name="Signup_FeeHeader" xml:space="preserve">
<value>Fees and Costs</value>
</data>
@@ -158,8 +169,8 @@
<value>Your logon (your mail)</value>
</data>
<data name="Signup_NoFeeText" xml:space="preserve">
<value>There is no cost whatsoever in signing up for a {0}, nor any cost to renew when it expires on {1}. In addition, you may terminate your {0} at any time.</value>
<comment>{0} is the Participantship title. {1} is the expiry date.</comment>
<value>There is no cost whatsoever in signing up for a {0} with {2}, nor any cost to renew when it expires on {1}. In addition, you may terminate your {0} at any time.</value>
<comment>{0} is the Participantship title. {1} is the expiry date. {2} is the organization name.</comment>
</data>
<data name="Signup_Password1" xml:space="preserve">
<value>Choose a password</value>
@@ -168,7 +179,7 @@
<value>Repeat that password</value>
</data>
<data name="Signup_SigningUp" xml:space="preserve">
<value>Signing up for &lt;bdo&gt;{0}&lt;/bdo&gt;</value>
<value>Signing up for {0}</value>
<comment>The {0} is the organization name</comment>
</data>
<data name="Signup_Step1Header" xml:space="preserve">
@@ -100,7 +100,7 @@ namespace Swarmops.Frontend.Pages.v5.Admin
protected void ButtonCreate_Click (object sender, EventArgs e)
{
string activistLabel = this.DropActivistLabel.SelectedValue;
ParticipantTitle activistLabel = (ParticipantTitle) (Enum.Parse(typeof(ParticipantTitle), this.DropActivistLabel.SelectedValue));
ParticipantTitle peopleLabel =
(ParticipantTitle) (Enum.Parse (typeof (ParticipantTitle), this.DropPersonLabel.SelectedValue));
string asRoot = this.DropCreateChild.SelectedValue;
@@ -112,7 +112,7 @@ namespace Swarmops.Frontend.Pages.v5.Admin
throw new ArgumentException ("Organization name can't be empty");
}
if (activistLabel == "0" || peopleLabel == ParticipantTitle.Unknown || asRoot == "0" || currencyCode == "0")
if (activistLabel == ParticipantTitle.Unknown || peopleLabel == ParticipantTitle.Unknown || asRoot == "0" || currencyCode == "0")
{
throw new ArgumentException ("Necessary argument was not supplied (did client-side validation run?)");
}
+57 -5
View File
@@ -10,7 +10,7 @@
<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jquery.leanModal.min.js" ></script>
<script language="javascript" type="text/javascript" src="/Scripts/jquery.smartWizard-2.0.min.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jquery.smartWizard-3.3.1.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/alertify.min.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jquery.json.min.js"></script>
@@ -63,11 +63,32 @@
overflow: initial !important;
}
input, select {
input:not([type="radio"]), select {
width: 200px;
font-size: 16px;
}
input[type="radio"] {
margin-right: 5px; /* complements margin-left 5px in stylesheet */
margin-bottom: 5px;
margin-top: 10px;
}
input[type="radio"]+label {
font-size: 16px;
position:relative; /* ugly ugly way to circumvent a nonfunctional margin-bottom */
top: -4px;
}
input[type="radio"]+label+p {
padding-left: 24px;
}
body.rtl input[type="radio"]+label+p {
padding-right: 24px;
padding-left: inherit;
}
.entryFieldsAdmin, .entryLabelsAdmin {
font-size: 16px;
@@ -336,7 +357,27 @@
} else if (stepNumber == 4) {
isValid = true; // assume true, make false as we go
} else if (stepNumber == 5) {
if (suppressChecks) {
return true;
}
var selectedOption = $('input:radio[name="ActivationLevel"]:checked').val();
if (selectedOption === undefined) {
isValid = false;
alertify.error("<asp:Literal runat='server' ID='LiteralErrorSelectActivationLevel' />");
}
if (selectedOption != "RadioActivationVolunteer" && isValid) {
suppressChecks = true; // prevents foreverlooping into this check
$('#wizard').smartWizard('goToStep', 6);
setTimeout(function() {
$('a[rel="5"]').addClass("done").removeClass("selected");
$('a.buttonNext').addClass("buttonDisabled"); // hacks because SmartWizard doesn't handle skipping steps
}, 250);
suppressChecks = false;
}
} else if (stepNumber == 5) {
isValid = true; // assume true, make false as we go
} else if (stepNumber == 6) {
@@ -375,6 +416,8 @@
document.location = document.location + "&Culture=" + cultureCode;
}
var suppressChecks = false;
</script>
<!-- Main menu, dynamically constructed -->
@@ -480,9 +523,18 @@
</div>
</div>
<div id="step-4">
<h2>Creating the first user</h2>
<h2><asp:Label ID="LabelActivationLevelHeader" runat="server" /></h2>
<p><asp:Label ID="LabelActivationLevelIntro" runat="server" /></p>
<asp:RadioButton runat="server" ID="RadioActivationPassive" GroupName="ActivationLevel" />
<p><asp:Label runat="server" ID="LabelActivationPassiveText" /></p>
<asp:RadioButton runat="server" ID="RadioActivationActive" GroupName="ActivationLevel" />
<p><asp:Label runat="server" ID="LabelActivationActiveText" /></p>
<asp:RadioButton runat="server" ID="RadioActivationVolunteer" GroupName="ActivationLevel" />
<p><asp:Label runat="server" ID="LabelActivationVolunteerText" /></p>
</div>
<div id="step-5" style="display:none">
<div id="step-5">
</div>
<div id="step-6">
</div>
</div>
+11 -1
View File
@@ -104,6 +104,7 @@ namespace Swarmops.Frontend.Pages.Public
this.LiteralErrorNeedPassword.Text = Resources.Pages.Public.Signup_Error_NeedPassword;
this.LiteralErrorPasswordMismatch.Text = Resources.Pages.Public.Signup_Error_PasswordMismatch;
this.LiteralErrorSelectActivationLevel.Text = Resources.Pages.Public.Signup_Error_SelectActivationLevel;
this.LabelWelcomeHeader.Text = String.Format (Resources.Pages.Public.Signup_Welcome, Organization.Name);
this.LabelHeader.Text = String.Format(Resources.Pages.Public.Signup_SigningUp, Organization.Name).ToUpperInvariant();
@@ -146,6 +147,15 @@ namespace Swarmops.Frontend.Pages.Public
this.TextStreet1.Attributes["placeholder"] = "78 West Avenue";
this.TextPostal.Attributes["placeholder"] = "12345";
this.LabelActivationLevelHeader.Text = Resources.Pages.Public.Signup_ActivationLevel;
this.LabelActivationLevelIntro.Text = String.Format(Resources.Pages.Public.Signup_ActivationLevelText, this.Organization.Name);
this.RadioActivationPassive.Text = String.Format(Resources.Pages.Public.Signup_ActivationPassiveHeader, Participant.Localized (this.Organization.RegularLabel));
this.LabelActivationPassiveText.Text = String.Format(Resources.Pages.Public.Signup_ActivationPassive, this.Organization.Name);
this.RadioActivationActive.Text = String.Format(Resources.Pages.Public.Signup_ActivationActiveHeader, Participant.Localized (this.Organization.ActivistLabel));
this.LabelActivationActiveText.Text = Resources.Pages.Public.Signup_ActivationActive;
this.RadioActivationVolunteer.Text = Resources.Pages.Public.Signup_ActivationVolunteerHeader;
this.LabelActivationVolunteerText.Text = Resources.Pages.Public.Signup_ActivationVolunteer;
// Enable support for RTL languages
if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
@@ -159,7 +169,7 @@ namespace Swarmops.Frontend.Pages.Public
this.LabelSidebarActionsHeader.Text = Resources.Pages.Public.Signup_FeeHeader;
// if (this.Organization.MembershipFee == 0 && this.Organization.MembershipRenewalFee == 0)
this.LabelSidebarActionsContent.Text = String.Format (Resources.Pages.Public.Signup_NoFeeText,
Participant.Localized (this.Organization.RegularLabel, TitleVariant.Ship), DateTime.Today.AddYears (1).ToShortDateString());
Participant.Localized (this.Organization.RegularLabel, TitleVariant.Ship), DateTime.Today.AddYears (1).ToShortDateString(), this.Organization.Name);
this.LabelSidebarInfoHeader.Text = Resources.Global.Sidebar_Information;
this.LabelSidebarTodoHeader.Text = Resources.Global.Sidebar_Todo;