User menu = User settings, Change password, Logout

This commit is contained in:
Stefano Brentegani 2014-07-25 18:08:47 +02:00
parent b1b1f93e1e
commit b05c396918
4 changed files with 21 additions and 30 deletions

View File

@ -61,7 +61,6 @@
<div class="col-md-2">{% include "helpdesk/attribution.html" %}</div>
<div class="col-md-2"><a href='{% url 'helpdesk_rss_index' %}'><img src='{{ STATIC_URL }}helpdesk/rss_icon.png' width='14' height='14' alt='{% trans "RSS Icon" %}' title='{% trans "RSS Feeds" %}' border='0' />{% trans "RSS Feeds" %}</a></div>
<div class="col-md-2"><a href='{% url 'helpdesk_api_help' %}'>{% trans "API" %}</a></div>
<div class="col-md-2"><a href='{% url 'helpdesk_user_settings' %}'>{% trans "User Settings" %}</a></div>
{% if user.is_superuser %}<div class="col-md-2"><a href='{% url 'helpdesk_system_settings' %}'>{% trans "System Settings" %}</a></div>{% endif %}
</div>
</div>

View File

@ -32,11 +32,19 @@
</ul>
</li>
{% endif %}
<li><a href='{% url 'logout' %}'><span class="glyphicon glyphicon-log-out"></span><span class="nav-text">{% trans "Logout" %} ({{ user.username }})</span></a></li>
<li class="headerlink dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-filter"></span><span class="nav-text"> {{ user.username }} <b class="caret"></b></span></a>
<ul class="dropdown-menu">
<li><a href='{% url 'helpdesk_user_settings' %}'>{% trans "User Settings" %}</a></li>
{% if helpdesk_settings.HELPDESK_SHOW_CHANGE_PASSWORD and user.has_usable_password %}
<li><a href='{% url 'auth_password_change' %}'>{% trans "Change password" %}</a></li>
{% endif %}
<li class="divider"></li>
<li><a href='{% url 'logout' %}'>{#<span class="glyphicon glyphicon-log-out"></span> #}{% trans "Logout" %}</a></li>
</ul>
</li>
</ul>
{% if not query %}
<form class="navbar-form navbar-left" id='searchform' method='get' action="{% url 'helpdesk_list' %}">
<div class="input-group">
<input type='text' name='q' size='15' class='input form-control' placeholder='{% trans "Search..." %}' id='search_query' title='{% trans "Enter a keyword, or a ticket number to jump straight to that ticket." %}'/>
@ -48,7 +56,6 @@
</span>
</div>
</form>
{% endif %}
{% else %}
{# Public menu #}

View File

@ -3,14 +3,6 @@
{% block helpdesk_title %}{% trans "Change User Settings" %}{% endblock %}
{% block helpdesk_body %}
{% if show_password_change_link %}
{% url 'auth_password_change' as password_change_url %}
<h2>Change Password</h2>
<p>
Change your password <a href="{{ password_change_url }}" title="change your password">here</a>.
</p>
{% endif %}
{% blocktrans %}
<h2>User Settings</h2>

View File

@ -1163,16 +1163,9 @@ def user_settings(request):
else:
form = UserSettingsForm(s.settings)
user = User.objects.get(id = request.user.id)
show_password_change_link = 0
# we don't want non-local users to see the 'change password' link.
if helpdesk_settings.HELPDESK_SHOW_CHANGE_PASSWORD and user.has_usable_password():
show_password_change_link = 1
return render_to_response('helpdesk/user_settings.html',
RequestContext(request, {
'form': form,
'show_password_change_link': show_password_change_link,
}))
user_settings = staff_member_required(user_settings)