Skip to content
Snippets Groups Projects
Commit f015cd55 authored by Arno Wunderlich's avatar Arno Wunderlich
Browse files

data from db and error fixing in template

parent 7050a217
No related branches found
No related tags found
1 merge request!19data from db and error fixing in template
Pipeline #14211 passed
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Add item</title>
<title>View items</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script>
function bid(){
......@@ -24,24 +24,24 @@
</head>
<body>
<header>
<h2> Overview over items currently on sale </h2>
<br>
</header>
<main>
<div class="list-group container">
<!--for item in items.items-->
{%for item in items %}
<div class="d-flex w-100 justify-content-between mb-4">
<img class=" col-md-2 col-xs-2" src="Gaming_5000x3125.jpg"{{ item.image }} alt="Image" />
<a href="#" class="list-group-item list-group-item-action" aria-current="true">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1"><!--item name-->Item 1</h5>
<small><!--creation date-->3 days ago</small>
<h5 class="mb-1">{{ item.title }}</h5>
<small>{{ item.created_at }}</small>
</div>
<p class="mb-1">Description</p>
<small>Current bid</small>
<div class="row"><button class="col-md-2" onclick="bid()">Bid</button><form method="post" action="#" class="col-md-4"><input id="bid" type="hidden" min="{{starting price}}" /></form></div>
<p class="mb-1">{{ item.description }}</p>
<small>{{ item.starting_bid }}</small>
<div class="row"><button class="col-md-2" onclick="bid()">Bid</button><form method="post" action="#" class="col-md-4"><input id="bid" type="hidden" min="{{ item.starting_bid }}" /></form></div>
</a>
</div>
<!--end for-->
{% endfor %}
</div>
</main>
<footer>
......
......@@ -103,9 +103,19 @@ def adding_successful():
@bp.route("/listBid")
def list_bid():
"""
listBid page.
page that lists all items currently on auction
"""
# for test reasons all items are shown and no selection on only on sale items
items = Item.objects.all()
html = render_template("listBid.html")
html = render_template("listBid.html", items=items)
return html
@bp.route("/bid")
def bid(id):
"""
method that saves bid on object
"""
return "ok"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment