Merge pull request 'Add opengraph' (#30) from dev into main
Reviewed-on: #30
This commit is contained in:
commit
b2ffde33e4
2 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,11 @@
|
|||
<meta name="description"
|
||||
content="{{ offer.user.username }} offers {{ offer.title }}!">
|
||||
<meta name="author" content="{{ offer.user.username }}">
|
||||
<meta property="og:title" content="{{ offer.title }}">
|
||||
<meta property="og:description"
|
||||
content="{{ offer.user.username }} offers {{ offer.title }}!">
|
||||
<meta property="og:url" content="{{ host }}/offer/{{ offer.id }}">
|
||||
<meta property="og:image" content="{{ host }}{{ offer.image.url }}">
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% if offer.user == request.user %}
|
||||
|
|
|
@ -53,6 +53,7 @@ def create_offer(request):
|
|||
def offer_detail(request, offer_id):
|
||||
offer = get_object_or_404(Offer, id=offer_id)
|
||||
wishes = Wish.objects.filter(user=offer.user)
|
||||
host = f"{request.scheme}://{request.META.get('HTTP_HOST')}"
|
||||
|
||||
if request.user.is_authenticated:
|
||||
if offer.zipcode and request.user.zipcode:
|
||||
|
@ -68,7 +69,7 @@ def offer_detail(request, offer_id):
|
|||
else:
|
||||
dist = None
|
||||
|
||||
return render(request, "offer/detail.html", {"offer": offer, "wishes": wishes, "dist": dist})
|
||||
return render(request, "offer/detail.html", {"host": host, "offer": offer, "wishes": wishes, "dist": dist})
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
Loading…
Reference in a new issue