{#
Rdiffweb SSHKeys plugins

Copyright (C) 2015 Patrik Dufresne Service Logiciel

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
#}

<div class="spacer"/>

{% include 'message.html' %}

{% import 'macros.html' as macros %}

<!-- Panel to set user info. -->
{% call macros.panel(title=_("General information")) %}
<div class="panel-body">
<form action="#" method="post" role="form" class="clearfix" >
    <div class="form-group">
        <label for="username" class="control-label">
            {% trans %}Username{% endtrans %}</label>
        <div>
            <input class="form-control" type="text" name="username" 
                id="username" readonly="readonly"
                value="{{ username }}" />
        </div>
    </div>
    <div class="form-group">
        <label for="email" class="control-label">
            {% trans %}Email{% endtrans %}</label>
        <div>
            <input class="form-control" type="text" name="email" id="email"
                {% if not supports_set_email %}readonly="readonly"{% endif %}
                value="{{ email }}"/>
        </div>
    </div>
    <input type="hidden" name="action" value="set_profile_info" />
    <div>
        <button type="submit" class="btn btn-success">{% trans %}Save changes{% endtrans %}</button>
    </div>
</form>
</div>
{% endcall %}

<!-- Panel to change password. -->
{% if supports_set_password %}
{% call macros.panel(title=_("Change password")) %}
<div class="panel-body">
<form action="#" method="post" role="form" class="clearfix" data-validate>
    <div class="form-group">
        <label for="current" class="control-label">
            {% trans %}Current password{% endtrans %}</label>
        <div>
            <input class="form-control" type="password" name="current"
                id="current" required />
        </div>
    </div>
    <div class="form-group">
        <label for="new" class="control-label">
            {% trans %}New password{% endtrans %}</label>
        <div>
            <input class="form-control" type="password" name="new" id="new" required />
        </div>
    </div>
    <div class="form-group">
        <label for="confirm" class="control-label">
            {% trans %}Confirm new password{% endtrans %}</label>
        <div>
        <input class="form-control" type="password" name="confirm"
            id="confirm" data-rule-equalto="#new" required/>
        </div>
    </div>
    <input type="hidden" name="action" value="set_password" />
    <div>
        <button type="submit" class="btn btn-success">
            {% trans %}Update password{% endtrans %}
        </button>
    </div>
</form>
</div>
{% endcall %}
{% endif %}

<!-- Panel to refresh repository list. -->
{% call macros.panel(title=_("Refresh")) %}
<div class="panel-body">
<form action="#" method="post" role="form">
    <input type="hidden" name="action" value="update_repos" />
    <p class="help-block">
        {% trans %}Refresh the list of repositories associated to your account. If you recently add a new repository and it doesn't show, you may try to refresh the list.{% endtrans %}
    </p>
    <button type="submit" class="btn btn-success">
        {% trans %}Refresh repositories{% endtrans %}
    </button>
</form>
</div>
{% endcall %}