.
This commit is contained in:
@@ -132,3 +132,12 @@ def background_delete(request, pk):
|
||||
if is_htmx(request):
|
||||
return HttpResponse(status=204)
|
||||
return redirect('cards:backgrounds')
|
||||
|
||||
|
||||
def preview_card(request, pk):
|
||||
"""Render a full preview of a card. HTMX loads the modal fragment into #modal-root."""
|
||||
card = get_object_or_404(Dinosaur, pk=pk)
|
||||
background = BackgroundImage.get_active() if BackgroundImage.objects.exists() else None
|
||||
if is_htmx(request):
|
||||
return render(request, 'cards/_card_preview.html', {'card': card, 'background': background})
|
||||
return render(request, 'cards/preview.html', {'card': card, 'background': background})
|
||||
|
||||
Reference in New Issue
Block a user