mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Connect giftcards with customer accounts (#5126)
Connect giftcards with customer accounts, show giftcards during checkout and in account , show giftcard list in backend customer view
This commit is contained in:
@@ -368,6 +368,12 @@ class CustomerAccountBaseMixin(CustomerRequiredMixin):
|
||||
'active': url_name.startswith('organizer.customer.membership'),
|
||||
'icon': 'id-badge',
|
||||
},
|
||||
{
|
||||
'label': _('Gift cards'),
|
||||
'url': eventreverse(self.request.organizer, 'presale:organizer.customer.giftcards', kwargs={}),
|
||||
'active': url_name.startswith('organizer.customer.giftcard'),
|
||||
'icon': 'gift',
|
||||
},
|
||||
{
|
||||
'label': _('Addresses'),
|
||||
'url': eventreverse(self.request.organizer, 'presale:organizer.customer.addresses', kwargs={}),
|
||||
@@ -461,6 +467,15 @@ class MembershipUsageView(CustomerAccountBaseMixin, ListView):
|
||||
return ctx
|
||||
|
||||
|
||||
class GiftcardView(CustomerAccountBaseMixin, ListView):
|
||||
template_name = 'pretixpresale/organizers/customer_giftcards.html'
|
||||
context_object_name = 'gift_cards'
|
||||
paginate_by = 20
|
||||
|
||||
def get_queryset(self):
|
||||
return self.request.customer.customer_gift_cards.all()
|
||||
|
||||
|
||||
class AddressView(CustomerAccountBaseMixin, ListView):
|
||||
template_name = 'pretixpresale/organizers/customer_addresses.html'
|
||||
context_object_name = 'invoice_addresses'
|
||||
|
||||
Reference in New Issue
Block a user