diff --git a/src/pretix/base/migrations/0026_order_comment.py b/src/pretix/base/migrations/0026_order_comment.py new file mode 100644 index 000000000..b0c45621c --- /dev/null +++ b/src/pretix/base/migrations/0026_order_comment.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.8 on 2016-08-12 08:21 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pretixbase', '0025_auto_20160802_2202'), + ] + + operations = [ + migrations.AddField( + model_name='order', + name='comment', + field=models.TextField(blank=True, help_text='The text entered in this field will not be visible to the user and is available for your convenience.', verbose_name='Comment'), + ), + ] diff --git a/src/pretix/base/models/orders.py b/src/pretix/base/models/orders.py index ec32f40e5..2bdf11d8b 100644 --- a/src/pretix/base/models/orders.py +++ b/src/pretix/base/models/orders.py @@ -74,6 +74,8 @@ class Order(LoggedModel): :type payment_info: str :param total: The total amount of the order, including the payment fee :type total: decimal.Decimal + :param comment: An internal comment that will only be visible to staff, and never displayed to the user + :type comment: str """ STATUS_PENDING = "n" @@ -153,6 +155,11 @@ class Order(LoggedModel): decimal_places=2, max_digits=10, verbose_name=_("Total amount") ) + comment = models.TextField( + blank=True, verbose_name=_("Comment"), + help_text=_("The text entered in this field will not be visible to the user and is available for your " + "convenience.") + ) class Meta: verbose_name = _("Order") diff --git a/src/pretix/base/models/vouchers.py b/src/pretix/base/models/vouchers.py index ca9ce7030..0920718d5 100644 --- a/src/pretix/base/models/vouchers.py +++ b/src/pretix/base/models/vouchers.py @@ -43,6 +43,8 @@ class Voucher(LoggedModel): :type variation: ItemVariation :param quota: If set, the quota to choose an item from :type quota: Quota + :param comment: An internal comment that will only be visible to staff, and never displayed to the user + :type comment: str Various constraints apply: diff --git a/src/pretix/control/forms/orders.py b/src/pretix/control/forms/orders.py index 2b860b55e..e6e0077c9 100644 --- a/src/pretix/control/forms/orders.py +++ b/src/pretix/control/forms/orders.py @@ -23,3 +23,15 @@ class ExporterForm(forms.Form): data[k] = [m.pk for m in v] return data + + +class CommentForm(I18nModelForm): + class Meta: + model = Order + fields = ['comment'] + widgets = { + 'comment': forms.Textarea(attrs={ + 'rows': 3, + 'class': 'helper-width-100', + }), + } diff --git a/src/pretix/control/logdisplay.py b/src/pretix/control/logdisplay.py index 2addfca5d..9513929d1 100644 --- a/src/pretix/control/logdisplay.py +++ b/src/pretix/control/logdisplay.py @@ -19,6 +19,7 @@ def pretixcontrol_logentry_display(sender, logentry, **kwargs): 'pretix.event.order.invoice.generated': _('The invoice has been generated.'), 'pretix.event.order.invoice.regenerated': _('The invoice has been regenerated.'), 'pretix.event.order.invoice.reissued': _('The invoice has been reissued.'), + 'pretix.event.order.comment': _('The order\'s internal comment has been updated.'), } if logentry.action_type in plains: return plains[logentry.action_type] diff --git a/src/pretix/control/templates/pretixcontrol/order/index.html b/src/pretix/control/templates/pretixcontrol/order/index.html index 1016cdfa4..1e20a2eed 100644 --- a/src/pretix/control/templates/pretixcontrol/order/index.html +++ b/src/pretix/control/templates/pretixcontrol/order/index.html @@ -1,5 +1,6 @@ {% extends "pretixcontrol/event/base.html" %} {% load i18n %} +{% load bootstrap3 %} {% load eventurl %} {% block title %} {% blocktrans trimmed with code=order.code %} @@ -279,6 +280,25 @@ {% endif %} +
[0-9A-Z]+)/extend$', orders.OrderExtend.as_view(),
name='event.order.extend'),
+ url(r'^orders/(?P[0-9A-Z]+)/comment$', orders.OrderComment.as_view(),
+ name='event.order.comment'),
url(r'^orders/(?P[0-9A-Z]+)/$', orders.OrderDetail.as_view(), name='event.order'),
url(r'^orders/(?P[0-9A-Z]+)/download/(?P