ui: start patternfly v4 migration

This commit is contained in:
Jens Langhammer
2020-02-19 21:03:39 +01:00
parent 1d22e30c70
commit f1d77d475c
150 changed files with 583 additions and 195602 deletions

View File

@ -5,6 +5,7 @@ from structlog import get_logger
register = template.Library()
LOGGER = get_logger()
ACTIVE_STRING = "pf-m-current"
@register.simple_tag(takes_context=True)
@ -23,9 +24,9 @@ def is_active(context, *args, **kwargs):
# Monkeypatch app_name: urls from core have app_name == ''
# since the root urlpatterns have no namespace
if app_name and request.resolver_match.app_name == app_name:
return "active"
return ACTIVE_STRING
if app_name is None:
return "active"
return ACTIVE_STRING
return ""
@ -42,7 +43,7 @@ def is_active_url(context, view):
if not request.resolver_match:
return ""
if current_full_url == view:
return "active"
return ACTIVE_STRING
# if matching_url == request.path:
# return 'active'
return ""
@ -57,5 +58,5 @@ def is_active_app(context, *args):
return ""
for app_name in args:
if request.resolver_match.app_name == app_name:
return "active"
return ACTIVE_STRING
return ""