Render wishes
This commit is contained in:
parent
114a83e304
commit
821ad78dd6
|
@ -76,11 +76,11 @@
|
||||||
<p>{{ offer.user.username }} would like some of the following in return:</p>
|
<p>{{ offer.user.username }} would like some of the following in return:</p>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
{% if wishes %}
|
{% if wishes %}
|
||||||
<div class="alert alert-warning" role="alert">There are currently no wishes!</div>
|
|
||||||
{% else %}
|
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
{% for wish in wishes %}<li class="list-group-item">{{ wish.title }}</li>{% endfor %}
|
{% for wish in wishes %}<li class="list-group-item">{{ wish.title }}</li>{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<div class="alert alert-warning" role="alert">There are currently no wishes!</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<a class="btn btn-pfl mb-3" href="{% url 'offer_trade' offer.id %}">Offer trade</a>
|
<a class="btn btn-pfl mb-3" href="{% url 'offer_trade' offer.id %}">Offer trade</a>
|
||||||
|
|
|
@ -38,8 +38,9 @@ def create_offer(request):
|
||||||
@ login_required
|
@ login_required
|
||||||
def offer_detail(request, offer_id):
|
def offer_detail(request, offer_id):
|
||||||
offer = get_object_or_404(Offer, id=offer_id)
|
offer = get_object_or_404(Offer, id=offer_id)
|
||||||
|
wishes = Wish.objects.filter(user=offer.user)
|
||||||
|
|
||||||
return render(request, "offer/detail.html", {"offer": offer, "wishes": ["Monstera", "Tradescantia"]})
|
return render(request, "offer/detail.html", {"offer": offer, "wishes": wishes})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|
Loading…
Reference in a new issue