{% load i18n %}
<div id="header"> 
    <div class="content">  
        <div id="logo"><h1><a href="{% url 'oppia_home' %}">{% trans 'app_name' %}</a></h1></div>
        <div id="lang">
            <form action="{% url 'profile_set_language' %}" method="post">
                {% csrf_token %}
                <select name="language">
                    {% get_language_info_list for LANGUAGES as languages %}
                    {% for language in languages %}
                        {% if language.code == LANGUAGE_CODE %}
                            <option value="{{ language.code }}" selected="selected">{{ language.name_local }}</option>
                        {% else %}
                            <option value="{{ language.code }}">{{ language.name_local }}</option>
                        {% endif %}
                    {% endfor %}
                </select>
                <input type="submit" value="Go" />
            </form>
        </div>
        <div style="clear:both;"></div>
        <div id="menu">
            <ul>
            <li><a href="{% url 'oppia_home' %}">{% trans 'menu_home' %}</a></li>
            {% if user.is_authenticated %}
	            <li><a href="{% url 'oppia_course' %}">{% trans 'menu_courses' %}</a></li>
	            <li><a href="{% url 'oppia_upload' %}">{% trans 'menu_upload' %}</a></li>
            {% endif %}
            </ul>
        </div>
        <div id="login">
        {% if user.is_authenticated %}
            {% url 'django.contrib.auth.views.logout' as url_logout %}
            {% url 'profile_edit' as url_edit %}
            <p>{% trans 'Welcome' %}, <a href="{{ url_edit }}">{{ user.first_name }}</a> 
            <span class="points" title="{{ points }} {% trans "points" %}"><a href="{% url 'profile_points' %}">{{ points }}</a></span>
            <span class="badges" title="{{ badges }} {% trans "badges" %}"><a href="{% url 'profile_badges' %}"><img src="{{ STATIC_URL }}oppia/images/badge.png" alt="{{ badges }} {% trans "badges" %}"/>{{ badges }}</a></span> <a href="{{ url_logout }}">Logout</a></p>
        {% else %}
            {% url 'django.contrib.auth.views.login' as url_login %}
            {% url 'profile_register' as url_register %}
            <p>{% blocktrans with request.path as rpath %}Welcome, please <a href="{{ url_login }}?next={{ rpath }}">Login</a> or <a href="{{ url_register }}">Register</a>{% endblocktrans %}</p>      
        {% endif %}
            
        </div>
    </div>
    <div style="clear:both;"></div>
</div>
