mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Writable API for ticket layouts (#3004)
Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
371
src/pretix/static/schema/pdf-layout.schema.json
Normal file
371
src/pretix/static/schema/pdf-layout.schema.json
Normal file
@@ -0,0 +1,371 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Ticket Layout",
|
||||
"description": "Dynamic elements for a PDF layout",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"description": "Layout object",
|
||||
"oneOf": [
|
||||
{
|
||||
"required": [
|
||||
"type",
|
||||
"left",
|
||||
"bottom",
|
||||
"size"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "barcodearea"
|
||||
},
|
||||
"page": {
|
||||
"description": "Page number this will be shown on, defaults to 1.",
|
||||
"type": "number"
|
||||
},
|
||||
"left": {
|
||||
"description": "Position of the element on the x axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"bottom": {
|
||||
"description": "Position of the element on the y axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"content": {
|
||||
"description": "Name of a variable to use. The available values depend on event configuration and installed plugins. Defaults to 'secret'.",
|
||||
"type": "string"
|
||||
},
|
||||
"text": {
|
||||
"description": "Custom text. Only used when 'content' is set to 'other'.",
|
||||
"type": "string"
|
||||
},
|
||||
"text_i18n": {
|
||||
"description": "Custom text in multiple languages. Only used when 'content' is set to 'other_i18n'.",
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"[a-zA-Z-]+": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"size": {
|
||||
"description": "Size of the barcode in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nowhitespace": {
|
||||
"description": "Whether a barcode should be rendered without margins. Only used for type 'barcodearea'.",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"type",
|
||||
"left",
|
||||
"bottom",
|
||||
"content",
|
||||
"width",
|
||||
"height"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "imagearea"
|
||||
},
|
||||
"page": {
|
||||
"description": "Page number this will be shown on, defaults to 1.",
|
||||
"type": "number"
|
||||
},
|
||||
"left": {
|
||||
"description": "Position of the element on the x axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"bottom": {
|
||||
"description": "Position of the element on the y axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"content": {
|
||||
"description": "Name of a variable to use. The available values depend on event configuration and installed plugins.",
|
||||
"type": "string"
|
||||
},
|
||||
"width": {
|
||||
"description": "Width of the element in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": {
|
||||
"description": "Height of the element in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"type",
|
||||
"left",
|
||||
"bottom",
|
||||
"content",
|
||||
"width",
|
||||
"fontsize",
|
||||
"fontfamily",
|
||||
"bold",
|
||||
"italic",
|
||||
"align",
|
||||
"color"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "textarea"
|
||||
},
|
||||
"page": {
|
||||
"description": "Page number this will be shown on, defaults to 1.",
|
||||
"type": "number"
|
||||
},
|
||||
"left": {
|
||||
"description": "Position of the element on the x axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"bottom": {
|
||||
"description": "Position of the element on the y axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"width": {
|
||||
"description": "Width of the element in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"content": {
|
||||
"description": "Name of a variable to use. The available values depend on event configuration and installed plugins.",
|
||||
"type": "string"
|
||||
},
|
||||
"text": {
|
||||
"description": "Custom text. Only used when 'content' is set to 'other'.",
|
||||
"type": "string"
|
||||
},
|
||||
"text_i18n": {
|
||||
"description": "Custom text in multiple languages. Only used when 'content' is set to 'other_i18n'.",
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"[a-zA-Z-]+": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"locale": {
|
||||
"description": "Locale to render the text in.",
|
||||
"type": ["string", "null"],
|
||||
"pattern": "[a-zA-Z-]*"
|
||||
},
|
||||
"fontsize": {
|
||||
"description": "Font size.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fontfamily": {
|
||||
"description": "Font family. The available values depend on installed plugins.",
|
||||
"type": "string"
|
||||
},
|
||||
"bold": {
|
||||
"description": "Use bold font variant.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"italic": {
|
||||
"description": "Use italic font variant.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"align": {
|
||||
"description": "Text alignment.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"left",
|
||||
"center",
|
||||
"right"
|
||||
]
|
||||
},
|
||||
"color": {
|
||||
"description": "Text color as a tuple of three integers in the 0-255 range and one float in the 0-1 range. The last value (alpha) is ignored by the current implementation but might be used in the future.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 255
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 4
|
||||
},
|
||||
"downward": {
|
||||
"description": "Downward rendering of text (recommended for new layouts), but default is false for backwards-compatibility.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"rotation": {
|
||||
"description": "Rotation in degrees.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"type",
|
||||
"left",
|
||||
"bottom",
|
||||
"content",
|
||||
"size"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "poweredby"
|
||||
},
|
||||
"page": {
|
||||
"description": "Page number this will be shown on, defaults to 1.",
|
||||
"type": "number"
|
||||
},
|
||||
"left": {
|
||||
"description": "Position of the element on the x axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"bottom": {
|
||||
"description": "Position of the element on the y axis in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"content": {
|
||||
"description": "Name of a style to use. The available values currently are 'dark' and 'white'.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dark",
|
||||
"white"
|
||||
]
|
||||
},
|
||||
"size": {
|
||||
"description": "Size of the logo in millimeters.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user