landing: Add option to show custom navbar message.

This commit is contained in:
Vishnu KS 2020-05-21 20:06:14 +05:30 committed by Tim Abbott
parent 89539d6fb5
commit 8b3eb9a846
5 changed files with 30 additions and 0 deletions

View File

@ -1766,3 +1766,22 @@ input.new-organization-button {
.unsupported_browser_page {
padding-bottom: 80px;
}
#navbar-custom-message {
font-size: 1rem;
background-color: hsl(177, 52%, 55%);
background: linear-gradient(145deg, hsl(191, 56%, 55%), hsl(169, 65%, 42%));
font-weight: 600;
text-align: center;
position: relative;
top: -40px;
margin-left: calc(50% - 50vw);
width: 100vw;
padding: 10px;
border-bottom: 1px solid hsl(177, 52%, 55%);
a {
color: hsl(0, 0%, 100%);
text-decoration: underline;
}
}

View File

@ -1,5 +1,10 @@
{% if not isolated_page %}
<nav class="portico-header">
{% if landing_page_navbar_message %}
<div id="navbar-custom-message">
{{ landing_page_navbar_message |safe }}
</div>
{% endif %}
<div class="content">
<a class="brand logo" href="{{ root_domain_uri }}">
<svg class="brand-logo" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 40 40" version="1.1">

View File

@ -134,6 +134,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
'settings_comments_path': settings_comments_path,
'platform': platform,
'allow_search_engine_indexing': allow_search_engine_indexing,
'landing_page_navbar_message': settings.LANDING_PAGE_NAVBAR_MESSAGE,
}
context['OPEN_GRAPH_URL'] = '%s%s' % (realm_uri, request.path)

View File

@ -365,6 +365,10 @@ BILLING_ENABLED = False
FREE_TRIAL_DAYS = None
# Custom message (supports HTML) to be shown in the navbar of landing pages. Used mainly for
# making announcements.
LANDING_PAGE_NAVBAR_MESSAGE: Optional[str] = None
# Automatically catch-up soft deactivated users when running the
# `soft-deactivate-users` cron. Turn this off if the server has 10Ks of
# users, and you would like to save some disk space. Soft-deactivated

View File

@ -156,6 +156,7 @@ SEARCH_PILLS_ENABLED = bool(os.getenv('SEARCH_PILLS_ENABLED', False))
BILLING_ENABLED = True
FREE_TRIAL_DAYS = None
LANDING_PAGE_NAVBAR_MESSAGE = None
# Test Custom TOS template rendering
TERMS_OF_SERVICE = 'corporate/terms.md'