You've already forked hotpocket
BTHLABS-81: OG Properties on Share Association page
Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl> Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
@@ -8,6 +8,7 @@ from django.contrib import messages
|
||||
import django.db
|
||||
from django.http import HttpRequest, HttpResponse, JsonResponse
|
||||
from django.shortcuts import redirect, render
|
||||
from django.templatetags.static import static
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.generic import FormView, View
|
||||
@@ -198,12 +199,18 @@ def view(request: HttpRequest, pk: uuid.UUID) -> HttpResponse:
|
||||
if is_share is True:
|
||||
show_controls = show_controls and False
|
||||
|
||||
share_url = reverse(
|
||||
'ui.associations.view',
|
||||
args=(association.pk,),
|
||||
query=[
|
||||
('share', 'true'),
|
||||
],
|
||||
share_url = request.build_absolute_uri(
|
||||
reverse(
|
||||
'ui.associations.view',
|
||||
args=(association.pk,),
|
||||
query=[
|
||||
('share', 'true'),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
og_card_url = request.build_absolute_uri(
|
||||
static('ui/img/og-card.png'),
|
||||
)
|
||||
|
||||
return render(
|
||||
@@ -213,6 +220,12 @@ def view(request: HttpRequest, pk: uuid.UUID) -> HttpResponse:
|
||||
'association': association,
|
||||
'show_controls': show_controls,
|
||||
'share_url': share_url,
|
||||
'is_share': is_share,
|
||||
'og_card_url': (
|
||||
og_card_url
|
||||
if is_share is True
|
||||
else None
|
||||
),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user