Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // From views.py
- def item_details(request, item_id):
- auction = SilentAuction.objects.first()
- context = {isAuctionActive: auction.auction_active}
- return render(request, 'item_details.html', context)
- // From item_details.html
- <div id="form">
- <h3>
- Make a Bid
- </h3>
- {% if error_message %}
- <p><strong>{{ error_message }}</strong></p>
- {% endif %}
- {% if !isAuctionActive %}
- <p> Auction aint live yet bruh </p>
- {% endif %}
- <form action="{% url 'auction:add_bid' blog.pk %}" method="post">
- {% csrf_token %}
- <label>Name:
- <input type="number" name="bid" id="bid"><br>
- </label><br>
- // Disable the button when the auction is not active so people can't make bids
- <input type="submit" value="Submit" style="margin-top: 20px;" disabled="{% !isAuctionActive %}">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement