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
578bd7d6
Commit
578bd7d6
authored
Nov 17, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restyle stall info page, make edit stall and new stall use the same template
parent
24f3da91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
29 deletions
+37
-29
forms.py
canteeneo/forms.py
+2
-2
stall_views.py
canteeneo/stall_views.py
+2
-2
newstall.html
canteeneo/templates/newstall.html
+0
-25
stallinfo.html
canteeneo/templates/stallinfo.html
+33
-0
No files found.
canteeneo/forms.py
View file @
578bd7d6
...
...
@@ -45,8 +45,8 @@ class OwnerRegisterForm(FlaskForm):
return
True
class
StallRegisterForm
(
FlaskForm
):
name
=
StringField
(
'Name'
,
[
DataRequired
()])
description
=
TextAreaField
(
'Description'
,
[
DataRequired
()])
name
=
StringField
(
'Name'
,
[
DataRequired
()]
,
render_kw
=
{
'placeholder'
:
'Name'
}
)
description
=
TextAreaField
(
'Description'
,
[
DataRequired
()]
,
render_kw
=
{
'placeholder'
:
'Describe your stall'
}
)
image
=
FileField
(
'Image'
)
location
=
SelectField
(
coerce
=
int
)
editing
=
False
...
...
canteeneo/stall_views.py
View file @
578bd7d6
...
...
@@ -21,7 +21,7 @@ class NewStallView(FormView):
db
.
session
.
commit
()
return
redirect
(
url_for
(
'view_stall'
,
stall_id
=
self
.
stall
.
id
))
def
render_get
(
self
):
return
render_template
(
'
newstall.html'
,
form
=
self
.
get_form
()
)
return
render_template
(
'
stallinfo.html'
,
form
=
self
.
get_form
(),
title
=
'Register Stall'
,
form_action
=
url_for
(
'new_stall'
),
submit_label
=
'Submit'
)
def
get_form
(
self
):
form
=
StallRegisterForm
()
form
.
location
.
choices
=
[(
loc
.
id
,
loc
.
name
)
for
loc
in
Location
.
query
.
all
()]
...
...
@@ -51,7 +51,7 @@ class EditStallView(FormView):
form
.
name
.
data
=
self
.
stall
.
name
form
.
description
.
data
=
self
.
stall
.
description
form
.
location
.
data
=
self
.
stall
.
location_id
return
render_template
(
'
editstall.html'
,
form
=
form
,
stall
=
self
.
stall
)
return
render_template
(
'
stallinfo.html'
,
form
=
form
,
stall
=
self
.
stall
,
title
=
'Edit Info'
,
form_action
=
url_for
(
'view_stall'
,
stall_id
=
self
.
stall
.
id
),
submit_label
=
'Edit'
)
def
get_form
(
self
):
form
=
StallRegisterForm
()
form
.
location
.
choices
=
[(
loc
.
id
,
loc
.
name
)
for
loc
in
Location
.
query
.
all
()]
...
...
canteeneo/templates/newstall.html
deleted
100644 → 0
View file @
24f3da91
{% extends "base.html" %}
{% block title %}Register your Stall{% endblock %}
{% block content %}
<h1>
Stall Info
</h1>
<form
action=
"{{url_for('new_stall')}}"
method=
"POST"
>
{{ form.csrf_token }}
<div
id=
"form"
>
<div
class=
"form-input"
>
<div
class=
"input-row"
>
{{ form.name.label(class_="field-label") }} {{ form.name(class_="text-field") }}
</div>
<div
class=
"input-row"
>
{{ form.description.label(class_="field-label") }} {{ form.description(class_="text-area", rows=6, cols=32) }}
</div>
<div
class=
"input-row"
>
{{ form.location.label(class_="field-label") }} {{ form.location(class_="text-field") }}
</div>
</div>
<div
class=
"dashboard-row"
>
<button
type=
"submit"
>
Add
</button>
<a
href=
"{{url_for('stalls')}}"
><button
type=
"button"
class=
"link-button"
>
Back
</button></a>
</div>
</div>
</form>
{% endblock %}
\ No newline at end of file
canteeneo/templates/stallinfo.html
0 → 100644
View file @
578bd7d6
{% extends "base.html" %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<h1>
Stall Info
</h1>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<form
action=
"{{ form_action }}"
method=
"POST"
>
{{ form.csrf_token }}
<div
class=
"form-group form-group-lg col-sm-8"
>
{{ form.name(class_="form-control") }}
</div>
<div
class=
"form-group form-group-lg col-sm-12"
>
{{ form.description(class_="form-control", rows=16) }}
</div>
<div
class=
"form-group form-group-lg col-sm-12"
>
{{ form.location.label(class_="col-sm-6 control-label") }} {{ form.location(class_="form-control") }}
</div>
<div
class=
"form-group form-group-lg"
>
<div
class=
"col-sm-6"
>
<button
class=
"btn btn-primary btn-block btn-lg"
type=
"submit"
>
{{ submit_label }}
</button>
</div>
<div
class=
"col-sm-6"
>
<a
href=
"{{url_for('stalls')}}"
><button
class=
"btn btn-default btn-block btn-lg"
type=
"button"
>
Back
</button></a>
</div>
</div>
</form>
</div>
</div>
{% endblock %}
\ No newline at end of file
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