Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PixieDust-LastMinuteSurpluss
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
Erick Gabriel T. Lopez
PixieDust-LastMinuteSurpluss
Commits
abc8cf0b
Commit
abc8cf0b
authored
Nov 24, 2022
by
Erick Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified Product Views
parent
5b8e999d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
4 deletions
+73
-4
products.html
pixie_dust/products/templates/products/products.html
+54
-1
urls.py
pixie_dust/products/urls.py
+2
-0
views.py
pixie_dust/products/views.py
+15
-1
homepage.html
pixie_dust/users/templates/users/homepage.html
+1
-1
views.py
pixie_dust/users/views.py
+1
-1
No files found.
pixie_dust/products/templates/products/products.html
View file @
abc8cf0b
<h1>
This is the products html
</h1>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
Product Catalog
</title>
</head>
<header>
<h1>
This is the products html
</h1>
</header>
<main>
<div
class=
"collection"
id=
"folder"
>
<h2>
Folders
</h2>
{% for folder in folder_list %}
<div
class=
"card-content-main"
>
<div
class=
"item_name"
>
{{ folder.item_name }}
</div>
<div
class=
"price"
>
₱{{ folder.price }}
</div>
</div>
<ul>
{% for description in description_list %}
{% if folder.item_id == description.item_id%}
<li>
{{ description.feature_id.feature }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</main>
<footer>
<div
class=
"footer-container"
>
<a
href=
"/admin-pd"
>
©Last Minute Surplus
</a>
</div>
</footer>
<body>
</body>
</html>
pixie_dust/products/urls.py
View file @
abc8cf0b
from
django.urls
import
path
from
.
import
views
appname
=
"products"
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
"index"
),
path
(
'/catalog'
,
views
.
catalog
,
name
=
'products'
),
]
\ No newline at end of file
pixie_dust/products/views.py
View file @
abc8cf0b
from
django.shortcuts
import
render
from
.models
import
Product
,
Folder
,
PenOrganizer
,
Planner
,
Description
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
# Create your views here.
def
index
(
request
):
return
render
(
request
,
"products/products.html"
)
\ No newline at end of file
return
render
(
request
,
"products/products.html"
)
def
catalog
(
request
):
product_list
=
Product
.
objects
.
all
()
folder_list
=
Folder
.
objects
.
values
(
'item_name'
,
'price'
,
'item_id'
)
.
distinct
()
pen_organizer_list
=
PenOrganizer
.
objects
.
all
()
planner_list
=
Planner
.
objects
.
all
()
description_list
=
Description
.
objects
.
all
()
return
render
(
request
,
"products/products.html"
,
{
"product_list"
:
product_list
,
"folder_list"
:
folder_list
,
"pen_organizer_list"
:
pen_organizer_list
,
"planner_list"
:
planner_list
,
"description_list"
:
description_list
})
\ No newline at end of file
pixie_dust/users/templates/users/homepage.html
View file @
abc8cf0b
...
...
@@ -26,7 +26,7 @@
</div>
<ul>
{% for description in description_list %}
{% if folder.item_id == description.item_id
.item_id
%}
{% if folder.item_id == description.item_id%}
<li>
{{ description.feature_id.feature }}
</li>
{% endif %}
{% endfor %}
...
...
pixie_dust/users/views.py
View file @
abc8cf0b
...
...
@@ -6,7 +6,7 @@ def index(request):
def
homepage
(
request
):
product_list
=
Product
.
objects
.
all
()
folder_list
=
Folder
.
objects
.
all
()
folder_list
=
Folder
.
objects
.
all
()
.
values
(
'item_name'
,
'price'
)
.
distinct
()
pen_organizer_list
=
PenOrganizer
.
objects
.
all
()
planner_list
=
Planner
.
objects
.
all
()
description_list
=
Description
.
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