kopia lustrzana https://github.com/wagtail/bakerydemo
Add CustomAccessibilityItem with all non-experimental rules enabled
rodzic
cfc3338abb
commit
390cc6b71b
|
@ -1,4 +1,5 @@
|
|||
from wagtail import hooks
|
||||
from wagtail.admin.userbar import AccessibilityItem
|
||||
from wagtail.contrib.modeladmin.options import (
|
||||
ModelAdmin,
|
||||
ModelAdminGroup,
|
||||
|
@ -35,6 +36,18 @@ def register_icons(icons):
|
|||
]
|
||||
|
||||
|
||||
class CustomAccessibilityItem(AccessibilityItem):
|
||||
axe_run_only = None
|
||||
|
||||
|
||||
@hooks.register("construct_wagtail_userbar")
|
||||
def replace_userbar_accessibility_item(request, items):
|
||||
items[:] = [
|
||||
CustomAccessibilityItem() if isinstance(item, AccessibilityItem) else item
|
||||
for item in items
|
||||
]
|
||||
|
||||
|
||||
class BreadIngredientAdmin(ModelAdmin):
|
||||
# These stub classes allow us to put various models into the custom "Wagtail Bakery" menu item
|
||||
# rather than under the default Snippets section.
|
||||
|
|
Ładowanie…
Reference in New Issue