help: only show help pages if user is logged in

This commit is contained in:
Johannes Keyser 2017-06-05 14:57:22 +02:00 committed by James Valleroy
parent 4f47f4e37d
commit 8ae6fbbd4c
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 5 additions and 9 deletions

View File

@ -24,7 +24,6 @@ from apt.cache import Cache
from django.http import Http404
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _, ugettext_lazy
from stronghold.decorators import public
from plinth import cfg, __version__
from plinth.menu import main_menu
@ -42,14 +41,12 @@ def init():
100)
@public
def index(request):
"""Serve the index page"""
return TemplateResponse(request, 'help_index.html',
{'title': _('Documentation and FAQ')})
@public
def about(request):
"""Serve the about page"""
cache = Cache()
@ -63,7 +60,6 @@ def about(request):
return TemplateResponse(request, 'help_about.html', context)
@public
def manual(request):
"""Serve the manual page from the 'doc' directory"""
try:

View File

@ -119,13 +119,13 @@
</ul>
<ul class="nav navbar-nav navbar-right">
{% block mainmenu_right %}
<li>
<a href="{% url 'help:index' %}" title="{% trans "Help" %}">
<span class="glyphicon-question-sign glyphicon nav-icon"></span>
</a>
</li>
{% if user.is_authenticated %}
<li>
<a href="{% url 'help:index' %}" title="{% trans "Help" %}">
<span class="glyphicon-question-sign glyphicon nav-icon"></span>
</a>
</li>
<li class="dropdown">
<a href="{% url 'users:edit' user.username %}"
class="dropdown-toggle" data-toggle="dropdown"