{% load i18n %}
{# print user's state and form of login #}
{% block js_import %}
{{block.super}}

    <script language="javascript">
    var url_login_ajax='{{WEB_URL}}{% url ldt.user.views.loginAjax %}';
    {% if reload %}    
        var reload=true;    
    {% else %}
        var reload=false;  
    {% endif %}

    $(document).ready(function(){
        $('.login_link').nyroModal({
                height:235, 
                width:430, 
                padding:0,
                bgColor: 'rgb(239, 239, 239)',
                });
        })

    </script>
{% endblock %}
{% block css_import %}
{{block.super}}
{% endblock %}
<div id="loginstate" class="block span-24 last">
    <ul class="usertool">
        {% if user.is_authenticated %}    
            <li id="user">{{user.username}}</li>
            <li><a href="{% url ldt.user.views.profile  %}" >{% trans "Profiles" %}</a> </li>
            <li><a href="{% url ldt.user.views.space %}">{% trans "Space" %}</a></li>
            {% if user.is_superuser %}
            <li><a href="{% url registration.views.register  %}" >{% trans "Create an account" %}</a></li>
            {% endif %}
            <li><a href="{% url ldt.user.views.logout_view %}" >{% trans "Log out" %}</a></li>  
        
        {% else %}     
            <li><a href="#inlineContent" class="login_link">{% trans "Log in" %}</li>
        {% endif %}
    </ul>
</div>
<div id="inlineContent" style="display: none;">
    <div id="loginform">
            <div class="title">
                <a href="#" class="nyroModalClose">X</a>
                <div>{% trans "Log in" %}</div>             
            </div>
            <div id="msg"></div>
            <div id="login_form" style="padding: 8px;" method="POST" action="">
                <div style="float: right; padding-bottom: 8px;">
                    <a href="{% url registration.views.register  %}" >{% trans "create account" %}</a>
                </div>
                <dl style="clear: both;">
                    
                    <dt><label for="username">{% trans "Pseudo" %}:</label></dt>
                    <dd>
                        <input class= "inputbox" type="text" style="width:148px" name="username" value="" id="username">
                        <div id="login_form_username_error" class="ajaxform_error">{% trans "this field is compulsory" %}</div>
                    </dd>
               
                
                    <dt><label for="password">{% trans "Password" %}: </label></dt>
                    <dd>
                        <input class= "inputbox" type="password" style="width:148px" name="password" value="" id="password" >
                        <div id="login_form_password_error" class="ajaxform_error">{% trans "this field is compulsory" %}</div>
                    </dd>
                    <dt/>
                    <dd>
                        <a href="{% url django.contrib.auth.views.password_reset  %}" >{% trans "reset password" %}</a>
                    </dd>
                </dl>
                <input class="button" id="submit" type="submit" value="{% trans 'Connection' %}"/>  
            </div>

        </div>
</div>
