-
Notifications
You must be signed in to change notification settings - Fork 0
Ally/registration #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CloudF1sh
wants to merge
19
commits into
dev-main
Choose a base branch
from
ally/registration
base: dev-main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
75a8e1b
Small routes test
CloudF1sh db2469c
Fingers crossed!
CloudF1sh a29c160
Small tweaks, and userpage added.
CloudF1sh 3964063
I think I broke something on the last one. ROUND 2!
CloudF1sh 15b8c43
Fixed missing menu bar on registration page
CloudF1sh 5bc3be2
minor tweaks, removed login requirement, user page gets 404 though
CloudF1sh 61c7bed
>_<
CloudF1sh 45014a9
Re-introduce login requirements
CloudF1sh 27dabce
Merge branch 'dev-main' into ally/registration
5e22f60
remove login required from user
3235283
Possible malfunction between chair and keyboard.
CloudF1sh d179368
Maybe?
CloudF1sh bb8c4be
removed a letter XD
CloudF1sh 4f1b65a
Did absolutely nothing of note this time
CloudF1sh e7d4719
Merge branch 'dev-main' into ally/registration
dc413e7
*insert meme here*
CloudF1sh 856be88
And the plot thickens....
CloudF1sh ae6077d
*summons coffee*
CloudF1sh 1a0c5f8
Removed login requirements again, still unable to connect via localho…
CloudF1sh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,10 +1,28 @@ | ||
| from flask_wtf import FlaskForm | ||
| from wtforms import StringField, PasswordField, BooleanField, SubmitField | ||
| from wtforms.validators import DataRequired | ||
| from wtforms.validators import DataRequired, ValidationError, Email, EqualTo | ||
| from app.models import User | ||
|
|
||
|
|
||
| class LoginForm(FlaskForm): | ||
| username = StringField("Username", validators=[DataRequired()]) | ||
| password = PasswordField("Password", validators=[DataRequired()]) | ||
| remember_me = BooleanField("Remember Me") | ||
| submit = SubmitField("Log In") | ||
|
|
||
| class RegistrationForm(FlaskForm): | ||
| username = StringField('Username', validators=[DataRequired()]) | ||
| email = StringField('Email',validators=[DataRequired(), Email()]) | ||
| password = PasswordField('Password', validators=[DataRequired()]) | ||
| password2 = PasswordField('Repeat Password', validators=[DataRequired(), EqualTo('password')]) | ||
| submit = SubmitField('Register') | ||
|
|
||
| def validate_usernames(self, username): | ||
| user = User.query.filter_by(username=username.data).first() | ||
| if user is not None: | ||
| raise ValidationError('This username is already in use.') | ||
|
|
||
| def validate_email(self, email): | ||
| user = User.query.filter_by(email=email.data).first() | ||
| if user is not None: | ||
| raise ValidationError('This email address is already active.') |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| {% extends "base.html" %} | ||
| {% block content %} | ||
| <div class="container"> | ||
| <h1>Page Not Found</h1> | ||
| <h1>Page Has Been Eaten by a Gru</h1> | ||
| <p><a href="{{ url_for('index') }}">Back to home</a></p> | ||
| </div> | ||
| {% endblock %} | ||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block content %} | ||
| <div class="container"> | ||
| <h1>Hi, {{ user.username }}!</h1> | ||
| </div> | ||
| {% for post in posts %} | ||
| <div class="container"> | ||
| <p>{{ post.author.username }} says: <b>{{ post.body }}</b></p> | ||
| </div> | ||
| {% endfor %} | ||
| <div class="container"> | ||
| <h1>Hi, {{ user.username }}!</h1> | ||
| </div> | ||
| {% for post in posts %} | ||
| <div class="container"> | ||
| <p>{{ post.author.username }} says: <b>{{ post.body }}</b></p> | ||
| </div> | ||
| {% endfor %} | ||
| {% endblock %} |
This file contains hidden or 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 hidden or 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,39 @@ | ||
| {% extends 'base.html' %} | ||
|
|
||
|
SalMireles marked this conversation as resolved.
|
||
| {% block content %} | ||
| <div class="container"> | ||
| <h1>Register</h1> | ||
| <form action ="" method="post"> | ||
| {{ form.hidden_tag() }} | ||
| <p> | ||
| {{ form.username.label }}<br> | ||
| {{ form.username(size=32) }}<br> | ||
| {% for error in form.username.errors %} | ||
| <span style="color:red;">[{{ error }}]</span> | ||
| {% endfor %} | ||
| </p> | ||
| <p> | ||
| {{ form.email.label }}<br> | ||
| {{ form.email(size=32) }}<br> | ||
| {% for error in form.email.errors %} | ||
| <span style="color:red;">[{{ error }}]</span> | ||
| {% endfor %} | ||
| </p> | ||
| <p> | ||
| {{ form.password.label }}<br> | ||
| {{ form.password(size=32) }}<br> | ||
| {% for error in form.password.errors %} | ||
| <span style="color:red;">[{{ error }}]</span> | ||
| {% endfor %} | ||
| </p> | ||
| <p> | ||
| {{ form.password2.label }}<br> | ||
| {{ form.password2(size=32) }}<br> | ||
| {% for error in form.password2.errors %} | ||
| <span style="color:red;">[{{ error }}]</span> | ||
| {% endfor %} | ||
| </p> | ||
| <p>{{ form.submit() }}</p> | ||
| </form> | ||
| </div> | ||
| {% endblock %} | ||
This file contains hidden or 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,21 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block content %} | ||
| <table> | ||
| <tr valign="top"> | ||
| <td><img src="{{ user.avatar(128) }}"></td> | ||
| <td><h1>User: {{ user.username }}</h1></td> | ||
| </tr> | ||
| </table> | ||
| <div class="container"> | ||
| <hr> | ||
| {% for post in posts %} | ||
| <table> | ||
| <tr valign="top"> | ||
| <td><img src="{{ post.avatar(36) }}"></td> | ||
| <td>{{ post.author.username }} says:<br>{{ post.body }}</td> | ||
| </tr> | ||
| </table> | ||
| {%endfor %} | ||
| </div> | ||
| {% endblock %} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.