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
59e047a2
Commit
59e047a2
authored
May 27, 2021
by
Matthew Dizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished functionality of orders
parent
f74cd87b
Pipeline
#1927
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
update_order.html
GrabGrub/Kiosk/templates/Kiosk/update_order.html
+2
-2
view_order_details.html
GrabGrub/Kiosk/templates/Kiosk/view_order_details.html
+4
-7
urls.py
GrabGrub/Kiosk/urls.py
+1
-0
views.py
GrabGrub/Kiosk/views.py
+4
-0
No files found.
GrabGrub/Kiosk/templates/Kiosk/update_order.html
View file @
59e047a2
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
{% load static %}
{% load static %}
{% block content %}
{% block content %}
</div>
<div
class=
"card w-75"
>
<div
class=
"card w-75"
>
<div
class=
"card-header"
>
<div
class=
"card-header"
>
Order Details:
Order Details:
...
@@ -21,7 +20,7 @@
...
@@ -21,7 +20,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"name"
>
Date of Order:
</label>
<label
for=
"name"
>
Date of Order:
</label>
<input
type=
"
date
"
class=
"form-control"
id=
"date"
name=
"date"
value=
"{{order.ordered_at}}"
disabled
>
<input
type=
"
text
"
class=
"form-control"
id=
"date"
name=
"date"
value=
"{{order.ordered_at}}"
disabled
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
@@ -46,4 +45,5 @@
...
@@ -46,4 +45,5 @@
</form>
</form>
</div>
</div>
<a
href=
"{% url 'view_order_details' order.pk %}"
><button
class=
"btn btn-secondary"
>
Back
</button></a>
{% endblock %}
{% endblock %}
GrabGrub/Kiosk/templates/Kiosk/view_order_details.html
View file @
59e047a2
...
@@ -14,11 +14,8 @@
...
@@ -14,11 +14,8 @@
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Mode of Payment:
</span>
{{order.payment_mode}}
</li>
<li
class=
"list-group-item"
><span
style=
"color: #8AB4F8; font-weight:bold"
>
Mode of Payment:
</span>
{{order.payment_mode}}
</li>
</ul>
</ul>
</div>
</div>
<form
action=
"#"
method=
"post"
>
{% csrf_token %}
<a
href=
"{% url 'update_order' order.pk %}"
><button
class=
"btn btn-primary"
>
Update Order
</button></a>
<input
type=
"hidden"
name=
"message"
value=
"Bottle deleted successfully"
>
<a
href=
"{% url 'delete_order' order.pk %}"
><button
class=
"btn btn-danger my-4"
>
Delete Order
</button></a>
<a
href=
"#"
><button
class=
"btn btn-secondary my-4"
>
Delete Order
</button></a>
<a
href=
"{% url 'home' %}"
><button
class=
"btn btn-secondary"
>
Back
</button></a>
</form>
<a
href=
"{% url 'update_order' order.pk %}"
><button
type=
"submit"
class=
"mt-3 btn btn-primary"
>
Update Order
</button></a>
<a
onclick=
"window.history.go(-1); return false;"
><button
class=
"btn btn-secondary"
>
Back
</button></a>
{% endblock %}
{% endblock %}
\ No newline at end of file
GrabGrub/Kiosk/urls.py
View file @
59e047a2
...
@@ -12,6 +12,7 @@ urlpatterns = [
...
@@ -12,6 +12,7 @@ urlpatterns = [
path
(
'view_order_details/<int:pk>'
,
views
.
view_order_details
,
name
=
"view_order_details"
),
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
(
'update_order/<int:pk>'
,
views
.
update_order
,
name
=
"update_order"
),
path
(
'add_order'
,
views
.
add_order
,
name
=
"add_order"
),
path
(
'add_order'
,
views
.
add_order
,
name
=
"add_order"
),
path
(
'delete_order/<int:pk>'
,
views
.
delete_order
,
name
=
"delete_order"
),
# Path for Food Model
# Path for Food Model
path
(
'foods'
,
views
.
view_foods
,
name
=
"view_foods"
),
path
(
'foods'
,
views
.
view_foods
,
name
=
"view_foods"
),
path
(
'view_food_details/<int:pk>'
,
views
.
view_food_details
,
name
=
"view_food_details"
),
path
(
'view_food_details/<int:pk>'
,
views
.
view_food_details
,
name
=
"view_food_details"
),
...
...
GrabGrub/Kiosk/views.py
View file @
59e047a2
...
@@ -107,6 +107,10 @@ def add_order(request):
...
@@ -107,6 +107,10 @@ def add_order(request):
else
:
else
:
return
render
(
request
,
'Kiosk/add_order.html'
,
context
)
return
render
(
request
,
'Kiosk/add_order.html'
,
context
)
def
delete_order
(
request
,
pk
):
Order
.
objects
.
filter
(
pk
=
pk
)
.
delete
()
return
redirect
(
'home'
)
### Views for Food Model
### Views for Food Model
def
view_foods
(
request
):
def
view_foods
(
request
):
foods
=
Food
.
objects
.
all
()
foods
=
Food
.
objects
.
all
()
...
...
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