Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thegoodplace
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
Kirby Ezekiel Santos
thegoodplace
Commits
4216c3a6
Commit
4216c3a6
authored
Mar 18, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the ingredients detail page which contains no data yet
parent
b7faf601
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
4 deletions
+39
-4
urls.py
froyo/urls.py
+3
-1
views.py
froyo/views.py
+4
-0
ingredients_detail.html
templates/ingredients_detail.html
+29
-0
ingredients_list.html
templates/ingredients_list.html
+3
-3
No files found.
froyo/urls.py
View file @
4216c3a6
...
@@ -2,8 +2,10 @@ from django.urls import path
...
@@ -2,8 +2,10 @@ from django.urls import path
from
.views
import
HomePageView
from
.views
import
HomePageView
from
.views
import
IngredientsListView
from
.views
import
IngredientsListView
from
.views
import
IngredientsDetailView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
HomePageView
.
as_view
()),
path
(
''
,
HomePageView
.
as_view
()),
path
(
'ingredients-list'
,
IngredientsListView
.
as_view
())
path
(
'ingredients-list'
,
IngredientsListView
.
as_view
()),
path
(
'ingredients-detail'
,
IngredientsDetailView
.
as_view
())
]
]
froyo/views.py
View file @
4216c3a6
...
@@ -9,6 +9,7 @@ class HomePageView(TemplateView):
...
@@ -9,6 +9,7 @@ class HomePageView(TemplateView):
class
IngredientsListView
(
ListView
):
class
IngredientsListView
(
ListView
):
template_name
=
"ingredients_list.html"
template_name
=
"ingredients_list.html"
Ingredient
.
objects
.
all
()
.
delete
()
emptyIngredient
=
Ingredient
(
emptyIngredient
=
Ingredient
(
name
=
""
,
name
=
""
,
quantity
=
""
quantity
=
""
...
@@ -19,3 +20,6 @@ class IngredientsListView(ListView):
...
@@ -19,3 +20,6 @@ class IngredientsListView(ListView):
context
=
{
context
=
{
"object_list"
:
queryset
"object_list"
:
queryset
}
}
class
IngredientsDetailView
(
TemplateView
):
template_name
=
"ingredients_detail.html"
templates/ingredients_detail.html
0 → 100644
View file @
4216c3a6
<!DOCTYPE html>
<html>
<head>
<title>
Ingredients - Detail
</title>
</head>
<body>
<div>
<h1
id=
"page_header"
>
Ingredients - Detail
</h1>
</div>
<div>
<table
class=
"table"
>
<thead>
<tr>
<th>
Ingredient
</th>
<th>
Qty On Hand
</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
templates/ingredients_list.html
View file @
4216c3a6
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<table
class=
"table"
>
<table
class=
"table"
>
<thead>
<thead>
<tr>
<tr>
<th>
In
gredient
</th>
<th>
In
ventory
</th>
<th></th>
<th></th>
</tr>
</tr>
</thead>
</thead>
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
<tr>
<tr>
<td>
{{object.name}}
</td>
<td>
{{object.name}}
</td>
<td>
<td>
<form>
<form
method=
"get"
action=
"http://localhost:8000/ingredients-detail"
>
<button
type=
"submit"
>
Go to detail
</button>
<button
type=
"submit"
id=
"button_to_ingredients_detail"
>
Go to detail
</button>
</form>
</form>
</td>
</td>
</tr>
</tr>
...
...
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