{% load i18n sekizai_tags cms_tags %}
<form class="cms_toolbar-item cms_form-login" method="post" action="?edit&amp;cms-toolbar-login=1">
	{% csrf_token %}
	<label{% if request.toolbar.login_form.username.errors %} class="cms_error"{% endif %}>{% trans "Username" %} {{ request.toolbar.login_form.username }}</label>
	<label{% if request.toolbar.login_form.password.errors or request.toolbar.login_form.non_field_errors %} class="cms_error"{% endif %}>{% trans "Password" %} {{ request.toolbar.login_form.password }}</label>
	<label><input type="submit" value="Login" /></label>
</form>

{% addtoblock "js" %}
{% if request.toolbar.login_form.errors %}
<script type="text/javascript">
(function($) {
// CMS.$ will be passed for $
$(document).ready(function () {
	CMS.API.Toolbar.showError('{% blocktrans %}<strong>Login failed.</strong> Please check your credentials and try again.{% endblocktrans %}');
});
})(CMS.$);
</script>
{% endif %}
{% endaddtoblock %}