143 lines
6.7 KiB
HTML
143 lines
6.7 KiB
HTML
<!--
|
|
Copyright 2013 OpenStack Foundation
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
not use this file except in compliance with the License. You may obtain
|
|
a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
License for the specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
{% import "macros.html" as macros%}
|
|
{%- if request.user.is_authenticated() -%}
|
|
{% set user=request.user %}
|
|
<span class="dropdown-toggle">
|
|
<ul class="dropdown-menu">
|
|
{% if user.new_response_count + user.seen_response_count > 0 %}
|
|
<li>
|
|
<a id='ab-responses' href="{{user.get_absolute_url()}}?sort=inbox§ion=forum">
|
|
<img
|
|
alt="{% trans username=user.username|escape %}responses for {{username}}{% endtrans %}"
|
|
{% if user.new_response_count > 0 %}
|
|
src="{{ "/images/mail-envelope-full.png"|media }}"
|
|
title="{% trans response_count=user.new_response_count %}you have {{response_count}} new response{% pluralize %}you have {{response_count}} new responses{% endtrans %}"
|
|
{% elif user.seen_response_count > 0 %}
|
|
src="{{ "/images/mail-envelope-empty.png"|media }}"
|
|
title="{% trans %}no new responses yet{% endtrans %}"
|
|
{% endif %}
|
|
/>
|
|
{% trans %}responses{% endtrans %}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if moderation_items and (moderation_items['new_count'] + moderation_items['seen_count'] > 0) %}
|
|
<li>
|
|
<a id="ab-responses" href="{{user.get_absolute_url()}}?sort=inbox§ion=flags">
|
|
{% if moderation_items['new_count'] > 0 %}
|
|
<img src="{{'/images/dialog-warning.png'|media}}"
|
|
{% if moderation_items['seen_count'] > 0 %}
|
|
alt="{% trans new=moderation_items['new_count'], seen=moderation_items['seen_count']%}{{new}} new flagged posts and {{seen}} previous{% endtrans %}"
|
|
title="{% trans new=moderation_items['new_count'], seen=moderation_items['seen_count']%}{{new}} new flagged posts and {{seen}} previous{% endtrans %}"
|
|
{% else %}
|
|
alt="{% trans new=moderation_items['new_count'] %}{{new}} new flagged posts{% endtrans %}"
|
|
title="{% trans new=moderation_items['new_count'] %}{{new}} new flagged posts{% endtrans %}"
|
|
{% endif %}
|
|
/>
|
|
{% elif moderation_items['seen_count'] > 0 %}
|
|
<img src={{'/images/dialog-warning-off.png'|media}}
|
|
alt="{% trans seen=moderation_items['seen_count'] %}{{seen}} flagged posts{% endtrans %}"
|
|
title="{% trans seen=moderation_items['seen_count'] %}{{seen}} flagged posts{% endtrans %}"
|
|
/>
|
|
{% endif %}
|
|
{% trans %}moderation{% endtrans %}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{%-
|
|
if settings.KARMA_MODE != 'hidden' and settings.BADGES_MODE != 'hidden'
|
|
-%}
|
|
<li>
|
|
<a class="user-micro-info"
|
|
href="{{user.get_absolute_url()}}?sort=reputation"
|
|
>{% trans %}karma:{% endtrans %} {{user.reputation}}</a>
|
|
</li>
|
|
{%- endif -%}
|
|
{% if settings.BADGES_MODE != 'hidden' %}
|
|
{% if user.gold + user.silver + user.bronze > 0 %}
|
|
<li>
|
|
<a class="user-micro-info"
|
|
href="{{user.get_absolute_url()}}#badges"
|
|
><span title="{{user.get_badge_summary}}">{% trans %}badges:{% endtrans %}
|
|
{% if user.gold %}
|
|
<span class='badge1'>●</span>
|
|
<span class="badgecount">{{user.gold}}</span>
|
|
{% endif %}
|
|
{% if user.silver %}
|
|
<span class='badge2'>●</span>
|
|
<span class="badgecount">{{user.silver}}</span>
|
|
{% endif %}
|
|
{% if user.bronze %}
|
|
<span class='badge3'>●</span>
|
|
<span class="badgecount">{{user.bronze}}</span>
|
|
{%- endif -%}
|
|
</span></a>
|
|
</li>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if request.user.is_administrator() %}
|
|
<li>
|
|
<a class="settings" href="{% url site_settings %}">{% trans %}settings{% endtrans %}</a>
|
|
</li>
|
|
<li>
|
|
<a class="widgets" href="{% url widgets %}">{% trans %}widgets{% endtrans %}</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if settings.USE_ASKBOT_LOGIN_SYSTEM %}
|
|
<li>
|
|
<a href="{{ settings.LOGOUT_URL }}?next={{ settings.LOGOUT_REDIRECT_URL }}"
|
|
>{% trans %}sign out{% endtrans %}</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
<a href="{{ request.user.get_absolute_url() }}">{{ request.user.username|escape }}</a>
|
|
</span>
|
|
{% elif settings.USE_ASKBOT_LOGIN_SYSTEM %}
|
|
<a class="signin" href="{{ settings.LOGIN_URL }}?next={{request.path|clean_login_url|escape}}">{% trans %}Hi there! Please sign in{% endtrans %}</a>
|
|
{% endif %}
|
|
<a
|
|
id="navTags"
|
|
href="{% url tags %}"
|
|
{% if active_tab == 'tags' %}class="on"{% endif %}
|
|
>{% trans %}tags{% endtrans %}</a>
|
|
{% if settings.GROUPS_ENABLED %}
|
|
<span class="dropdown">
|
|
<a
|
|
id="navGroups" class='{% if active_tab == 'groups' %}"on"{% endif %}'
|
|
href="{% url groups %}" data-target="#" >
|
|
{% trans %}people & groups{% endtrans %}
|
|
</a>
|
|
</span>
|
|
{%else%}
|
|
<a
|
|
id="navUsers"
|
|
href="{% url users %}"
|
|
{% if active_tab == 'users' %}class="on"{% endif %}
|
|
>{% trans %}users{% endtrans %}</a>
|
|
{% endif %}
|
|
{% if settings.BADGES_MODE == 'public' %}
|
|
<a
|
|
id="navBadges"
|
|
href="{% url badges %}"
|
|
{% if active_tab == 'badges' %}class="on"{% endif %}
|
|
>{% trans %}badges{% endtrans %}</a>
|
|
{% endif %}
|
|
<a class="help" href="{% url "help" %}" title="{% trans %}help{% endtrans %}">{% trans %}help{% endtrans %}</a>
|
|
{% if settings.MULTILINGUAL %}
|
|
{% include 'widgets/language_nav.html' %}
|
|
{% endif %}
|