mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Layout refresh for plugin settings page (#2490)
Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -328,15 +328,27 @@ class EventPlugins(EventSettingsViewMixin, EventPermissionRequiredMixin, Templat
|
||||
'FORMAT': _('Output and export formats'),
|
||||
'API': _('API features'),
|
||||
}
|
||||
|
||||
plugins_grouped = groupby(
|
||||
sorted(
|
||||
plugins,
|
||||
key=lambda p: (
|
||||
str(getattr(p, 'category', _('Other'))),
|
||||
(0 if getattr(p, 'featured', False) else 1),
|
||||
str(p.name).lower().replace('pretix ', '')
|
||||
),
|
||||
),
|
||||
lambda p: str(getattr(p, 'category', _('Other')))
|
||||
)
|
||||
plugins_grouped = [(c, list(plist)) for c, plist in plugins_grouped]
|
||||
|
||||
context['plugins'] = sorted([
|
||||
(c, labels.get(c, c), list(plist))
|
||||
(c, labels.get(c, c), plist, any(getattr(p, 'picture', None) for p in plist))
|
||||
for c, plist
|
||||
in groupby(
|
||||
sorted(plugins, key=lambda p: str(getattr(p, 'category', _('Other')))),
|
||||
lambda p: str(getattr(p, 'category', _('Other')))
|
||||
)
|
||||
in plugins_grouped
|
||||
], key=lambda c: (order.index(c[0]), c[1]) if c[0] in order else (999, str(c[1])))
|
||||
context['plugins_active'] = self.object.get_plugins()
|
||||
context['show_meta'] = settings.PRETIX_PLUGINS_SHOW_META
|
||||
return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user