This commit is contained in:
Ross
2025-12-04 22:49:16 +00:00
parent 23f7caa937
commit be1fea5fd4
16 changed files with 240 additions and 52 deletions
+9
View File
@@ -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})