{% extends "layout_default.phtml" %}

{% block meta_title %}{% trans 'Profile' %}{% endblock %}

{# block top_content %}
<div class="title"><h5>Manage your profile </h5></div>
{% endblock #}

{% block content %}

<div class="widget simpleTabs first">
    <ul class="tabs">
        <li><a href="#tab-profile">{% trans 'Profile' %}</a></li>
        <li><a href="#tab-password">{% trans 'Change password' %}</a></li>
        {# <li><a href="#tab-api">{% trans 'API' %}</a></li> #}
        <li><a href="#tab-gravatar">{% trans 'Gravatar' %}</a></li>
    </ul>

    <div class="tab_container">
        
        <div id="tab-profile" class="tab_content nopadding">
            <form method="post" action="admin/staff/profile_update" class="mainForm api-form" data-api-msg="{% trans 'Profile updated' %}">
                <fieldset>
                    <div class="rowElem noborder">
                        <label>{% trans 'Name' %}</label>
                        <div class="formRight">
                            <input type="text" name="name" value="{{profile.name}}" required="required"/>
                        </div>
                        <div class="fix"></div>
                    </div>
                    <div class="rowElem">
                        <label>{% trans 'Email' %}</label>
                        <div class="formRight">
                            
                            <input type="text" name="email" value="{{profile.email}}" required="required"/>
                        </div>
                        <div class="fix"></div>
                    </div>
                    <div class="rowElem">
                        <label>{% trans 'Signature' %}</label>
                        <div class="formRight">
                            <textarea name="signature" cols="5" rows="3">{{profile.signature}}</textarea>
                        </div>
                        <div class="fix"></div>
                    </div>
                    
                    <input type="submit" value="{% trans 'Update profile' %}" class="greyishBtn submitForm" />
                </fieldset>
            </form>
        </div>
        
        <div id="tab-password" class="tab_content nopadding">
            <form method="post" action="admin/staff/profile_change_password" class="mainForm api-form" data-api-msg="{% trans 'Password changed' %}">
                <fieldset>
                    <div class="rowElem noborder">
                        <label>{% trans 'Password' %}</label>
                        <div class="formRight">
                            <input type="password" name="password" value="" required="required"/>
                        </div>
                        <div class="fix"></div>
                    </div>
                    
                    <div class="rowElem">
                        <label>{% trans 'Password confirm' %}</label>
                        <div class="formRight">
                            <input type="password" name="password_confirm" value="" required="required"/>
                        </div>
                        <div class="fix"></div>
                    </div>

                    <input type="submit" value="{% trans 'Change password' %}" class="greyishBtn submitForm" />
                </fieldset>
            </form>
        </div>

        {#
        <div id="tab-api" class="tab_content">
            <div class="help">
                <h3>{% trans 'Api key' %}</h3>
                <blockquote>{% trans 'Api key explanation' %}</blockquote>
            </div>

            <form method="post" action="admin/staff/profile_generate_api_key" class="api-form">
            <fieldset>
                <legend>{% trans 'API Key' %}</legend>
                <div class="element">
                    <input type="text" value="{{ admin.staff_profile_get.api_token }}" />
                </div>
                <div class="element">
                    <input type="submit" value="{% trans 'Generate new key' %}">
                </div>
            </fieldset>
            </form>
        </div>
        #}

        <div id="tab-gravatar" class="tab_content">
            <h1>{% trans 'Gravatar' %}</h1>
            <p><img src="{{ profile.email|gravatar }}" /> {% trans 'Change your avatar at' %} <a target="_blank" href="http://www.gravatar.com">gravatar.com</a></p>
        </div>
    </div>
    <div class="fix"></div>	 
</div>
{% endblock %}