mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-01 03:48:04 +00:00
Remove hand crafted urls on viewer-index.ts
This commit is contained in:
parent
b6e1c3bc88
commit
00cf619c68
@ -1,5 +1,6 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
from django.urls import reverse
|
||||||
from ninja import FilterSchema, ModelSchema, Schema
|
from ninja import FilterSchema, ModelSchema, Schema
|
||||||
from pydantic import Field, NonNegativeInt
|
from pydantic import Field, NonNegativeInt
|
||||||
|
|
||||||
@ -20,11 +21,16 @@ class PictureSchema(ModelSchema):
|
|||||||
fields = ["id", "name", "date", "size", "is_moderated", "asked_for_removal"]
|
fields = ["id", "name", "date", "size", "is_moderated", "asked_for_removal"]
|
||||||
|
|
||||||
owner: UserProfileSchema
|
owner: UserProfileSchema
|
||||||
|
sas_url: str
|
||||||
full_size_url: str
|
full_size_url: str
|
||||||
compressed_url: str
|
compressed_url: str
|
||||||
thumb_url: str
|
thumb_url: str
|
||||||
album: str
|
album: str
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def resolve_sas_url(obj: Picture) -> str:
|
||||||
|
return reverse("sas:picture", kwargs={"picture_id": obj.id})
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def resolve_full_size_url(obj: Picture) -> str:
|
def resolve_full_size_url(obj: Picture) -> str:
|
||||||
return obj.get_download_url()
|
return obj.get_download_url()
|
||||||
|
@ -217,7 +217,7 @@ exportToHtml("loadViewer", (config: ViewerConfig) => {
|
|||||||
const updateArgs = {
|
const updateArgs = {
|
||||||
data: { sasPictureId: this.currentPicture.id },
|
data: { sasPictureId: this.currentPicture.id },
|
||||||
unused: "",
|
unused: "",
|
||||||
url: `/sas/picture/${this.currentPicture.id}/`,
|
url: this.currentPicture.sas_url,
|
||||||
};
|
};
|
||||||
if (this.pushstate === History.Replace) {
|
if (this.pushstate === History.Replace) {
|
||||||
window.history.replaceState(
|
window.history.replaceState(
|
||||||
|
Loading…
Reference in New Issue
Block a user