mirror of https://github.com/zulip/zulip.git
Hide most of the navbar on the deployed app
(imported from commit 3b055588f7de805bf1b038f1bc6c03837eda010a)
This commit is contained in:
parent
489fd58e43
commit
8819bdc0fc
|
@ -187,6 +187,10 @@ LOGGING = {
|
|||
}
|
||||
}
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
'zephyr.context_processors.add_settings',
|
||||
)
|
||||
|
||||
ACCOUNT_ACTIVATION_DAYS=7
|
||||
EMAIL_USE_TLS = True
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
|
@ -202,9 +206,11 @@ MESSAGE_LOG="all_messages_log"
|
|||
|
||||
if deployed:
|
||||
ALLOW_REGISTER = False
|
||||
FULL_NAVBAR = False
|
||||
NOT_LOGGED_IN_REDIRECT = 'django.contrib.auth.views.login'
|
||||
else:
|
||||
ALLOW_REGISTER = True
|
||||
FULL_NAVBAR = True
|
||||
NOT_LOGGED_IN_REDIRECT = 'zephyr.views.accounts_home'
|
||||
|
||||
# For testing, you may want to have emails be printed to the console.
|
||||
|
|
|
@ -9,9 +9,11 @@
|
|||
{% block content %}
|
||||
<div class="navbar">
|
||||
<ul class="nav pull-right">
|
||||
{% if full_navbar %}
|
||||
<li><a href="#">Learn More</a></li>
|
||||
<li><a href="#">Pricing</a></li>
|
||||
<li><a href="https://blog.humbughq.com/">Blog</a></li>
|
||||
{% endif %}
|
||||
<li><a href="/accounts/login/?next=/">Log in</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
from django.conf import settings
|
||||
|
||||
def add_settings(context):
|
||||
return { 'full_navbar': settings.FULL_NAVBAR }
|
|
@ -106,9 +106,9 @@ def register(request):
|
|||
login(request, authenticate(username=email, password=password))
|
||||
return HttpResponseRedirect(reverse('zephyr.views.home'))
|
||||
|
||||
return render(request, 'zephyr/register.html', {
|
||||
'form': form, 'company_name': company_name, 'email': email, 'key': key,
|
||||
})
|
||||
return render_to_response('zephyr/register.html',
|
||||
{ 'form': form, 'company_name': company_name, 'email': email, 'key': key },
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
def login_page(request, **kwargs):
|
||||
template_response = django_login_page(request, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue