Skip to content

Commit

Permalink
Temporarily disable a few features in sidebar of organization (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
HungNgien authored Jan 1, 2025
1 parent a247d00 commit f3642d3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 55 deletions.
49 changes: 25 additions & 24 deletions src/pretix/control/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,22 @@ def get_organizer_navigation(request):
}),
'active': url.url_name == 'organizer.edit',
},
{
'label': _('Event metadata'),
'url': reverse('control:organizer.properties', kwargs={
'organizer': request.organizer.slug
}),
'active': url.url_name.startswith('organizer.propert'),
},
{
'label': _('Webhooks'),
'url': reverse('control:organizer.webhooks', kwargs={
'organizer': request.organizer.slug
}),
'active': 'organizer.webhook' in url.url_name,
'icon': 'bolt',
},
# Temporary disabled
# {
# 'label': _('Event metadata'),
# 'url': reverse('control:organizer.properties', kwargs={
# 'organizer': request.organizer.slug
# }),
# 'active': url.url_name.startswith('organizer.propert'),
# },
# {
# 'label': _('Webhooks'),
# 'url': reverse('control:organizer.webhooks', kwargs={
# 'organizer': request.organizer.slug
# }),
# 'active': 'organizer.webhook' in url.url_name,
# 'icon': 'bolt',
# },
{
"label": _("Billing settings"),
"url": reverse(
Expand All @@ -430,15 +431,15 @@ def get_organizer_navigation(request):
'icon': 'group',
})

if 'can_manage_gift_cards' in request.orgapermset:
nav.append({
'label': _('Gift cards'),
'url': reverse('control:organizer.giftcards', kwargs={
'organizer': request.organizer.slug
}),
'active': 'organizer.giftcard' in url.url_name,
'icon': 'credit-card',
})
# if 'can_manage_gift_cards' in request.orgapermset:
# nav.append({
# 'label': _('Gift cards'),
# 'url': reverse('control:organizer.giftcards', kwargs={
# 'organizer': request.organizer.slug
# }),
# 'active': 'organizer.giftcard' in url.url_name,
# 'icon': 'credit-card',
# })
if 'can_change_organizer_settings' in request.orgapermset:
nav.append({
'label': _('Devices'),
Expand Down
66 changes: 35 additions & 31 deletions src/pretix/plugins/banktransfer/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,41 @@ def control_nav_import(sender, request=None, **kwargs):

@receiver(nav_organizer, dispatch_uid="payment_banktransfer_organav")
def control_nav_orga_import(sender, request=None, **kwargs):
url = resolve(request.path_info)
if not request.user.has_organizer_permission(request.organizer, 'can_change_orders', request=request):
return []
if not request.organizer.events.filter(plugins__icontains='pretix.plugins.banktransfer'):
return []
return [
{
'label': _("Bank transfer"),
'url': reverse('plugins:banktransfer:import', kwargs={
'organizer': request.organizer.slug,
}),
'icon': 'university',
'children': [
{
'label': _('Import bank data'),
'url': reverse('plugins:banktransfer:import', kwargs={
'organizer': request.organizer.slug,
}),
'active': (url.namespace == 'plugins:banktransfer' and url.url_name == 'import'),
'icon': 'upload',
},
{
'label': _('Export refunds'),
'url': reverse('plugins:banktransfer:refunds.list', kwargs={
'organizer': request.organizer.slug,
}),
'active': (url.namespace == 'plugins:banktransfer' and url.url_name.startswith("refunds")),
},
]
}
]
"""
Temporary disabled
"""
return []
# url = resolve(request.path_info)
# if not request.user.has_organizer_permission(request.organizer, 'can_change_orders', request=request):
# return []
# if not request.organizer.events.filter(plugins__icontains='pretix.plugins.banktransfer'):
# return []
# return [
# {
# 'label': _("Bank transfer"),
# 'url': reverse('plugins:banktransfer:import', kwargs={
# 'organizer': request.organizer.slug,
# }),
# 'icon': 'university',
# 'children': [
# {
# 'label': _('Import bank data'),
# 'url': reverse('plugins:banktransfer:import', kwargs={
# 'organizer': request.organizer.slug,
# }),
# 'active': (url.namespace == 'plugins:banktransfer' and url.url_name == 'import'),
# 'icon': 'upload',
# },
# {
# 'label': _('Export refunds'),
# 'url': reverse('plugins:banktransfer:refunds.list', kwargs={
# 'organizer': request.organizer.slug,
# }),
# 'active': (url.namespace == 'plugins:banktransfer' and url.url_name.startswith("refunds")),
# },
# ]
# }
# ]


@receiver(html_head, dispatch_uid="banktransfer_html_head")
Expand Down

0 comments on commit f3642d3

Please sign in to comment.