-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added main screen and linked raven tor to its own page
- Loading branch information
farthingt
committed
Apr 3, 2024
1 parent
821a742
commit c9d2d02
Showing
13 changed files
with
190 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| x:Class="WebAppCW.CreateAccountPage" | ||
| Title="Account Creation"> | ||
| <VerticalStackLayout | ||
| Padding="30,0" | ||
| Spacing="25"> | ||
| <Entry | ||
| x:Name="UsernameEntry" | ||
| Placeholder="Username"/> | ||
| <Entry | ||
| x:Name="PasswordEntry1" | ||
| Placeholder="Password" IsPassword="True"/> | ||
| <Entry | ||
| x:Name="PasswordEntry2" | ||
| Placeholder="Confirm Password" IsPassword="True"/> | ||
| <Entry | ||
| x:Name="EmailEntry" | ||
| Placeholder="Email Address"/> | ||
| <Button | ||
| Text="Create Account" | ||
| Clicked="OnCreateAccountButtonClicked"/> | ||
| <Label | ||
| x:Name="CreateAccountStatusLabel"/> | ||
| </VerticalStackLayout> | ||
| </ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| namespace WebAppCW; | ||
|
|
||
| public partial class CreateAccountPage : ContentPage | ||
| { | ||
| public CreateAccountPage() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| private void OnCreateAccountButtonClicked(object sender, EventArgs e) | ||
| { | ||
| string username = UsernameEntry.Text; | ||
| string password1 = PasswordEntry1.Text; | ||
| string password2 = PasswordEntry2.Text; | ||
| string email = EmailEntry.Text; | ||
|
|
||
| if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password1) | ||
| || string.IsNullOrWhiteSpace(password2) || string.IsNullOrWhiteSpace(email)) | ||
| { | ||
| CreateAccountStatusLabel.Text = "Please ensure all fields are filled"; | ||
| return; | ||
| } | ||
|
|
||
| bool isUsernameAvailable = checkUsernameAvailability(username); | ||
|
|
||
| if (!isUsernameAvailable) | ||
| { | ||
| CreateAccountStatusLabel.Text = "Username is already taken. Please choose another"; | ||
| return; | ||
| } | ||
|
|
||
| bool isPasswordSame = checkPasswordValidity(password1, password2); | ||
|
|
||
| if (!isPasswordSame) | ||
| { | ||
| CreateAccountStatusLabel.Text = "Passwords do not match up. Please ensure both " + | ||
| "the password and the password confirmation are the same"; | ||
| return; | ||
| } | ||
|
|
||
| bool isAccountCreated = createAccount(username, password1, email); | ||
|
|
||
| if (isAccountCreated) | ||
| { | ||
| Navigation.PushAsync(new MainPage()); | ||
| } | ||
| else | ||
| { | ||
| CreateAccountStatusLabel.Text = "Failed to create account"; | ||
| return; | ||
| } | ||
| } | ||
|
|
||
| private bool checkUsernameAvailability(string username) | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| private bool checkPasswordValidity(string password1, string password2) | ||
| { | ||
| if (password1 == password2) | ||
| { | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| private bool createAccount(string username, string password, string email) | ||
| { | ||
| return true; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| x:Class="WebAppCW.RavenTorPage" | ||
| Title="RavenTor"> | ||
| <VerticalStackLayout> | ||
| <Image | ||
| Source="raven_tor_img" | ||
| HeightRequest="185" | ||
| Aspect="AspectFit" | ||
| SemanticProperties.Description="Raven Tor cave" /> | ||
| <Label | ||
| Text="Climbs: | ||
| Ben's Roof - 7C: Cross the cave from sitting | ||
| at the back right-hand corner, with left hand | ||
| on a big hold and right hand on a pinch to | ||
| finish as for Too Hard for Mark Leach. | ||
|
|
||
| Weedkiller Traverse - 7A+: This classic | ||
| testpiece traverses the line of weakness | ||
| across the first overlap. Start on the small | ||
| pillar on incut jugs and swing across finishing | ||
| up Chimes Start. | ||
|
|
||
| Belly of the Beast - 8B: The full line of the | ||
| cave, link the start of Ben's Roof Extension | ||
| Start into Keen Roof." | ||
| VerticalOptions="Center" | ||
| HorizontalOptions="Center" /> | ||
| </VerticalStackLayout> | ||
| </ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| namespace WebAppCW; | ||
|
|
||
| public partial class RavenTorPage : ContentPage | ||
| { | ||
| public RavenTorPage() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters