mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Add product description to ticket editor
This commit is contained in:
@@ -164,6 +164,7 @@ var editor = {
|
|||||||
"item": gettext("Sample product"),
|
"item": gettext("Sample product"),
|
||||||
"variation": gettext("Sample variation"),
|
"variation": gettext("Sample variation"),
|
||||||
"itemvar": gettext("Sample product – sample variation"),
|
"itemvar": gettext("Sample product – sample variation"),
|
||||||
|
"item_description": gettext("Sample product description"),
|
||||||
"price": gettext("123.45 EUR"),
|
"price": gettext("123.45 EUR"),
|
||||||
"attendee_name": gettext("John Doe"),
|
"attendee_name": gettext("John Doe"),
|
||||||
"event_name": gettext("Sample event name"),
|
"event_name": gettext("Sample event name"),
|
||||||
|
|||||||
@@ -287,6 +287,7 @@
|
|||||||
<option value="order">{% trans "Order code" %}</option>
|
<option value="order">{% trans "Order code" %}</option>
|
||||||
<option value="item">{% trans "Product name" %}</option>
|
<option value="item">{% trans "Product name" %}</option>
|
||||||
<option value="variation">{% trans "Variation 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="itemvar">{% trans "Product name and variation" %}</option>
|
||||||
<option value="price">{% trans "Price" %}</option>
|
<option value="price">{% trans "Price" %}</option>
|
||||||
<option value="attendee_name">{% trans "Attendee name" %}</option>
|
<option value="attendee_name">{% trans "Attendee name" %}</option>
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ class PdfTicketOutput(BaseTicketOutput):
|
|||||||
return order.code
|
return order.code
|
||||||
elif o['content'] == 'item':
|
elif o['content'] == 'item':
|
||||||
return str(op.item)
|
return str(op.item)
|
||||||
|
elif o['content'] == 'item_description':
|
||||||
|
return str(op.item.description)
|
||||||
elif o['content'] == 'secret':
|
elif o['content'] == 'secret':
|
||||||
return op.secret
|
return op.secret
|
||||||
elif o['content'] == 'variation':
|
elif o['content'] == 'variation':
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ class EditorView(EventPermissionRequiredMixin, ChartContainingView, TemplateView
|
|||||||
|
|
||||||
if "preview" in request.POST:
|
if "preview" in request.POST:
|
||||||
with rolledback_transaction(), language(request.event.settings.locale):
|
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)
|
item2 = request.event.items.create(name=_("Sample workshop"), default_price=23.40)
|
||||||
|
|
||||||
from pretix.base.models import Order
|
from pretix.base.models import Order
|
||||||
|
|||||||
Reference in New Issue
Block a user