Skip to content

Commit

Permalink
Display name and gravatar of logged in user.
Browse files Browse the repository at this point in the history
Fixes bug 2333.
  • Loading branch information
julen committed Aug 14, 2012
1 parent 2b48be7 commit 4fe914c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 73 deletions.
89 changes: 38 additions & 51 deletions pootle/static/css/style.css
Expand Up @@ -369,43 +369,6 @@ html[dir="rtl"] #header h1
float: right;
}

#nav-main ul
{
margin: 5px 5px 0 5px;
position: absolute;
right: 0px;
top: 0px;
}

html[dir="rtl"] #nav-main ul
{
right: auto;
left: 0px;
}

#nav-main ul li
{
float: left;
}

html[dir="rtl"] #nav-main ul li
{
float: right;
}

#nav-main ul li a
{
padding: 0 10px;
display: block;
font-weight: bold;
font-size: 95%;
}

#nav-main a.admin
{
color: #c30;
}


/*
* ZOOM CONTROL
Expand Down Expand Up @@ -451,28 +414,52 @@ html[dir="rtl"] #zoom {
* MENUBAR
*/

.menubar
#nav-main
{
margin: 10px 5px 0;
position: absolute;
right: 0px;
top: 0px;
}

html[dir="rtl"] #nav-main
{
visibility: visible;
position: static;
right: auto;
left: 0px;
}

.menubar ul,
.menubar li,
.menubar h6
#nav-main li
{
margin: 0;
padding: 0;
float: left;
}

.menubar>.bd>ul:after
html[dir="rtl"] #nav-main li
{
content: ".";
float: right;
}

#nav-main li a
{
padding: 0 10px;
display: block;
clear: both;
visibility: hidden;
height: 0;
line-height: 0;
font-weight: bold;
font-size: 95%;
}

#nav-main a.admin
{
color: #c30;
}

#user
{
float: left;
}

#user img
{
float: left;
margin: -2px 5px 0;
}


Expand Down
43 changes: 21 additions & 22 deletions pootle/templates/base.html
@@ -1,4 +1,4 @@
{% load i18n assets baseurl cache legalpages locale %}
{% load i18n assets baseurl cache legalpages locale profile_tags %}
{% get_current_language as LANGUAGE_CODE %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}" dir="{% locale_dir %}">
Expand Down Expand Up @@ -74,27 +74,26 @@ <h1>
</span>
{% endblock %}
</h1>
<div id="nav-main" class="menubar" lang="{{ LANGUAGE_CODE }}">
<div class="bd">
{% block menu %}
<ul>
<li class="menubaritem"><a href='{{ "/projects/"|l }}'>{% trans "Projects" %}</a></li>
{% if user.is_superuser %}
<li class="menubaritem"><a class="admin" href='{{ "/admin/"|l }}'>{% trans "Admin" %}</a></li>
{% endif %}
{% if user.is_authenticated %}
<li class="menubaritem"><a href='{% filter l %}/accounts/{{ user.username }}/{% endfilter %} '>{% trans "My Account" %}</a></li>
<li class="menubaritem"><a href='{{ "/accounts/logout/"|l }}'>{% trans "Log Out" %}</a></li>
{% else %}
{% if settings.CAN_REGISTER %}
<li class="menubaritem"><a href='{{ "/accounts/register/"|l }}'>{% trans "Register" %}</a></li>
{% endif %}
<li class="menubaritem"><a href='{{ "/accounts/login/"|l }}'>{% trans "Log In" %}</a></li>
{% endif %}
</ul>
{% endblock menu %}
</div>
</div>
<ul id="nav-main" lang="{{ LANGUAGE_CODE }}">
{% if user.is_authenticated %}
<li id="user">
<a href="{{ user.get_profile.get_absolute_url }}">
<img src="{{ user.get_profile|gravatar:20 }}" />{{ user.username }}</a>
</li>
{% endif %}
<li><a href='{{ "/projects/"|l }}'>{% trans "Projects" %}</a></li>
{% if user.is_superuser %}
<li><a class="admin" href='{{ "/admin/"|l }}'>{% trans "Admin" %}</a></li>
{% endif %}
{% if user.is_authenticated %}
<li><a href='{{ "/accounts/logout/"|l }}'>{% trans "Log Out" %}</a></li>
{% else %}
{% if settings.CAN_REGISTER %}
<li><a href='{{ "/accounts/register/"|l }}'>{% trans "Register" %}</a></li>
{% endif %}
<li><a href='{{ "/accounts/login/"|l }}'>{% trans "Log In" %}</a></li>
{% endif %}
</ul>
<div id="zoom">
<a id="zoom-out" title="{% trans "Zoom out (Ctrl+Shift+Insert)" %}" href="javascript:zoom(-1)">&ndash;</a><a id="zoom-reset" title="{% trans "Reset zoom (Ctrl+Shift+Home)" %}" href="javascript:zoom(0)">T</a><a id="zoom-in" title="{% trans "Zoom in (Ctrl+Shift+Page Up)" %}" href="javascript:zoom(1)">+</a>
</div>
Expand Down

0 comments on commit 4fe914c

Please sign in to comment.