mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
Use real images with lazy loading in sas albums and user pictures
This commit is contained in:
1 parent
e8db68b960
commit
f7ff77b88f
6 files changed
+51
-30
No files matched your search
@@ -39,6 +39,8 @@ class PictureSchema(ModelSchema):
|
||||
compressed_url: str
|
||||
thumb_url: str
|
||||
album: str
|
||||
report_url: str
|
||||
edit_url: str
|
||||
|
||||
@staticmethod
|
||||
def resolve_sas_url(obj: Picture) -> str:
|
||||
@@ -56,6 +58,14 @@ class PictureSchema(ModelSchema):
|
||||
def resolve_thumb_url(obj: Picture) -> str:
|
||||
return obj.get_download_thumb_url()
|
||||
|
||||
@staticmethod
|
||||
def resolve_report_url(obj: Picture) -> str:
|
||||
return reverse("sas:picture_ask_removal", kwargs={"picture_id": obj.id})
|
||||
|
||||
@staticmethod
|
||||
def resolve_edit_url(obj: Picture) -> str:
|
||||
return reverse("sas:picture_edit", kwargs={"picture_id": obj.id})
|
||||
|
||||
|
||||
class PictureRelationCreationSchema(Schema):
|
||||
picture: NonNegativeInt
|
||||
|
||||
Reference in new issue
Block a user