Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS123-Canteeneo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Willard Torres
CS123-Canteeneo
Commits
cbba767a
Commit
cbba767a
authored
Nov 15, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More styling of landing page, reordering views
parent
8d0a7b22
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
68 additions
and
695 deletions
+68
-695
forms.py
canteeneo/forms.py
+7
-7
bootstrap-theme.css
canteeneo/static/css/bootstrap-theme.css
+0
-587
bootstrap-theme.min.css
canteeneo/static/css/bootstrap-theme.min.css
+0
-6
custom.css
canteeneo/static/css/custom.css
+7
-0
base.html
canteeneo/templates/base.html
+16
-2
landing.html
canteeneo/templates/landing.html
+35
-36
login.html
canteeneo/templates/login.html
+0
-22
register.html
canteeneo/templates/register.html
+0
-32
views.py
canteeneo/views.py
+3
-3
No files found.
canteeneo/forms.py
View file @
cbba767a
...
...
@@ -5,8 +5,8 @@ from wtforms.validators import DataRequired, EqualTo, Email
from
models
import
Owner
,
Stall
,
Dish
class
OwnerLoginForm
(
FlaskForm
):
username
=
StringField
(
'Username'
,
[
DataRequired
()])
password
=
PasswordField
(
'Password'
,
[
DataRequired
()])
username
=
StringField
(
'Username'
,
[
DataRequired
()]
,
render_kw
=
{
"placeholder"
:
"Username"
}
)
password
=
PasswordField
(
'Password'
,
[
DataRequired
()]
,
render_kw
=
{
"placeholder"
:
"Password"
}
)
def
validate
(
self
):
if
not
FlaskForm
.
validate
(
self
):
...
...
@@ -23,11 +23,11 @@ class OwnerLoginForm(FlaskForm):
return
True
,
owner
class
OwnerRegisterForm
(
FlaskForm
):
email
=
StringField
(
'Email'
,
[
DataRequired
(),
Email
()])
name
=
StringField
(
'Name'
,
[
DataRequired
()])
username
=
StringField
(
'Username'
,
[
DataRequired
()])
password
=
PasswordField
(
'Password'
,
[
DataRequired
()])
confirm_password
=
PasswordField
(
'Confirm Password'
,
[
EqualTo
(
'password'
)])
email
=
StringField
(
'Email'
,
[
DataRequired
(),
Email
()]
,
render_kw
=
{
"placeholder"
:
"E-mail"
}
)
name
=
StringField
(
'Name'
,
[
DataRequired
()]
,
render_kw
=
{
"placeholder"
:
"Name"
}
)
username
=
StringField
(
'Username'
,
[
DataRequired
()]
,
render_kw
=
{
"placeholder"
:
"Username"
}
)
password
=
PasswordField
(
'Password'
,
[
DataRequired
()]
,
render_kw
=
{
"placeholder"
:
"Password"
}
)
confirm_password
=
PasswordField
(
'Confirm Password'
,
[
EqualTo
(
'password'
)]
,
render_kw
=
{
"placeholder"
:
"Confirm Password"
}
)
def
validate
(
self
):
if
not
FlaskForm
.
validate
(
self
):
...
...
canteeneo/static/css/bootstrap-theme.css
deleted
100644 → 0
View file @
8d0a7b22
This diff is collapsed.
Click to expand it.
canteeneo/static/css/bootstrap-theme.min.css
deleted
100644 → 0
View file @
8d0a7b22
This diff is collapsed.
Click to expand it.
canteeneo/static/css/custom.css
0 → 100644
View file @
cbba767a
.btn-lg
{
border-radius
:
0px
;
}
.form-group-lg
.form-control
{
border-radius
:
0px
;
}
\ No newline at end of file
canteeneo/templates/base.html
View file @
cbba767a
...
...
@@ -7,12 +7,26 @@
<title>
Canteeneo - {% block title %}{% endblock%}
</title>
{% endblock %}
<link
rel=
"stylesheet"
href=
"{{ url_for('static', filename='css/bootstrap.css') }}"
>
<link
rel=
"stylesheet"
href=
"{{ url_for('static', filename='css/custom.css') }}"
>
</head>
<body>
<div
class=
"container-fluid"
>
{% with messages = get_flashed_messages() %} {% if messages %} {% for message in messages %}
<span>
{{ message }}
</span><br>
{% endfor %} {% endif %} {% endwith %} {% block content %} {% endblock %}
<div
class=
"row"
>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div
class=
"alert alert-danger alert-dismissible"
role=
"alert"
>
{{ message }}
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
</div>
{% block content %} {% endblock %}
</div>
</body>
<script
src=
"{{ url_for('static', filename='js/jquery-3.1.1.js') }}"
></script>
...
...
canteeneo/templates/landing.html
View file @
cbba767a
...
...
@@ -5,45 +5,44 @@
{% block content %}
<div
class=
"row"
>
<div
class=
"col-md-4 col-md-offset-2"
>
<form
method=
"POST"
action=
"/login"
>
{{ login_form.csrf_token }}
<div
class=
"form-group"
>
{{ login_form.username.label }}
{{ login_form.username(class_="form-control") }}
</div>
<div
class=
"form-group"
>
{{ login_form.password.label }}
{{ login_form.password(class_="form-control") }}
</div>
<button
class=
"btn btn-default btn-large"
type=
"submit"
>
Login
</button>
</form>
<div
style=
"padding: 5%;"
>
<h1>
Login
</h1>
<form
method=
"POST"
action=
"/login"
>
{{ login_form.csrf_token }}
<div
class=
"form-group form-group-lg"
>
{{ login_form.username(class_="form-control") }}
</div>
<div
class=
"form-group form-group-lg"
>
{{ login_form.password(class_="form-control") }}
</div>
<button
class=
"btn btn-primary btn-lg"
type=
"submit"
>
Login
</button>
</form>
</div>
</div>
<div
class=
"col-md-4"
>
<form
method=
"POST"
action=
"/register"
>
{{ register_form.csrf_token }}
<div
class=
"form-group"
>
{{ register_form.email.label}}
{{ register_form.email(class_="form-control") }}
</div>
<div
class=
"form-group"
>
{{ register_form.name.label}}
{{ register_form.name(class_="form-control") }}
</div>
<div
class=
"form-group"
>
{{ register_form.username.label}}
{{ register_form.username(class_="form-control") }}
</div>
<div
class=
"form-group"
>
{{ register_form.password.label}}
{{ register_form.password(class_="form-control") }}
</div>
<div
class=
"form-group"
>
{{ register_form.confirm_password.label}}
{{ register_form.confirm_password(class_="form-control") }}
</div>
<button
class=
"btn btn-default btn-large"
type=
"submit"
>
Register
</button>
</form>
<div
style=
"padding: 5%;"
>
<h1>
Register
</h1>
<form
method=
"POST"
action=
"/register"
>
{{ register_form.csrf_token }}
<div
class=
"form-group form-group-lg"
>
{{ register_form.email(class_="form-control") }}
</div>
<div
class=
"form-group form-group-lg"
>
{{ register_form.name(class_="form-control") }}
</div>
<div
class=
"form-group form-group-lg"
>
{{ register_form.username(class_="form-control") }}
</div>
<div
class=
"form-group form-group-lg"
>
{{ register_form.password(class_="form-control") }}
</div>
<div
class=
"form-group form-group-lg"
>
{{ register_form.confirm_password(class_="form-control") }}
</div>
<button
class=
"btn btn-primary btn-lg"
type=
"submit"
>
Register
</button>
</form>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
canteeneo/templates/login.html
deleted
100644 → 0
View file @
8d0a7b22
{% extends "base.html" %}
{% block title %}Login{% endblock %}
{% block content %}
<form
method=
"POST"
action=
"/login"
>
{{ form.csrf_token }}
<div
id=
"login-form"
>
<div
class=
"form-input"
>
<div
class=
"input-row"
>
{{ form.username.label(class_="field-label") }}
{{ form.username(class_="text-field") }}
</div>
<div
class=
"input-row"
>
{{ form.password.label(class_="field-label") }}
{{ form.password(class_="text-field") }}
</div>
</div>
<button
type=
"submit"
>
Login
</button>
</div>
</form>
{% endblock %}
\ No newline at end of file
canteeneo/templates/register.html
deleted
100644 → 0
View file @
8d0a7b22
{% extends "base.html" %}
{% block title %}Register{% endblock %}
{% block content %}
<form
method=
"POST"
action=
"/register"
>
{{ form.csrf_token }}
<div
id=
"register-form"
>
<div
class=
"form-input"
>
<div
class=
"input-row"
>
{{ form.email.label(class_="field-label")}}
{{ form.email(class_="text-field") }}
</div>
<div
class=
"input-row"
>
{{ form.name.label(class_="field-label")}}
{{ form.name(class_="text-field") }}
</div>
<div
class=
"input-row"
>
{{ form.username.label(class_="field-label")}}
{{ form.username(class_="text-field") }}
</div>
<div
class=
"input-row"
>
{{ form.password.label(class_="field-label")}}
{{ form.password(class_="text-field") }}
</div>
<div
class=
"input-row"
>
{{ form.confirm_password.label(class_="field-label")}}
{{ form.confirm_password(class_="text-field") }}
</div>
</div>
<button
type=
"submit"
>
Register
</button>
</div>
</form>
{% endblock %}
\ No newline at end of file
canteeneo/views.py
View file @
cbba767a
...
...
@@ -37,7 +37,7 @@ class LoginView(FormView):
login_user
(
Owner
.
query
.
filter_by
(
username
=
self
.
get_form
()
.
username
.
data
)
.
first
())
return
redirect
(
url_for
(
'stalls'
))
def
render_get
(
self
):
return
re
nder_template
(
'landing.html'
,
login_form
=
OwnerLoginForm
(),
register_form
=
OwnerRegisterForm
()
)
return
re
direct
(
'/'
)
def
get_form
(
self
):
return
OwnerLoginForm
()
...
...
@@ -48,9 +48,9 @@ class RegisterView(FormView):
owner
=
Owner
(
form
.
name
.
data
,
form
.
username
.
data
,
form
.
email
.
data
,
form
.
password
.
data
)
db
.
session
.
add
(
owner
)
db
.
session
.
commit
()
return
redirect
(
url_for
(
'
login
'
))
return
redirect
(
url_for
(
'
register
'
))
def
render_get
(
self
):
return
re
nder_template
(
'landing.html'
,
login_form
=
OwnerLoginForm
(),
register_form
=
OwnerRegisterForm
()
)
return
re
direct
(
'/'
)
def
get_form
(
self
):
return
OwnerRegisterForm
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment