Coverage for ivatar/ivataraccount/templates/login.html: 82%

38 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-21 23:06 +0000

1{% extends 'base.html' %} 

2{% load i18n %} 

3  

4{% block title %}{% trans 'Login to yourivatar account' %}{% endblock title %} 

5  

6{% block content %} 

7  

8<h1>{% trans 'Login' %}</h1> 

9  

10{% if form.errors %} 

11 {% for error in form.non_field_errors %} 

12<div class="alert alert-danger" role="alert">{{ error|escape }}</div> 

13 {% endfor %} 

14{% endif %} 

15{% if form.username.errors %} 

16<div class="alert alert-danger" role="alert">{{ form.username.errors }}</div> 

17{% endif %} 

18{% if form.password.errors %} 

19<div class="alert alert-danger" role="alert">{{ form.password.errors }}</div> 

20{% endif %} 

21<div class="form-container"> 

22<form action="{% url 'login' %}" method="post" name="login"> 

23{% csrf_token %} 

24{% if next %}<input type="hidden" name="next" value="{{ next }}">{% endif %} 

25<div class="form-group"> 

26<label for="id_username" class="form-label">{% trans 'Username' %}</label> 

27<input type="text" name="username" autofocus required class="form-control" id="id_username" placeholder="{% trans 'Enter your username' %}"> 

28</div> 

29<div class="form-group"> 

30<label for="id_password" class="form-label">{% trans 'Password' %}</label> 

31<input type="password" name="password" class="form-control" required id="id_password" placeholder="{% trans 'Enter your password' %}"> 

32</div> 

33  

34<div class="button-group"> 

35 <button type="submit" class="btn btn-primary">{% trans 'Login' %}</button> 

36 <a href="{% url 'openid-login' %}" class="btn btn-secondary">{% trans 'Login with OpenID' %}</a> 

37 {% if with_fedora %} 

38 <a href="{% url "social:begin" "fedora" %}" class="btn btn-secondary">{% trans 'Login with Fedora' %}</a> 

39 {% endif %} 

40 <a href="{% url 'new_account' %}" class="btn btn-secondary">{% trans 'Create new user' %}</a> 

41 <a href="{% url 'password_reset' %}" class="btn btn-secondary">{% trans 'Password reset' %}</a> 

42</div> 

43</form> 

44</div> 

45<div style="height:40px"></div> 

46{% endblock content %}