feat: rotate pictures with API+AlpineJS

This commit is contained in:
imperosol
2026-05-01 18:54:13 +02:00
parent 441a016025
commit 399a3813f0
6 changed files with 144 additions and 46 deletions
-8
View File
@@ -97,14 +97,6 @@ class PictureView(CanViewMixin, DetailView):
pk_url_kwarg = "picture_id"
template_name = "sas/picture.jinja"
def get(self, request, *args, **kwargs):
self.object = self.get_object()
if "rotate_right" in request.GET:
self.object.rotate(270)
if "rotate_left" in request.GET:
self.object.rotate(90)
return super().get(request, *args, **kwargs)
def get_context_data(self, **kwargs):
return super().get_context_data(**kwargs) | {
"album": Album.objects.get(children=self.object)