Enabled cultures for Signup, including RTL

This commit is contained in:
Rick Falkvinge
2015-05-10 13:38:28 +02:00
parent c7b616b8a0
commit 23056b5fe0
4 changed files with 154 additions and 10 deletions
+28 -2
View File
@@ -117,8 +117,34 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<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_ActivationLevel" xml:space="preserve">
<value>How much do you wish to engage?</value>
</data>
<data name="Signup_ActivationLevelText" xml:space="preserve">
<value>There are many different levels you can engage at in {0}. Select your intended level below (which you can change at will later, of course):</value>
<comment>{0} is the org name.</comment>
</data>
<data name="Signup_ActivationPassive" xml:space="preserve">
<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_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>
</data>
<data name="Signup_ActivationVolunteerHeader" xml:space="preserve">
<value>Officer Volunteer</value>
</data>
<data name="Signup_Error_NeedPassword" xml:space="preserve">
<value>Please select and retype a password.</value>
</data>
<data name="Signup_Error_PasswordMismatch" xml:space="preserve">
<value>The two password copies do not match.</value>
</data>
<data name="Signup_MailLoginKey" xml:space="preserve">
<value>Your login (your mail)</value>
<value>Your logon (your mail)</value>
</data>
<data name="Signup_Password1" xml:space="preserve">
<value>Choose a password</value>
@@ -152,7 +178,7 @@
<value>Activity 1</value>
</data>
<data name="Signup_Step4Text" xml:space="preserve">
<value>How much to you wish to engage?</value>
<value>How much do you wish to engage?</value>
</data>
<data name="Signup_Step5Header" xml:space="preserve">
<value>Activity 2</value>
+50 -5
View File
@@ -82,7 +82,7 @@
</style>
</head>
<body>
<body <asp:Literal ID="LiteralBodyAttributes" runat="server" />>
<form id="form2" runat="server">
<asp:ScriptManager runat="server" ID="ScriptManagerBlahblah" />
<script type="text/javascript">
@@ -307,6 +307,7 @@
isValid = true;
// Blah
$('div#divLanguageSelector').slideUp().fadeOut();
setTimeout(function() { $('#<%= TextName.ClientID %>').focus(); }, 250); // after 250ms, set focus to name field
} else if (stepNumber == 2) {
@@ -317,7 +318,17 @@
}
} else if (stepNumber == 3) {
isValid = true;
isValid = ValidateTextField('#<%= TextPassword1.ClientID %>', "<asp:Literal runat='server' ID='LiteralErrorNeedPassword' />");
if (isValid) {
if ($('#<%=TextPassword1.ClientID%>').val() != $('#<%=TextPassword2.ClientID%>').val()) {
isValid = false;
alertify.error("<asp:Literal runat='server' ID='LiteralErrorPasswordMismatch' />");
$('#<%=TextPassword1.ClientID%>,#<%=TextPassword2.ClientID%>').addClass("entryError");
$('#<%=TextPassword1.ClientID%>').focus();
}
}
} else if (stepNumber == 4) {
isValid = true; // assume true, make false as we go
@@ -357,12 +368,16 @@
}
function setLanguage(cultureCode) {
document.location = document.location + "&Culture=" + cultureCode;
}
</script>
<!-- Main menu, dynamically constructed -->
<div class="center980px">
<div class="topmenu" style="margin-top: -4px; padding-left: 30px; padding-top: 12px; color: white; font-family: Ubuntu; font-weight: 300; font-size: 24px; letter-spacing: 1px">
<div class="topmenu" style="margin-top: -4px; padding-left: 30px; padding-right: 30px; padding-top: 12px; color: white; font-family: Ubuntu; font-weight: 300; font-size: 24px; letter-spacing: 1px">
<asp:Label ID="LabelHeader" runat="server" />
</div>
@@ -419,7 +434,7 @@
</ul>
<div id="step-1">
<h2><asp:Label ID="LabelWelcomeHeader" runat="server" /></h2>
<p>This is the organization's custom welcome text. It has not yet been written; it is set in Admin / Org Settings.</p>
<p>This is the organization's custom welcome text. It has not yet been written; it is set in Admin / Org Settings.</p><br/><br/>
</div>
<div id="step-2">
<div class="entryLabelsAdmin">
@@ -441,7 +456,7 @@
<asp:TextBox runat="server" ID="TextPhone" />&#8203;<br/>
<asp:TextBox runat="server" ID="TextStreet1" />&#8203;<br/>
<asp:TextBox runat="server" ID="TextStreet2" />&#8203;<br/>
<div style="float: right; margin-right: -1px"><asp:TextBox runat="server" ID="TextPostal" />&nbsp;<asp:TextBox runat="server" ID="TextCity" /></div><div style="width: 35px; overflow: hidden"><span id="spanCountryPrefix">XX</span>&ndash;</div>
<div class="elementFloatFar" style="margin-right: -1px"><asp:TextBox runat="server" ID="TextPostal" />&nbsp;<asp:TextBox runat="server" ID="TextCity" /></div><div style="width: 35px; overflow: hidden"><span id="spanCountryPrefix">XX</span>&ndash;</div>
<span id="spanDetectedGeo">...</span>&nbsp;<br/>
<asp:TextBox runat="server" ID="TextDateOfBirth" />&#8203;<br/>
<asp:DropDownList runat="server" ID="DropGenders" />&#8203;<br/>
@@ -473,6 +488,33 @@
</div>
<div class="sidebar">
<div id="divLanguageSelector">
<h2 class="blue">Language<span class="arrow"></span></h2>
<div class="box">
<div class="content">
&nbsp;<a href="javascript:setLanguage('ar-SA')"><img src="/Images/Flags/Arabic-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('pt-BR')"><img src="/Images/Flags/br-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('zh-CHS')"><img src="/Images/Flags/cn-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('de-DE')"><img src="/Images/Flags/de-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('da-DK')"><img src="/Images/Flags/dk-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('es-ES')"><img src="/Images/Flags/es-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('fi-FI')"><img src="/Images/Flags/fi-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('fr-FR')"><img src="/Images/Flags/fr-24px.png"/></a><br/>
&nbsp;<a href="javascript:setLanguage('el-GR')"><img src="/Images/Flags/gr-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('hi-IN')"><img src="/Images/Flags/in-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('is-IS')"><img src="/Images/Flags/is-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('nl-NL')"><img src="/Images/Flags/nl-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('nb-NO')"><img src="/Images/Flags/no-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('ru-RU')"><img src="/Images/Flags/ru-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('sv-SE')"><img src="/Images/Flags/se-24px.png"/></a>&#8203;
<a href="javascript:setLanguage('en-US')"><img src="/Images/Flags/us-24px.png"/></a>&#8203;
</div>
</div>
</div>
<h2 class="blue"><asp:Label ID="LabelSidebarInfoHeader" runat="server" /><span class="arrow"></span></h2>
<div class="box">
@@ -505,6 +547,9 @@
</form>
</body>
<!-- active culture: <%=System.Threading.Thread.CurrentThread.CurrentUICulture.EnglishName %> -->
</html>
+30 -3
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -13,8 +14,25 @@ namespace Swarmops.Frontend.Pages.Public
{
public partial class Signup : System.Web.UI.Page
{
protected override void OnPreInit(EventArgs e)
{
CommonV5.CulturePreInit (Request);
base.OnPreInit(e);
}
protected void Page_Load (object sender, EventArgs e)
{
// Was this a quick callback to set the culture?
if (Request["Culture"] != null)
{
Response.SetCookie(new HttpCookie("PreferredCulture", Request["Culture"]));
Response.Redirect(Request.RawUrl.Substring (0, Request.RawUrl.IndexOf ("&Culture=")), true);
}
// Find what organization we're supposed to sign up to
this.Organization = Organization.FromVanityDomain (Request.Url.Host);
if (this.Organization == null)
@@ -82,6 +100,9 @@ namespace Swarmops.Frontend.Pages.Public
this.LiteralErrorStreet.Text = Resources.Pages.Swarm.AddPerson_ErrorStreet;
this.LiteralErrorDate.Text = Resources.Pages.Swarm.AddPerson_ErrorDate;
this.LiteralErrorNeedPassword.Text = Resources.Pages.Public.Signup_Error_NeedPassword;
this.LiteralErrorPasswordMismatch.Text = Resources.Pages.Public.Signup_Error_PasswordMismatch;
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();
this.LabelYourLogon.Text = Resources.Pages.Public.Signup_YourLogon;
@@ -100,7 +121,7 @@ namespace Swarmops.Frontend.Pages.Public
this.LabelStep6Header.Text = Resources.Pages.Public.Signup_Step6Header;
this.LabelStep6Text.Text = Resources.Pages.Public.Signup_Step6Text;
this.LabelName.Text = Resources.Global.Global_Name;
this.LabelName.Text = Resources.Pages.Public.Signup_YourName;
this.LabelCountry.Text = Resources.Global.Global_Country;
this.LabelMail.Text = Resources.Global.Global_Mail;
this.LabelPhone.Text = Resources.Global.Global_Phone;
@@ -112,8 +133,6 @@ namespace Swarmops.Frontend.Pages.Public
this.LabelDateOfBirth.Text = Resources.Global.Global_DateOfBirth;
this.LabelLegalGender.Text = Resources.Pages.Swarm.AddPerson_LegalGender;
this.LabelLoginKey.Text = Resources.Pages.Public.Signup_MailLoginKey;
this.LabelPassword1.Text = Resources.Pages.Public.Signup_Password1;
this.LabelPassword2.Text = Resources.Pages.Public.Signup_Password2;
@@ -124,6 +143,14 @@ namespace Swarmops.Frontend.Pages.Public
this.TextPhone.Attributes["placeholder"] = "+1 263 151 1341";
this.TextStreet1.Attributes["placeholder"] = "78 West Avenue";
this.TextPostal.Attributes["placeholder"] = "12345";
// Enable support for RTL languages
if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
{
this.LiteralBodyAttributes.Text = @"dir='rtl' class='rtl'";
}
}
+46
View File
@@ -27,6 +27,10 @@
height:300px;
}
body.rtl .swMain .stepContainer {
clear: left;
}
.swMain .stepContainer div.content {
float:left;
margin: 0;
@@ -48,6 +52,14 @@
height:300px;*/
}
body.rtl .swMain .stepContainer div.content {
float: right;
text-align: right;
padding-right: 15px;
padding-left: inherit;
}
.swMain div.actionBar {
display:block;
position: relative;
@@ -66,6 +78,11 @@
/*border-radius: 5px;*/
}
body.rtl .swMain div.actionBar {
clear: left;
text-align: right;
}
.swMain .stepContainer .StepTitle {
display:block;
position: relative;
@@ -90,6 +107,12 @@
border: 0px solid #CCCCCC;
background: transparent; /*#EEEEEE */
}
body.rtl .swMain ul.anchor {
float: right;
margin: 5px 0 0 10px;
}
.swMain ul.anchor li{
position: relative;
display:block;
@@ -102,6 +125,11 @@
clear: both;
}
body.rtl .swMain ul.anchor li {
float: right;
}
/* Anchor Element Style */
.swMain ul.anchor li a {
display:block;
@@ -134,6 +162,15 @@
width:70%;
font: bold 15px Ubuntu, sans-serif;
}
body.rtl .swMain ul.anchor li a .stepNumber, body.rtl .swMain ul.anchor li a .stepDesc {
float: right;
}
body.rtl .swMain ul.anchor li a .stepDesc {
text-align: right;
}
.swMain ul.anchor li a .stepDesc small{
font: normal 11px Ubuntu, sans-serif;
line-height: 12px;
@@ -216,6 +253,10 @@
border-radius: 5px;
}
body.rtl .swMain .buttonNext {
float: left;
}
.swMain .buttonPrevious {
display:block;
float:right;
@@ -247,6 +288,11 @@
border-radius: 5px;
}
body.rtl .swMain .buttonFinish {
float: left;
margin: 5px 3px 0 10px;
}
.swMain .buttonPrevious {
position: relative;
color: white;