{% extends 'exchange.html.twig' %}
{% block body %}
{% if app.request.hasPreviousSession %}
{% for type, messages in app.session.flashbag.all() %}
{% for message in messages %}
<div class="flash-{{ type }}">
{{ message }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
<div>
{% include 'Exchange/Default/header.html.twig' %}
<div class="login__background">
<div class="login__container">
<div class="login__container--icon">
<span class="login__title">The English Access Scholarship Program Participant Portal</span>
</div>
<form action="" method="post">
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
<div class="formgroup">
<label for="username">Email Address</label>
<input class="form-control" type="text" id="username" name="username" required="required" />
</div>
<div class="formgroup">
<label for="password">Password</label>
<input class="form-control" type="password" id="password" name="password" required="required" />
{% if error %}
<br><div class="error">⚠ {{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
</div>
<input type="hidden" name="bypass" id="bypass" />
<input class="btn btn-success login__btn" type="submit" id="_submit" name="_submit" value="Log In" />
</form>
</div>
</div>
{% include 'Exchange/Default/footer.html.twig' %}
</div>
{% endblock %}
{% block javascripts %}
<script type="application/javascript">
$(document).ready(function(){
//randomly load the background image based on the list
var images = ['exchange-login-background.jpg', 'exchange-login-background-2.jpg'];
$('.login__background').css({'background-image': 'url(/images/exchanges/' + images[Math.floor(Math.random() * images.length)] + ')'});
});
</script>
{% endblock %}