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
14a9f03b
Commit
14a9f03b
authored
Jun 03, 2021
by
Matthew Dizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final changes
parent
eb870834
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
134 additions
and
46 deletions
+134
-46
0003_auto_20210603_0926.py
GrabGrub/Kiosk/migrations/0003_auto_20210603_0926.py
+24
-0
models.py
GrabGrub/Kiosk/models.py
+3
-2
custom.css
GrabGrub/Kiosk/static/bootstrap/css/custom.css
+5
-1
add_food.html
GrabGrub/Kiosk/templates/Kiosk/add_food.html
+1
-1
add_order.html
GrabGrub/Kiosk/templates/Kiosk/add_order.html
+1
-1
base.html
GrabGrub/Kiosk/templates/Kiosk/base.html
+7
-3
home.html
GrabGrub/Kiosk/templates/Kiosk/home.html
+51
-32
update_food.html
GrabGrub/Kiosk/templates/Kiosk/update_food.html
+1
-1
update_order.html
GrabGrub/Kiosk/templates/Kiosk/update_order.html
+1
-1
view_customers.html
GrabGrub/Kiosk/templates/Kiosk/view_customers.html
+20
-2
view_foods.html
GrabGrub/Kiosk/templates/Kiosk/view_foods.html
+20
-2
No files found.
GrabGrub/Kiosk/migrations/0003_auto_20210603_0926.py
0 → 100644
View file @
14a9f03b
# Generated by Django 3.0.5 on 2021-06-03 01:26
import
django.core.validators
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'Kiosk'
,
'0002_auto_20210527_1147'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'food'
,
name
=
'price'
,
field
=
models
.
FloatField
(
max_length
=
250
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
1
)]),
),
migrations
.
AlterField
(
model_name
=
'order'
,
name
=
'qty'
,
field
=
models
.
FloatField
(
max_length
=
250
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
1
)]),
),
]
GrabGrub/Kiosk/models.py
View file @
14a9f03b
from
django.db
import
models
from
django.core.validators
import
MinValueValidator
# Create your models here.
class
Account
(
models
.
Model
):
...
...
@@ -17,7 +18,7 @@ class Account(models.Model):
class
Food
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
250
,
unique
=
True
)
description
=
models
.
CharField
(
max_length
=
250
)
price
=
models
.
FloatField
(
max_length
=
250
)
price
=
models
.
FloatField
(
max_length
=
250
,
validators
=
[
MinValueValidator
(
1
)]
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
def
getName
(
self
):
...
...
@@ -59,7 +60,7 @@ class Order(models.Model):
]
food
=
models
.
ForeignKey
(
Food
,
on_delete
=
models
.
CASCADE
)
qty
=
models
.
FloatField
(
max_length
=
250
)
qty
=
models
.
FloatField
(
max_length
=
250
,
validators
=
[
MinValueValidator
(
1
)]
)
ordered_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
cust_order
=
models
.
ForeignKey
(
Customer
,
on_delete
=
models
.
CASCADE
)
payment_mode
=
models
.
CharField
(
max_length
=
4
,
choices
=
PAYMENT_MODE_CHOICES
,
default
=
CASH
)
...
...
GrabGrub/Kiosk/static/bootstrap/css/custom.css
View file @
14a9f03b
...
...
@@ -106,7 +106,7 @@ label {
.table-striped
>
thead
{
text-align
:
center
;
background-color
:
#
7D68D9
;
background-color
:
#
A894FF
;
}
.list-group-item
>
span
{
...
...
@@ -120,4 +120,8 @@ label {
.card
{
background-color
:
#9e89fa
;
}
.dataTables_wrapper
>
.dataTables_info
{
color
:
white
!important
;
}
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/add_food.html
View file @
14a9f03b
...
...
@@ -23,7 +23,7 @@
<div
class=
"d-flex flex-row"
>
<div
class=
"form-group w-50"
>
<label
for=
"name"
>
Price (₱):
</label>
<input
type=
"number"
class=
"form-control"
id=
"price"
name=
"price"
required
>
<input
type=
"number"
min=
"1"
class=
"form-control"
id=
"price"
name=
"price"
required
>
</div>
<div
class=
"form-group w-50 mx-4"
>
...
...
GrabGrub/Kiosk/templates/Kiosk/add_order.html
View file @
14a9f03b
...
...
@@ -19,7 +19,7 @@
<div
class=
"form-group w-50 mx-4"
>
<label
for=
"name"
>
Quantity:
</label>
<input
type=
"number"
class=
"form-control"
id=
"qty"
name=
"qty"
required
>
<input
type=
"number"
min=
"1"
class=
"form-control"
id=
"qty"
name=
"qty"
required
>
</div>
</div>
...
...
GrabGrub/Kiosk/templates/Kiosk/base.html
View file @
14a9f03b
...
...
@@ -6,6 +6,7 @@
<link
rel=
"stylesheet"
href=
"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons"
>
<link
rel=
"stylesheet"
href=
"{% static '/bootstrap/css/bootstrap.css' %}"
>
<link
rel=
"stylesheet"
href=
"{% static '/bootstrap/css/custom.css' %}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdn.datatables.net/1.10.24/css/jquery.dataTables.css"
>
<script
src=
"{% static '/bootstrap/jquery-3.4.1.slim.min.js' %}"
></script>
<script
src=
"{% static '/bootstrap/popper.min.js' %}"
></script>
...
...
@@ -15,7 +16,7 @@
<body>
<nav
class=
"navbar navbar-expand-lg navbar-light sticky-top"
>
<a
class=
"navbar-brand mb-0"
href=
"
/
"
><span
style=
"color: #9179FA;"
>
GrabGrub
</span></a>
<a
class=
"navbar-brand mb-0"
href=
"
#
"
><span
style=
"color: #9179FA;"
>
GrabGrub
</span></a>
<ul
class=
"navbar-nav ml-auto"
>
<li
class=
"nav-item mx-2"
>
Miguel Bandelaria | 190518
...
...
@@ -29,10 +30,10 @@
</ul>
</nav>
<div
class=
"container-fluid pt-3"
style=
"background-color: #23272B; height: 100%;"
>
<div
class=
"container-fluid pt-3"
style=
"background-color: #23272B;
min-
height: 100%;"
>
<div
class=
"row"
>
{% if request.path != "/" and request.path != "/signup" %}
<div
class =
"col-2 justify-content-left"
>
<div
class =
"col-2 justify-content-left
position-sticky
"
>
<ul
class=
"nav flex-column"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link {% if request.path == '/home' %} active {% endif %}"
href=
"/home"
>
View Orders
</a>
...
...
@@ -65,5 +66,8 @@
</footer>
{% block js %}
{% endblock js %}
</body>
</html>
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/home.html
View file @
14a9f03b
{% extends 'Kiosk/base.html' %}
{% load static %}
{% block content %}
<section
class=
"jumbotron text-center"
>
<div
class=
"container"
>
<h1
class=
"jumbotron-heading"
>
Orders
</h1>
<p>
A table of all orders
</p>
<a
href=
"{% url 'add_order' %}"
><button
class=
"btn btn-dark-grabgrub"
>
Add Order
</button></a>
</div>
</section>
{% block content %}
<section
class=
"jumbotron text-center"
>
<div
class=
"container"
>
<h1
class=
"jumbotron-heading"
>
Orders
</h1>
<p>
A table of all orders
</p>
<a
href=
"{% url 'add_order' %}"
><button
class=
"btn btn-dark-grabgrub"
>
Add Order
</button></a>
</div>
</section>
{% if message %}
<p
class=
"mt-3 alert alert-success"
>
{{message}}
</p>
{% endif %}
{% if message %}
<p
class=
"mt-3 alert alert-success"
>
{{message}}
</p>
{% endif %}
<div
class=
"col-12"
>
<table
class=
"table table-striped"
>
<thead>
<th
scope=
"col"
>
Customer Name
</th>
<th
scope=
"col"
>
Food Ordered
</th>
<th
scope=
"col"
>
Date Ordered
</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-grabgrub"
>
Details
</button></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
\ No newline at end of file
<div
class=
"col-12"
>
<table
class=
"table table-striped"
id=
"order_table"
>
<thead>
<th
scope=
"col"
>
Customer Name
</th>
<th
scope=
"col"
>
Food Ordered
</th>
<th
scope=
"col"
>
Date Ordered
</th>
<th
scope=
"col"
class=
"no-sort"
></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-grabgrub"
>
Details
</button></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% block js %}
<script
type=
"text/javascript"
charset=
"utf8"
src=
"https://cdn.datatables.net/1.10.24/js/jquery.dataTables.js"
></script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'#order_table'
).
DataTable
({
"order"
:
[],
"columnDefs"
:
[
{
"targets"
:
'no-sort'
,
"orderable"
:
false
,
}],
language
:
{
searchPlaceholder
:
"Search Order"
},
"bPaginate"
:
false
});
}
);
</script>
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/update_food.html
View file @
14a9f03b
...
...
@@ -21,7 +21,7 @@
<div
class=
"d-flex flex-row"
>
<div
class=
"form-group w-50"
>
<label
for=
"name"
>
Price (₱):
</label>
<input
type=
"number"
class=
"form-control"
id=
"price"
name=
"price"
value=
"{{food.price}}"
required
>
<input
type=
"number"
min=
"1"
class=
"form-control"
id=
"price"
name=
"price"
value=
"{{food.price}}"
required
>
</div>
<div
class=
"form-group w-50 mx-4"
>
<label
for=
"name"
>
Date Created:
</label>
...
...
GrabGrub/Kiosk/templates/Kiosk/update_order.html
View file @
14a9f03b
...
...
@@ -15,7 +15,7 @@
<div
class=
"form-group w-50 mx-4"
>
<label
for=
"name"
>
Quantity:
</label>
<input
type=
"number"
class=
"form-control"
id=
"qty"
name=
"qty"
value=
"{{order.qty}}"
required
>
<input
type=
"number"
min=
"1"
class=
"form-control"
id=
"qty"
name=
"qty"
value=
"{{order.qty}}"
required
>
</div>
</div>
...
...
GrabGrub/Kiosk/templates/Kiosk/view_customers.html
View file @
14a9f03b
...
...
@@ -14,12 +14,12 @@
{% endif %}
<div
class=
"col-12"
>
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
id=
"customer_table"
>
<thead>
<th
scope=
"col"
>
Customer Name
</th>
<th
scope=
"col"
>
Address
</th>
<th
scope=
"col"
>
City
</th>
<th
scope=
"col"
></th>
<th
scope=
"col"
class=
"no-sort"
></th>
</thead>
<tbody>
{% for customer in customers %}
...
...
@@ -33,4 +33,22 @@
</tbody>
</table>
</div>
{% endblock %}
{% block js %}
<script
type=
"text/javascript"
charset=
"utf8"
src=
"https://cdn.datatables.net/1.10.24/js/jquery.dataTables.js"
></script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'#customer_table'
).
DataTable
({
"order"
:
[],
"columnDefs"
:
[
{
"targets"
:
'no-sort'
,
"orderable"
:
false
,
}],
language
:
{
searchPlaceholder
:
"Search Customer"
},
"bPaginate"
:
false
});
}
);
</script>
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/templates/Kiosk/view_foods.html
View file @
14a9f03b
...
...
@@ -15,13 +15,13 @@
{% endif %}
<div
class=
"col-12"
>
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
id=
"food_table"
>
<thead>
<th
scope=
"col"
>
Food Name
</th>
<th
scope=
"col"
>
Description
</th>
<th
scope=
"col"
>
Price (₱)
</th>
<th
scope=
"col"
>
Date Created
</th>
<th
scope=
"col"
></th>
<th
scope=
"col"
class=
"no-sort"
></th>
</thead>
<tbody>
{% for food in foods %}
...
...
@@ -36,4 +36,22 @@
</tbody>
</table>
</div>
{% endblock %}
{% block js %}
<script
type=
"text/javascript"
charset=
"utf8"
src=
"https://cdn.datatables.net/1.10.24/js/jquery.dataTables.js"
></script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'#food_table'
).
DataTable
({
"order"
:
[],
"columnDefs"
:
[
{
"targets"
:
'no-sort'
,
"orderable"
:
false
,
}],
language
:
{
searchPlaceholder
:
"Search Food"
},
"bPaginate"
:
false
});
}
);
</script>
{% 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