mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-14 06:55:08 +02:00
extended header for org users
This commit is contained in:
parent
a1fca00b8f
commit
619a71fdb6
13 changed files with 77 additions and 70 deletions
|
@ -13,6 +13,7 @@ def language_code(request):
|
|||
"""
|
||||
return {"LANGUAGE_CODE": settings.LANGUAGE_CODE}
|
||||
|
||||
|
||||
def canonical_path(request):
|
||||
"""Add a canonical URL to the template context.
|
||||
|
||||
|
@ -22,6 +23,7 @@ def canonical_path(request):
|
|||
"""
|
||||
return {"CANONICAL_PATH": request.build_absolute_uri(request.path)}
|
||||
|
||||
|
||||
def is_demo_site(request):
|
||||
"""Add a boolean if this is a demo site.
|
||||
|
||||
|
@ -31,10 +33,12 @@ def is_demo_site(request):
|
|||
"""
|
||||
return {"IS_DEMO_SITE": settings.IS_DEMO_SITE}
|
||||
|
||||
|
||||
def is_production(request):
|
||||
"""Add a boolean if this is our production site."""
|
||||
return {"IS_PRODUCTION": settings.IS_PRODUCTION}
|
||||
|
||||
|
||||
def org_user_status(request):
|
||||
if request.user.is_authenticated:
|
||||
is_org_user = request.user.is_org_user(request)
|
||||
|
@ -42,20 +46,17 @@ def org_user_status(request):
|
|||
is_org_user = False
|
||||
|
||||
return {
|
||||
'is_org_user': is_org_user,
|
||||
"is_org_user": is_org_user,
|
||||
}
|
||||
|
||||
|
||||
def add_portfolio_to_context(request):
|
||||
return {
|
||||
'portfolio': getattr(request, 'portfolio', None)
|
||||
}
|
||||
return {"portfolio": getattr(request, "portfolio", None)}
|
||||
|
||||
|
||||
def add_path_to_context(request):
|
||||
return {
|
||||
'path': getattr(request, 'path', None)
|
||||
}
|
||||
return {"path": getattr(request, "path", None)}
|
||||
|
||||
|
||||
def add_has_profile_feature_flag_to_context(request):
|
||||
return {
|
||||
'has_profile_feature_flag': flag_is_active(request, "profile_feature")
|
||||
}
|
||||
return {"has_profile_feature_flag": flag_is_active(request, "profile_feature")}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue