From 9447e5802d527c17e8a9174439b6c7d7dda6d92a Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Mon, 31 Mar 2025 12:11:49 +0200 Subject: [PATCH] PDF-Editor: improve UI for page-size and background PDF (#4959) * PDF-Editor: improve UI for page-size and background PDF * Update src/pretix/control/templates/pretixcontrol/pdf/index.html Co-authored-by: leiascyr <156191181+leiascyr@users.noreply.github.com> * Update src/pretix/control/templates/pretixcontrol/pdf/index.html Co-authored-by: leiascyr <156191181+leiascyr@users.noreply.github.com> * Update label text Co-authored-by: Raphael Michel --------- Co-authored-by: Raphael Michel Co-authored-by: leiascyr <156191181+leiascyr@users.noreply.github.com> --- .../templates/pretixcontrol/pdf/index.html | 83 +++++++++++-------- .../static/pretixcontrol/js/ui/editor.js | 1 - 2 files changed, 48 insertions(+), 36 deletions(-) diff --git a/src/pretix/control/templates/pretixcontrol/pdf/index.html b/src/pretix/control/templates/pretixcontrol/pdf/index.html index 1424ca3ff..413bb2807 100644 --- a/src/pretix/control/templates/pretixcontrol/pdf/index.html +++ b/src/pretix/control/templates/pretixcontrol/pdf/index.html @@ -182,8 +182,54 @@ {% endif %} +
+
+
+ +
+
+

+
+ +

+ {% blocktrans trimmed %} + You can upload a PDF to use as a custom background. + The paper size will match the PDF. + {% endblocktrans %} +

+

+ + + {% trans "Upload PDF as background" %} + + +

+

+ + + {% trans "Download current background" %} + +

+
+
+
+
+ +

+ {% blocktrans trimmed %} + To manually change the paper size, you need to create a new, empty background. + {% endblocktrans %} +

+
+
+

@@ -195,45 +241,12 @@
-

-

- - - {% trans "Upload custom background" %} - - -
-
-

- {% blocktrans trimmed %} - After you changed the page size, you need to create a new empty background. If you - want to use a custom background, it already needs to have the correct size. - {% endblocktrans %} -

-
- -
-
-
-
-
-
diff --git a/src/pretix/static/pretixcontrol/js/ui/editor.js b/src/pretix/static/pretixcontrol/js/ui/editor.js index 5df1b3dda..fa9914b5b 100644 --- a/src/pretix/static/pretixcontrol/js/ui/editor.js +++ b/src/pretix/static/pretixcontrol/js/ui/editor.js @@ -922,7 +922,6 @@ var editor = { $("#toolbox-heading").text(gettext("Ticket design")); $("#pdf-info-width").val(editor._px2mm(editor.pdf_viewport.width).toFixed(2)); $("#pdf-info-height").val(editor._px2mm(editor.pdf_viewport.height).toFixed(2)); - editor._paper_size_warning(); } editor._update_toolbox_values(); },