{% extends "webgateway/core_html.html" %}
{% load i18n %}

{% comment %}
<!--
  Copyright (C) 2011-2014 University of Dundee & Open Microscopy Environment.
  All rights reserved.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero 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 Affero General Public License for more details.

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

{% block link %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static "webclient/css/layout.css"|add:url_suffix %}" type="text/css" />
    <link rel="stylesheet" href="{% static "webgateway/css/ome.login.css"|add:url_suffix %}" type="text/css" />
{% endblock %}

{% block title %}
    {% trans "OMERO.web - Forgotten password" %}
{% endblock %}


{% block script %}
    
	{% include "webgateway/base/includes/script_src_jquery.html" %}
	<script src="{% static 'webclient/javascript/jquery.infieldlabel-0.1.js' %}" type="text/javascript"></script>
	
{% endblock %}


{% block head %}
    {{ block.super }}

	<script type="text/javascript" charset="utf-8">
		$(function(){ $("label").inFieldLabels(); });
	</script>
	
{% endblock %}

{% block body %}

<div style="margin: auto">

<div style="margin: 5% auto 0; height: 50px"></div>
<div class="login-logos">
    <div class="custom_logo">
        {% if LOGIN_LOGO %}
            <img src="{{ LOGIN_LOGO }}" />
        {% else %}
            <img src="{% static "webclient/image/custom_login_logo.png" %}" />
        {% endif %}
    </div>
    <img src="{% static "webclient/image/logo_login_web.png" %}" />
</div>

<div id="login">
    <form class="standard_form inlined" action="{% url 'waforgottenpassword' %}" method="post">{% csrf_token %}
        <p>{% trans "To reset your password you require your OMERO username and the email address you have registered with OMERO. Enter these below, click the Submit button and your new password will be sent to this address." %}</p>
        
        {% if error %}
            <span class="error">{{ error }}</span>
        {% endif %}
    
        {% if form %}
        <div id="choose_server">
            {% comment %}
                {% trans form.server.label_tag %}
            {% endcomment %}
            {{ form.server }}
            <!-- Form Error -->
            {% if form.server.errors %}
                 {% for error in form.server.errors %}
                     <span class="form_error">{{ error|escape }}</span>
                 {% endfor %}
        </div>
        {% endif %}

        <div>
            {% trans form.username.label_tag %}
            <!--{% if form.username.field.required %}*{% endif %} -->
            {{ form.username }}
            <!-- Form Error -->
            {% if form.username.errors %}
                 {% for error in form.username.errors %}
                     <span class="form_error">{{ error|escape }}</span>
                 {% endfor %}
            {% endif %}
        </div>

        <div>
            {% trans form.email.label_tag %}
            <!--{% if form.username.field.required %}*{% endif %} -->
            {{ form.email }}
            <!-- Form Error -->
            {% if form.email.errors %}
                 {% for error in form.email.errors %}
                     <span class="form_error">{{ error|escape }}</span>
                 {% endfor %}
            {% endif %}
        </div>
        <center><input type="submit" value="Submit" /></center>
        {% endif %}
    </form>
</div>

<div id="login-footer">
	<p>
		OMERO.web {{ omero_version }}.<br/>
		&copy; 2007-{{ build_year }} University of Dundee &amp; Open Microscopy Environment<br/>
		OMERO is distributed under the terms of the GNU GPL.
		For more information, visit <a href="https://www.openmicroscopy.org">openmicroscopy.org</a><br/>
        <img src="{% static 'webgateway/img/OME_logo_grey_110.png' %}"/>
    </p>
</div>
</div>
{% endblock %}


