Fix #41 -- Drag-and-drop ticket editor

Undo/redo

Useful toolbox

Font selection

Add text content

Use hex for colors

JS-side dump and load

Save

Load layout, proper undo/redo

First steps to Python rendering

More PDF rendering

Copy and paste

Buttons for keyboard actions

Splash Screen

Block unbeforeunload in dirty state

Remove debugging output

Preview

Upload new PDFs via the editor

Fix bugs during PDF reload, link in settings form

New default ticket

Add OpenSans BI

Custom fonts, fix tests
This commit is contained in:
Raphael Michel
2017-05-05 12:19:16 +02:00
parent c98b0aac90
commit 0d3f5e0c32
27 changed files with 90428 additions and 165 deletions

View File

@@ -1,9 +1,56 @@
from django.dispatch import receiver
from django.dispatch import Signal, receiver
from django.template.loader import get_template
from django.urls import resolve
from pretix.base.signals import register_ticket_outputs
from pretix.control.signals import html_head
@receiver(register_ticket_outputs, dispatch_uid="output_pdf")
def register_ticket_outputs(sender, **kwargs):
from .ticketoutput import PdfTicketOutput
return PdfTicketOutput
@receiver(html_head, dispatch_uid="ticketoutputpdf_html_head")
def html_head_presale(sender, request=None, **kwargs):
url = resolve(request.path_info)
if url.namespace == 'plugins:ticketoutputpdf':
template = get_template('pretixplugins/ticketoutputpdf/control_head.html')
return template.render({
'request': request
})
else:
return ""
register_fonts = Signal()
"""
Return a dictionaries of the following structure. Paths should be relative to static root.
{
"font name": {
"regular": {
"truetype": "….ttf",
"woff": "",
"woff2": ""
},
"bold": {
...
},
"italic": {
...
},
"bolditalic": {
...
}
}
}
"""
def get_fonts():
f = {}
for recv, value in register_fonts.send(0):
f.update(value)
return f