-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
27 changed files
with
90,428 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
41 changes: 41 additions & 0 deletions
41
src/pretix/plugins/ticketoutputpdf/static/pretixplugins/ticketoutputpdf/editor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#fabric-container { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} | ||
#editor-canvas-area { | ||
position: relative; | ||
min-height: 500px; | ||
} | ||
body { | ||
overflow-y: scroll; | ||
} | ||
#toolbox .control-group { | ||
margin-bottom: 5px; | ||
} | ||
#toolbox .position, #toolbox .squaresize, #toolbox[data-type] .pdf-info, #toolbox .text, #toolbox .object-buttons { | ||
display: none; | ||
} | ||
#toolbox[data-type] .position, #toolbox[data-type=barcodearea] .squaresize, #toolbox[data-type=text] .text, #toolbox[data-type=textarea] .text, | ||
#toolbox[data-type] .object-buttons { | ||
display: block; | ||
} | ||
#loading-container { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
background: white; | ||
width: 100%; | ||
text-align: center; | ||
} | ||
#loading-container > div { | ||
max-width: 600px; | ||
margin: auto; | ||
} | ||
#loading-upload { | ||
display: none; | ||
} | ||
.preload-font { | ||
visibility: hidden; | ||
} |
Oops, something went wrong.