From 27443bcd21768a1cd6fb515fd8725424847a6673 Mon Sep 17 00:00:00 2001 From: thomas girod Date: Thu, 19 Sep 2024 20:35:08 +0200 Subject: [PATCH 1/2] fix image deletion. again. --- sas/static/sas/js/viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sas/static/sas/js/viewer.js b/sas/static/sas/js/viewer.js index 9120f982..715383bc 100644 --- a/sas/static/sas/js/viewer.js +++ b/sas/static/sas/js/viewer.js @@ -201,7 +201,7 @@ document.addEventListener("alpine:init", () => { }, async delete_picture() { - const res = await fetch(`/api/sas/picture/${this.current_picture.id}/`, { + const res = await fetch(`/api/sas/picture/${this.current_picture.id}`, { method: "DELETE", }); if (!res.ok) { From d3cada4c951c6f0a674ec1cecc5fe246921fa1b1 Mon Sep 17 00:00:00 2001 From: thomas girod Date: Thu, 19 Sep 2024 20:52:10 +0200 Subject: [PATCH 2/2] fix family graph image exension --- core/static/user/js/family_graph.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/static/user/js/family_graph.js b/core/static/user/js/family_graph.js index c3d81126..ab66ea96 100644 --- a/core/static/user/js/family_graph.js +++ b/core/static/user/js/family_graph.js @@ -77,11 +77,11 @@ function create_graph(container, data, active_user_id) { fit: true, klay: { addUnnecessaryBendpoints: true, - direction: 'DOWN', - nodePlacement: 'INTERACTIVE', - layoutHierarchy: true - } - } + direction: "DOWN", + nodePlacement: "INTERACTIVE", + layoutHierarchy: true, + }, + }, }); let active_user = cy .getElementById(active_user_id) @@ -178,7 +178,9 @@ document.addEventListener("alpine:init", () => { typeof depth_min === "undefined" || typeof depth_max === "undefined" ) { - console.error("Some constants are not set before using the family_graph script, please look at the documentation"); + console.error( + "Some constants are not set before using the family_graph script, please look at the documentation", + ); return; } @@ -194,7 +196,7 @@ document.addEventListener("alpine:init", () => { loading: false, godfathers_depth: get_initial_depth("godfathers_depth"), godchildren_depth: get_initial_depth("godchildren_depth"), - reverse: initialUrlParams.get("reverse")?.toLowerCase?.() === 'true', + reverse: initialUrlParams.get("reverse")?.toLowerCase?.() === "true", graph: undefined, graph_data: {}, @@ -227,7 +229,11 @@ document.addEventListener("alpine:init", () => { async screenshot() { const link = document.createElement("a"); link.href = this.graph.jpg(); - link.download = gettext("family_tree.%(extension)s", "jpg"); + link.download = interpolate( + gettext("family_tree.%(extension)s"), + { extension: "jpg" }, + true, + ); document.body.appendChild(link); link.click(); document.body.removeChild(link);