Skip to content
Snippets Groups Projects
Commit 2bf209da authored by Michael Drury's avatar Michael Drury
Browse files

imnproved looks of add new email and mobile, updated so that usernames can...

imnproved looks of add new email and mobile, updated so that usernames can only be up to 12 long so fit in navbar
parent 26aa21da
No related branches found
No related tags found
No related merge requests found
File deleted
......@@ -10,7 +10,7 @@ class LoginForm(FlaskForm):
submit = SubmitField('Submit')
class SignupForm(FlaskForm):
username = StringField('Username', validators=[input_required(), Length(1, 16)])
username = StringField('Username', validators=[input_required(), Length(1, 12)])
password = PasswordField('Password', validators=[input_required()])
verifyPassword = PasswordField('Verify password', validators=[input_required(), EqualTo('password', message='Passwords must match')])
email = StringField('email', validators=[Regexp(regex="^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$", message = 'has to be a valid email'), input_required()])
......
......@@ -43,6 +43,8 @@ def signup():
if User.query.filter_by(username=username_in).first() is None:
User.register(username_in, password_in, email_in, mobile_in)
return redirect(url_for('login'))
else:
return render_template('signup.html', form=form, exists = True)
return render_template('signup.html', form=form)
# logs out the user when pressed and takes the user to the home page
......
......@@ -91,6 +91,13 @@ a:link {
transform: translate(50%, 40%);
}
.signin_box {
width: 50%;
border: 3px solid black;
transform: translate(50%, 5%);
margin-bottom: 100px;
}
.login_title {
font-size: 300%;
text-align: center;
......@@ -311,11 +318,7 @@ li {
font-size: 150%;
}
.signin_box {
width: 50%;
border: 3px solid black;
transform: translate(50%, 10%);
}
.login_field {
font-size: 1.5vw;
......@@ -599,4 +602,11 @@ li {
float: left;
clear: left;
margin-left: 10%
}
.user_exists {
text-align: center;
color: red;
font-family: Andale Mono, monospace;
font-size: 2vw;
}
\ No newline at end of file
......@@ -3,6 +3,11 @@
{% block title %}Login Example{% endblock %}
{% block page_content %}
{% if exists %}
<p class = "user_exists">User already exists</p>
{% endif %}
<div class="signin_box">
<h1 class = "login_title" >Sign up</h1>
<form action="" method="POST">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment