Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GrabGrub
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matthew Dominic M. Dizon
GrabGrub
Commits
e1d1efff
Commit
e1d1efff
authored
May 27, 2021
by
Matthew Dizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added customer and food pages including details
parent
f4c47c40
Pipeline
#1921
canceled with stages
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
182 additions
and
63 deletions
+182
-63
base.html
GrabGrub/Kiosk/templates/Kiosk/base.html
+22
-7
home.html
GrabGrub/Kiosk/templates/Kiosk/home.html
+21
-54
view_customer_details.html
GrabGrub/Kiosk/templates/Kiosk/view_customer_details.html
+22
-0
view_customers.html
GrabGrub/Kiosk/templates/Kiosk/view_customers.html
+32
-0
view_food_details.html
GrabGrub/Kiosk/templates/Kiosk/view_food_details.html
+23
-0
view_foods.html
GrabGrub/Kiosk/templates/Kiosk/view_foods.html
+34
-0
urls.py
GrabGrub/Kiosk/urls.py
+8
-0
views.py
GrabGrub/Kiosk/views.py
+20
-2
No files found.
GrabGrub/Kiosk/templates/Kiosk/base.html
View file @
e1d1efff
...
...
@@ -29,19 +29,34 @@
</nav>
<div
class=
"container-fluid"
>
<div
class=
"col justify-content-center mb-5"
>
<div
class=
"row"
>
<div
class =
"col-2 justify-content-left"
>
<ul
class=
"nav flex-column"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"/home"
>
View Orders
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"/foods"
>
View Food Items
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"/customers"
>
View Customers
</a>
</li>
</ul>
{% block content %}
{% endblock %}
</div>
<div
class=
"col-10 justify-content-center mb-5"
>
{% block content %}
{% endblock %}
</div>
</div>
</div>
</div>
<footer
class=
"footer bg-light"
style=
"position: fixed;"
>
<!-- Copyright -->
<div
class=
"container"
style=
"color: black"
>
©
2020
</div>
<!-- Copyright -->
<div
class=
"container"
style=
"color: black"
>
M7L Final Project
</div>
</footer>
...
...
GrabGrub/Kiosk/templates/Kiosk/home.html
View file @
e1d1efff
{% extends 'Kiosk/base.html' %}
{% load static %}
{% block sidenav %}
<ul
class=
"nav flex-column"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"/view_suppliers"
>
View Suppliers
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"/view_bottles"
>
View Bottles
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"/add_bottle"
>
Add Bottle
</a>
</li>
</ul>
{% endblock %}
{% block content %}
<section
class=
"jumbotron text-center"
>
<div
class=
"container"
>
<h1
class=
"jumbotron-heading"
>
Matthew Dizon
</h1>
<p>
Module 5 Lab - Template
s
</p>
<h1
class=
"jumbotron-heading"
>
Orders
</h1>
<p>
A table of all order
s
</p>
</div>
</section>
<div
class=
"container marketing text-center"
>
<div
class=
"row"
>
<div
class=
"col-lg-4"
>
<h2>
Suppliers
</h2>
<p>
View the details of the suppliers
</p>
<p><a
class=
"btn btn-secondary"
href=
"/view_suppliers"
role=
"button"
>
View details »
</a></p>
</div>
<div
class=
"col-lg-4"
>
<h2>
Bottles
</h2>
<p>
View the details of the bottles
</p>
<p><a
class=
"btn btn-secondary"
href=
"/view_bottles"
role=
"button"
>
View details »
</a></p>
</div>
<div
class=
"col-lg-4"
>
<h2>
Add Bottle
</h2>
<p>
Add bottles to the inventory
</p>
<p><a
class=
"btn btn-secondary"
href=
"/add_bottle"
role=
"button"
>
View details »
</a></p>
</div>
</div>
</div>
<div
class=
"col-12"
>
<table
class=
"table table-striped"
>
<thead>
<th
scope=
"col"
>
Customer
</th>
<th
scope=
"col"
>
Food Ordered
</th>
<th
scope=
"col"
>
Date of Order
</th>
<th
scope=
"col"
></th>
</thead>
<tbody>
{% for order in orders %}
<tr>
<td>
{{ order.cust_order.getName }}
</td>
<td>
{{ order.food.getName }}
</td>
<td>
{{ order.ordered_at }}
</td>
<td><a
href=
"{% url 'view_order_details' order.pk %}"
><button
class=
"btn btn-dark"
>
Details
</button></a></td>
</tr>
{% endfor %}
</tbody>
</table>
<div
class=
"col-12"
>
<table
class=
"table table-striped"
>
<thead>
<th
scope=
"col"
>
Customer
</th>
<th
scope=
"col"
>
Food Ordered
</th>
<th
scope=
"col"
>
Date of Order
</th>
<th
scope=
"col"
></th>
</thead>
<tbody>
{% for order in orders %}
<tr>
<td>
{{ order.cust_order.getName }}
</td>
<td>
{{ order.food.getName }}
</td>
<td>
{{ order.ordered_at }}
</td>
<td><a
href=
"{% url 'view_order_details' order.pk %}"
><button
class=
"btn btn-dark"
>
Details
</button></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/view_customer_details.html
0 → 100644
View file @
e1d1efff
{% extends 'Kiosk/base.html' %}
{% load static %}
{% block content %}
<div
class=
"card w-75"
>
<div
class=
"card-header"
>
Customer Details:
</div>
<ul
class=
"list-group list-group-flush"
>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Food:
</span>
{{customer.name}}
</li>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Quantity:
</span>
{{customer.address}}
</li>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Date of Order:
</span>
{{customer.city}}
</li>
</ul>
</div>
<form
action=
"#"
method=
"post"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"message"
value=
"Bottle deleted successfully"
>
<a
href=
"#"
><button
class=
"btn btn-secondary my-4"
>
Delete Food
</button></a>
</form>
<a
href=
"#"
><button
type=
"submit"
class=
"mt-3 btn btn-primary"
>
Update Food
</button></a>
<a
onclick=
"window.history.go(-1); return false;"
><button
class=
"btn btn-secondary"
>
Back
</button></a>
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/view_customers.html
0 → 100644
View file @
e1d1efff
{% extends 'Kiosk/base.html' %}
{% load static %}
{% block content %}
<section
class=
"jumbotron text-center"
>
<div
class=
"container"
>
<h1
class=
"jumbotron-heading"
>
Customers
</h1>
<p>
A table of all customers
</p>
</div>
</section>
<div
class=
"col-12"
>
<table
class=
"table table-striped"
>
<thead>
<th
scope=
"col"
>
Name
</th>
<th
scope=
"col"
>
Address
</th>
<th
scope=
"col"
>
City
</th>
<th
scope=
"col"
></th>
</thead>
<tbody>
{% for customer in customers %}
<tr>
<td>
{{ customer.name }}
</td>
<td>
{{ customer.address }}
</td>
<td>
{{ customer.city }}
</td>
<td><a
href=
"{% url 'view_customer_details' customer.pk %}"
><button
class=
"btn btn-dark"
>
Details
</button></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/view_food_details.html
0 → 100644
View file @
e1d1efff
{% extends 'Kiosk/base.html' %}
{% load static %}
{% block content %}
<div
class=
"card w-75"
>
<div
class=
"card-header"
>
Food Details:
</div>
<ul
class=
"list-group list-group-flush"
>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Food:
</span>
{{food.name}}
</li>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Quantity:
</span>
{{food.description}}
</li>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Date of Order:
</span>
{{food.price}}
</li>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Customer:
</span>
{{food.created_at}}
</li>
</ul>
</div>
<form
action=
"#"
method=
"post"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"message"
value=
"Bottle deleted successfully"
>
<a
href=
"#"
><button
class=
"btn btn-secondary my-4"
>
Delete Food
</button></a>
</form>
<a
href=
"#"
><button
type=
"submit"
class=
"mt-3 btn btn-primary"
>
Update Food
</button></a>
<a
onclick=
"window.history.go(-1); return false;"
><button
class=
"btn btn-secondary"
>
Back
</button></a>
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/view_foods.html
0 → 100644
View file @
e1d1efff
{% extends 'Kiosk/base.html' %}
{% load static %}
{% block content %}
<section
class=
"jumbotron text-center"
>
<div
class=
"container"
>
<h1
class=
"jumbotron-heading"
>
Food Items
</h1>
<p>
A table of all food items
</p>
</div>
</section>
<div
class=
"col-12"
>
<table
class=
"table table-striped"
>
<thead>
<th
scope=
"col"
>
Name
</th>
<th
scope=
"col"
>
Description
</th>
<th
scope=
"col"
>
Price
</th>
<th
scope=
"col"
>
Date Created
</th>
<th
scope=
"col"
></th>
</thead>
<tbody>
{% for food in foods %}
<tr>
<td>
{{ food.name }}
</td>
<td>
{{ food.description }}
</td>
<td>
{{ food.price }}
</td>
<td>
{{ food.created_at }}
</td>
<td><a
href=
"{% url 'view_food_details' food.pk %}"
><button
class=
"btn btn-dark"
>
Details
</button></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/urls.py
View file @
e1d1efff
...
...
@@ -3,10 +3,18 @@ from . import views
urlpatterns
=
[
# Path for Accounts Model
path
(
''
,
views
.
login_view
,
name
=
'login'
),
path
(
'signup'
,
views
.
signup_view
,
name
=
"signup"
),
path
(
'logout'
,
views
.
logout_view
,
name
=
"logout"
),
# Path for Order Model
path
(
'home'
,
views
.
home
,
name
=
"home"
),
path
(
'view_order_details/<int:pk>'
,
views
.
view_order_details
,
name
=
"view_order_details"
),
path
(
'update_order/<int:pk>'
,
views
.
update_order
,
name
=
"update_order"
),
# Path for Food Model
path
(
'foods'
,
views
.
view_foods
,
name
=
"view_foods"
),
path
(
'view_food_details/<int:pk>'
,
views
.
view_food_details
,
name
=
"view_food_details"
),
# Path for Customer Model
path
(
'customers'
,
views
.
view_customers
,
name
=
"view_customers"
),
path
(
'view_customer_details/<int:pk>'
,
views
.
view_customer_details
,
name
=
"view_customer_details"
),
]
\ No newline at end of file
GrabGrub/Kiosk/views.py
View file @
e1d1efff
...
...
@@ -76,5 +76,23 @@ def update_order(request, pk):
return
render
(
request
,
'Kiosk/update_order.html'
,
context
)
### Views for Food Model
### Views for Customer Model
\ No newline at end of file
def
view_foods
(
request
):
foods
=
Food
.
objects
.
all
()
context
=
{
"foods"
:
foods
}
return
render
(
request
,
'Kiosk/view_foods.html'
,
context
)
def
view_food_details
(
request
,
pk
):
food
=
get_object_or_404
(
Food
,
pk
=
pk
)
context
=
{
"food"
:
food
}
return
render
(
request
,
'Kiosk/view_food_details.html'
,
context
)
### Views for Customer Model
def
view_customers
(
request
):
customers
=
Customer
.
objects
.
all
()
context
=
{
"customers"
:
customers
}
return
render
(
request
,
'Kiosk/view_customers.html'
,
context
)
def
view_customer_details
(
request
,
pk
):
customer
=
get_object_or_404
(
Customer
,
pk
=
pk
)
context
=
{
"customer"
:
customer
}
return
render
(
request
,
'Kiosk/view_customer_details.html'
,
context
)
\ 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