Reorganize UI for exporters (#3025)

Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
Raphael Michel
2023-01-11 12:34:56 +01:00
committed by GitHub
co-authored by Richard Schreiber
parent cb4af51c01
commit 0ae66ab7f6
22 changed files with 275 additions and 121 deletions
+4 -1
View File
@@ -49,7 +49,7 @@ from django.db import DataError, models
from django.db.models import Exists, OuterRef, Q, Subquery
from django.db.models.functions import Cast, Coalesce
from django.utils.timezone import make_aware
from django.utils.translation import gettext as _, gettext_lazy
from django.utils.translation import gettext as _, gettext_lazy, pgettext_lazy
from PyPDF2 import PdfMerger, PdfReader, PdfWriter, Transformation
from PyPDF2.generic import RectangleObject
from reportlab.lib import pagesizes
@@ -246,6 +246,9 @@ def render_pdf(event, positions, opt):
class BadgeExporter(BaseExporter):
identifier = "badges"
verbose_name = _("Attendee badges")
category = pgettext_lazy('export_category', 'PDF collections')
description = gettext_lazy('Download all attendee badges as one large PDF for printing.')
featured = True
@property
def export_form_fields(self):
+12 -1
View File
@@ -45,7 +45,9 @@ from django.db.models.functions import Coalesce, NullIf
from django.urls import reverse
from django.utils.formats import date_format
from django.utils.timezone import is_aware, make_aware
from django.utils.translation import gettext as _, gettext_lazy, pgettext
from django.utils.translation import (
gettext as _, gettext_lazy, pgettext, pgettext_lazy,
)
from pytz import UTC
from reportlab.lib.units import mm
from reportlab.platypus import Flowable, Paragraph, Spacer, Table, TableStyle
@@ -263,6 +265,9 @@ class PDFCheckinList(ReportlabExportMixin, CheckInListMixin, BaseExporter):
name = "overview"
identifier = 'checkinlistpdf'
verbose_name = gettext_lazy('Check-in list (PDF)')
category = pgettext_lazy('export_category', 'Check-in')
description = gettext_lazy("Download a PDF version of a check-in list that can be used to check people in at the "
"event without digital methods.")
@property
def export_form_fields(self):
@@ -420,6 +425,9 @@ class CSVCheckinList(CheckInListMixin, ListExporter):
name = "overview"
identifier = 'checkinlist'
verbose_name = gettext_lazy('Check-in list')
category = pgettext_lazy('export_category', 'Check-in')
description = gettext_lazy("Download a spreadsheet with all attendees that are included in a check-in list.")
featured = True
@property
def additional_form_fields(self):
@@ -601,6 +609,9 @@ class CheckinLogList(ListExporter):
name = "checkinlog"
identifier = 'checkinlog'
verbose_name = gettext_lazy('Check-in log (all scans)')
category = pgettext_lazy('export_category', 'Check-in')
description = gettext_lazy("Download a spreadsheet with one line for every scan that happened at your check-in "
"stations.")
@property
def additional_form_fields(self):
+12 -3
View File
@@ -48,7 +48,9 @@ from django.db.models import DateTimeField, Max, OuterRef, Subquery, Sum
from django.template.defaultfilters import floatformat
from django.utils.formats import date_format, localize
from django.utils.timezone import get_current_timezone, make_aware, now
from django.utils.translation import gettext as _, gettext_lazy, pgettext
from django.utils.translation import (
gettext as _, gettext_lazy, pgettext, pgettext_lazy,
)
from django_countries.fields import Country
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTER
@@ -197,6 +199,9 @@ class OverviewReport(Report):
name = "overview"
identifier = 'pdfreport'
verbose_name = gettext_lazy('Order overview (PDF)')
category = pgettext_lazy('export_category', 'Analysis')
description = gettext_lazy('Download a PDF version of the key sales numbers per ticket type.')
featured = True
@property
def pagesize(self):
@@ -382,7 +387,9 @@ class OverviewReport(Report):
class OrderTaxListReportPDF(Report):
name = "ordertaxlist"
identifier = 'ordertaxes'
verbose_name = gettext_lazy('List of orders with taxes (PDF)')
verbose_name = gettext_lazy('Tax split list (PDF)')
category = pgettext_lazy('export_category', 'Order data')
description = gettext_lazy("Download a PDF list with the tax amounts included in each order.")
@property
def export_form_fields(self):
@@ -553,7 +560,9 @@ class OrderTaxListReportPDF(Report):
class OrderTaxListReport(MultiSheetListExporter):
identifier = 'ordertaxeslist'
verbose_name = gettext_lazy('List of orders with taxes')
verbose_name = gettext_lazy('Tax split list')
category = pgettext_lazy('export_category', 'Order data')
description = gettext_lazy("Download a spreadsheet with the tax amounts included in each order.")
@property
def sheets(self):
@@ -44,7 +44,7 @@ from django.db import DataError, models
from django.db.models import OuterRef, Q, Subquery
from django.db.models.functions import Cast, Coalesce
from django.utils.timezone import make_aware
from django.utils.translation import gettext as _, gettext_lazy
from django.utils.translation import gettext as _, gettext_lazy, pgettext_lazy
from PyPDF2 import PdfMerger
from pretix.base.exporter import BaseExporter
@@ -63,7 +63,9 @@ logger = logging.getLogger(__name__)
class AllTicketsPDF(BaseExporter):
name = "alltickets"
verbose_name = gettext_lazy("All PDF tickets in one file")
verbose_name = gettext_lazy("Tickets")
category = pgettext_lazy('export_category', 'PDF collections')
description = gettext_lazy("Download PDF versions of all tickets in your event as one large PDF file.")
identifier = "pdfoutput_all_tickets"
@property