From 54149d534afaee93926d4868cdd5b37996276fd2 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 9 May 2015 16:57:37 +0200 Subject: [PATCH] More work on self-signup --- Logic/Swarm/Participation.cs | 2 + Site5/Controls/v5/Base/DropDown.ascx.cs | 7 + .../iconshock-database-star-40px.png | Bin 0 -> 3229 bytes Site5/MainMenu-v5.xml | 3 +- .../v5/Public/GeoLookupHelpers.js.include | 187 ++++++++++ Site5/Pages/v5/Public/Signup.aspx | 353 +++++++++++++++--- Site5/Pages/v5/Public/Signup.aspx.cs | 76 ++++ Site5/Pages/v5/Swarm/AddPerson.aspx | 40 +- 8 files changed, 595 insertions(+), 73 deletions(-) create mode 100644 Site5/Images/PageIcons/iconshock-database-star-40px.png create mode 100644 Site5/Pages/v5/Public/GeoLookupHelpers.js.include diff --git a/Logic/Swarm/Participation.cs b/Logic/Swarm/Participation.cs index 8d5d11e3..bee9f273 100644 --- a/Logic/Swarm/Participation.cs +++ b/Logic/Swarm/Participation.cs @@ -181,6 +181,8 @@ namespace Swarmops.Logic.Swarm public void Terminate (EventSource eventSource, Person actingPerson, string description) { + // TODO: This needs a new overload for v5, which adds the Position and possibly removes the EventSource + if (base.Active) { diff --git a/Site5/Controls/v5/Base/DropDown.ascx.cs b/Site5/Controls/v5/Base/DropDown.ascx.cs index d8bd08af..fd020e53 100644 --- a/Site5/Controls/v5/Base/DropDown.ascx.cs +++ b/Site5/Controls/v5/Base/DropDown.ascx.cs @@ -1,5 +1,7 @@ using System; +using System.Web.UI; using System.Web.UI.WebControls; +using Newtonsoft.Json.Converters; namespace Swarmops.Frontend.Controls.v5.Base { @@ -24,6 +26,11 @@ namespace Swarmops.Frontend.Controls.v5.Base get { return this.ClientID + "_DropControl"; } } + public DropDownList ClientControl + { + get { return this.DropControl; } + } + protected void Page_Load (object sender, EventArgs e) { } diff --git a/Site5/Images/PageIcons/iconshock-database-star-40px.png b/Site5/Images/PageIcons/iconshock-database-star-40px.png new file mode 100644 index 0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zGPw)4Q?(41^<8w9isYvE!}N{hxdv#iNic6f0Qo~a6n_R1gGVBV`&7gaWsP~jUms8i zgcR5*lU@YPc86xI!#_DWwoOiO^~`3Py?}$q7LbNyzTQR%NVyLEAS9bD&^H86+keUx zuir^_>Up3Kgup(Kb+}r<|H#+ram^;G=)WkBEYc=YCb@WCJ44?w@u$saj#jO^qV zTp`HI+> zdl;4M{~&8E~UI&-IJ%${K7$Pt3J&(^#5fg@l^<2_@N z{-p$Rz_cJWuianX#J2CBWC0i&0M_5~*N1J}vcB3puyyO!Ye%Zpbh%unSS&I%F~LPU zrnz+cc4jI=YzX`0=1*Y0_A=fJ&#?T&kC=VvK{|W)l5e-zHB{pLm+#@%F5Sw^?t2Me zwRq%#pXbZ7zrn=P0e`~U2;gMm6$_3IX2UGP}KD?3d z9=L|bPnyil9@}^OH;(_-N2Y^w@)wH2kTeF_+5;)0AkHkR&n9c85l@!%DM76oojJfhj?&1h4PS)|MMbI<3}A z3rnm2`r7`NpOL_37OTp(Q>s*G)# zoZOPl7ADfJQ!%7r0YWJi`9ZMUZFlBQ&7M5ATw9zUcxZ3X1_J=$n50rB)x%%o{#Jt* zZ}=Ryy;h^~Mz(w=fd4xSk^^Wt7)QKGDx?N&GPqZ75mC*7yH-FvI05)iLprc>c0cMm P00000NkvXXu0mjf<-j{n literal 0 HcmV?d00001 diff --git a/Site5/MainMenu-v5.xml b/Site5/MainMenu-v5.xml index 82d64fca..ca8561dc 100644 --- a/Site5/MainMenu-v5.xml +++ b/Site5/MainMenu-v5.xml @@ -42,7 +42,8 @@ People_SelfSignup 2 - SpecialSelfSignup + iconshock-database-star + SpecialSelfSignup diff --git a/Site5/Pages/v5/Public/GeoLookupHelpers.js.include b/Site5/Pages/v5/Public/GeoLookupHelpers.js.include new file mode 100644 index 00000000..2c532230 --- /dev/null +++ b/Site5/Pages/v5/Public/GeoLookupHelpers.js.include @@ -0,0 +1,187 @@ + \ No newline at end of file diff --git a/Site5/Pages/v5/Public/Signup.aspx b/Site5/Pages/v5/Public/Signup.aspx index b0da9800..418c3f87 100644 --- a/Site5/Pages/v5/Public/Signup.aspx +++ b/Site5/Pages/v5/Public/Signup.aspx @@ -11,6 +11,7 @@ + @@ -22,6 +23,8 @@ <%=Organization.Name %> - Signup + + @@ -47,6 +50,25 @@ font-size: 200%; text-align: center; } + + .swMain { + height: 420px !important; + } + + .stepContainer { + height: 380px !important; + } + + div.stepContainer > div.content { + overflow: initial !important; + } + + + + .entryLabelsAdmin { + width: 280px; + } + @@ -54,79 +76,274 @@
+ @@ -167,12 +384,19 @@
  • - Activity
    + Activity 1
    How much do you wish to engage?
  • + + Activity 2
    + What would you like to engage in? +
    +
  • +
  • + Complete
    All done. Let's login! @@ -184,11 +408,34 @@

    This is the organization's custom welcome text. It has not yet been written; it is set in Admin / Org Settings.

    -

    Initializing database

    - + +
    + ​
    + ​
    + ​
    + ​
    + ​
    + ​
    +
     
    XX–
    + ... 
    + ​
    + ​
    +
    +
    -

    Initializing database

    +

    Your Logon

    Creating the first user

    diff --git a/Site5/Pages/v5/Public/Signup.aspx.cs b/Site5/Pages/v5/Public/Signup.aspx.cs index 335079e7..afb2f2d2 100644 --- a/Site5/Pages/v5/Public/Signup.aspx.cs +++ b/Site5/Pages/v5/Public/Signup.aspx.cs @@ -4,7 +4,10 @@ using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using Resources; +using Swarmops.Logic.Security; using Swarmops.Logic.Structure; +using Swarmops.Logic.Swarm; namespace Swarmops.Frontend.Pages.Public { @@ -24,8 +27,81 @@ namespace Swarmops.Frontend.Pages.Public { throw new ArgumentException("Organization not specified"); // TODO: make a friendly landing page instead } + + + // Override style widths - (this will cause problems with a future responsive design; come back here to fix that) + + this.DropCountries.Style[HtmlTextWriterStyle.Width] = "162px"; + + /* + this.BoxTitle.Text = PageTitle = String.Format(Resources.Pages.Swarm.AddPerson_Title, + Participant.Localized(CurrentOrganization.RegularLabel)); + InfoBoxLiteral = String.Format(Resources.Pages.Swarm.AddPerson_Info, Global.Timespan_OneYear, + Participant.Localized(CurrentOrganization.RegularLabel, TitleVariant.Ship), + DateTime.Today.AddYears(1).ToLongDateString());*/ + + if (!Page.IsPostBack) + { + Localize(); + Populate(); + + this.TextName.Focus(); + } + } + private void Populate() + { + Countries allCountries = Countries.All; + this.DropCountries.Items.Clear(); + + foreach (Country country in allCountries) + { + string countryLocalName = country.Localized; + string countryDisplay = country.Code + " " + countryLocalName; + this.DropCountries.Items.Add (new ListItem (countryDisplay, country.Code)); + } + + if (this.Organization.DefaultCountry != null) + { + this.DropCountries.SelectedValue = this.Organization.DefaultCountry.Code; + } + + this.DropGenders.Items.Clear(); + this.DropGenders.Items.Add (new ListItem (Global.Global_UnknownUndisclosed, "Unknown")); + this.DropGenders.Items.Add (new ListItem (Global.Global_Female, "Female")); + this.DropGenders.Items.Add (new ListItem (Global.Global_Male, "Male")); + } + + private void Localize() + { + this.LiteralErrorCity.Text = Resources.Pages.Swarm.AddPerson_ErrorCity; + this.LiteralErrorMail.Text = Resources.Pages.Swarm.AddPerson_ErrorMail; + this.LiteralErrorName.Text = Resources.Pages.Swarm.AddPerson_ErrorName; + this.LiteralErrorStreet.Text = Resources.Pages.Swarm.AddPerson_ErrorStreet; + this.LiteralErrorDate.Text = Resources.Pages.Swarm.AddPerson_ErrorDate; + + this.LabelName.Text = Resources.Global.Global_Name; + this.LabelCountry.Text = Resources.Global.Global_Country; + this.LabelMail.Text = Resources.Global.Global_Mail; + this.LabelPhone.Text = Resources.Global.Global_Phone; + this.LabelStreet1.Text = Resources.Pages.Swarm.AddPerson_Street1PO; + this.LabelStreet2.Text = Resources.Pages.Swarm.AddPerson_Street2; + this.LabelPostalCode.Text = Resources.Global.Global_PostalCode; + this.LabelCity.Text = Resources.Global.Global_City; + this.LabelGeographyDetected.Text = Resources.Pages.Swarm.AddPerson_GeographyDetected; + this.LabelDateOfBirth.Text = Resources.Global.Global_DateOfBirth; + this.LabelLegalGender.Text = Resources.Pages.Swarm.AddPerson_LegalGender; + + this.TextDateOfBirth.Attributes["placeholder"] = Global.Global_DateFormatShortReadable; + this.TextName.Attributes["placeholder"] = "Joe Smith"; + this.TextMail.Attributes["placeholder"] = "joe@example.com"; + this.TextPhone.Attributes["placeholder"] = "+1 263 151 1341"; + this.TextStreet1.Attributes["placeholder"] = "78 West Avenue"; + this.TextPostal.Attributes["placeholder"] = "12345"; + } + + protected Organization Organization; } } \ No newline at end of file diff --git a/Site5/Pages/v5/Swarm/AddPerson.aspx b/Site5/Pages/v5/Swarm/AddPerson.aspx index b848f2f2..4f82aeca 100644 --- a/Site5/Pages/v5/Swarm/AddPerson.aspx +++ b/Site5/Pages/v5/Swarm/AddPerson.aspx @@ -3,17 +3,17 @@ +