Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Boodle
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
Martina Therese R. Reyes
Boodle
Commits
956452cb
Commit
956452cb
authored
Mar 26, 2022
by
Felizia Tiburcio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display auction bids on auction page
parent
1b83d454
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
101 deletions
+97
-101
auction.html
boodlesite/templates/auction.html
+90
-99
views.py
main/views.py
+7
-2
No files found.
boodlesite/templates/auction.html
View file @
956452cb
...
...
@@ -17,13 +17,19 @@ a{% extends 'boodlesite\templates\base.html' %}
<div
id=
"carouselExampleControls"
class=
"carousel slide"
data-ride=
"carousel"
>
<div
class=
"carousel-inner"
>
<div
class=
"carousel-item active"
>
<img
class=
"d-block w-100"
src=
"https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-Valentines-Heart-Beat-Pom-Pom-Beanie_-Limited-Edition-Dream-VD-ALL-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt=
"First slide"
>
<img
class=
"d-block w-100"
src=
"https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-Valentines-Heart-Beat-Pom-Pom-Beanie_-Limited-Edition-Dream-VD-ALL-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt=
"First slide"
>
</div>
<div
class=
"carousel-item"
>
<img
class=
"d-block w-100"
src=
"https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Black-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt=
"Second slide"
>
<img
class=
"d-block w-100"
src=
"https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Black-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt=
"Second slide"
>
</div>
<div
class=
"carousel-item"
>
<img
class=
"d-block w-100"
src=
"https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Pink-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt=
"Third slide"
>
<img
class=
"d-block w-100"
src=
"https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Pink-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt=
"Third slide"
>
</div>
</div>
<a
class=
"carousel-control-prev"
href=
"#carouselExampleControls"
role=
"button"
data-slide=
"prev"
>
...
...
@@ -50,10 +56,12 @@ a{% extends 'boodlesite\templates\base.html' %}
<p>
{{ item_specs }}
</p>
</div>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#exampleModal"
data-whatever=
"@mdo"
>
Place Bid
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#exampleModal"
data-whatever=
"@mdo"
>
Place Bid
</button>
<h1>
Latest Bids
</h1>
<div
class=
"modal fade"
id=
"exampleModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal fade"
id=
"exampleModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
...
...
@@ -87,38 +95,22 @@ a{% extends 'boodlesite\templates\base.html' %}
</div>
</div>
<h1>
This is the Bid: {{ item_bid }}
</h1>
<!-- latest bids / history -->
<ul
class=
"cards"
>
<li><img
src=
""
alt=
""
>
<p>
Alice offered 500!
</p>
<p>
2 seconds ago
</p>
</li>
{% if auction_bids %}
{% for bid in auction_bids %}
<li><img
src=
""
alt=
""
>
<p>
Bob offered 400!
</p>
<p>
5 seconds ago
</p>
</li>
<li><img
src=
""
alt=
""
>
<p>
Charles offered 300!
</p>
<p>
30 seconds ago
</p>
<p>
Alice offered {{ bid.amount }}
</p>
<p>
{{bid.bidtime | timesince}} ago
</p>
</li>
{% endfor %}
{% else %}
<h3>
no bids placed yet.
</h3>
{% endif %}
<li><img
src=
""
alt=
""
>
<p>
Charles offered 300!
</p>
<p>
3 minutes ago
</p>
</li>
<li><img
src=
""
alt=
""
>
<p>
Charles offered 300!
</p>
<p>
5 mintues ago
</p>
</li>
</ul>
</div>
</div>
...
...
@@ -126,4 +118,3 @@ a{% extends 'boodlesite\templates\base.html' %}
</div>
{% endblock %}
\ No newline at end of file
main/views.py
View file @
956452cb
...
...
@@ -31,14 +31,19 @@ def homepage(request):
def
auction
(
request
,
pk
):
# Current auction ID
auction
=
Auction
.
objects
.
get
(
pk
=
pk
)
auction_bid
=
AuctionBid
.
objects
.
filter
(
auctionid
=
pk
)
auction_bid
s
=
AuctionBid
.
objects
.
filter
(
auctionid
=
pk
)
auction_item
=
auction
.
itemid
print
(
auction_bids
)
print
(
type
(
auction_bids
))
for
bid
in
auction_bids
:
print
(
bid
.
amount
)
context
=
{
'item_name'
:
auction_item
.
itemname
,
'item_specs'
:
auction_item
.
itemspecs
,
'
item_bid'
:
auction_bid
.
amount
,
'
auction_bids'
:
auction_bids
,
'item_floor_price'
:
auction_item
.
floorprice
# need to make floor price object here
}
...
...
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