Add product description to ticket editor

This commit is contained in:
Raphael Michel
2017-07-27 10:13:55 +02:00
parent 9a18f2b553
commit 59dea63870
4 changed files with 6 additions and 1 deletions

View File

@@ -164,6 +164,7 @@ var editor = {
"item": gettext("Sample product"),
"variation": gettext("Sample variation"),
"itemvar": gettext("Sample product sample variation"),
"item_description": gettext("Sample product description"),
"price": gettext("123.45 EUR"),
"attendee_name": gettext("John Doe"),
"event_name": gettext("Sample event name"),

View File

@@ -287,6 +287,7 @@
<option value="order">{% trans "Order code" %}</option>
<option value="item">{% trans "Product name" %}</option>
<option value="variation">{% trans "Variation name" %}</option>
<option value="item_description">{% trans "Product description" %}</option>
<option value="itemvar">{% trans "Product name and variation" %}</option>
<option value="price">{% trans "Price" %}</option>
<option value="attendee_name">{% trans "Attendee name" %}</option>

View File

@@ -70,6 +70,8 @@ class PdfTicketOutput(BaseTicketOutput):
return order.code
elif o['content'] == 'item':
return str(op.item)
elif o['content'] == 'item_description':
return str(op.item.description)
elif o['content'] == 'secret':
return op.secret
elif o['content'] == 'variation':

View File

@@ -85,7 +85,8 @@ class EditorView(EventPermissionRequiredMixin, ChartContainingView, TemplateView
if "preview" in request.POST:
with rolledback_transaction(), language(request.event.settings.locale):
item = request.event.items.create(name=_("Sample product"), default_price=42.23)
item = request.event.items.create(name=_("Sample product"), default_price=42.23,
description=_("Sample product description"))
item2 = request.event.items.create(name=_("Sample workshop"), default_price=23.40)
from pretix.base.models import Order