portico: Skip footer and adjust header on invalid realm.

This commit is contained in:
Alex Vandiver 2023-08-09 17:15:36 +00:00 committed by Tim Abbott
parent 54605e54b6
commit 631a1def13
2 changed files with 8 additions and 1 deletions

View File

@ -21,7 +21,7 @@ hence the name.
</div> </div>
</div> </div>
<div class="alert-box"></div> <div class="alert-box"></div>
{% if not isolated_page %} {% if not isolated_page and not skip_footer %}
{% include 'zerver/footer.html' %} {% include 'zerver/footer.html' %}
{% endif %} {% endif %}
</div> </div>

View File

@ -107,6 +107,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
realm_name = realm.name realm_name = realm.name
realm_icon = get_realm_icon_url(realm) realm_icon = get_realm_icon_url(realm)
skip_footer = False
register_link_disabled = settings.REGISTER_LINK_DISABLED register_link_disabled = settings.REGISTER_LINK_DISABLED
login_link_disabled = settings.LOGIN_LINK_DISABLED login_link_disabled = settings.LOGIN_LINK_DISABLED
find_team_link_disabled = settings.FIND_TEAM_LINK_DISABLED find_team_link_disabled = settings.FIND_TEAM_LINK_DISABLED
@ -120,6 +121,11 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
login_link_disabled = True login_link_disabled = True
find_team_link_disabled = False find_team_link_disabled = False
allow_search_engine_indexing = True allow_search_engine_indexing = True
elif realm is None:
register_link_disabled = True
login_link_disabled = True
find_team_link_disabled = False
skip_footer = True
apps_page_web = settings.ROOT_DOMAIN_URI + "/accounts/go/" apps_page_web = settings.ROOT_DOMAIN_URI + "/accounts/go/"
@ -186,6 +192,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
"allow_search_engine_indexing": allow_search_engine_indexing, "allow_search_engine_indexing": allow_search_engine_indexing,
"landing_page_navbar_message": settings.LANDING_PAGE_NAVBAR_MESSAGE, "landing_page_navbar_message": settings.LANDING_PAGE_NAVBAR_MESSAGE,
"is_isolated_page": is_isolated_page(request), "is_isolated_page": is_isolated_page(request),
"skip_footer": skip_footer,
"default_page_params": default_page_params, "default_page_params": default_page_params,
"corporate_enabled": corporate_enabled, "corporate_enabled": corporate_enabled,
} }