Coverage for ivatar/tools/templates/check.html: 97%
97 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-17 12:52 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-17 12:52 +0000
1{% extends 'base.html' %}
2{% load i18n %}
3{% load static %}
5{% block title %}{% trans 'Check e-mail or openid' %}{% endblock title %}
7{% block content %}
9{% if mailurl or openidurl %}
10 <h2>This is what the avatars will look like depending on the hash and protocol you use:</h2>
11 <p>
12 {% if mail_hash %}
13 MD5 hash (mail): {{ mail_hash }}<br/>
14 SHA256 hash (mail): {{ mail_hash256 }}<br/>
15 {% endif %}
17 {% if openid_hash %}
18 SHA256 hash (OpenID): {{ openid_hash }}<br/>
19 {% endif %}
20 </p>
22 <div class="row">
23 {% if mailurl %}
24<div class="panel panel-tortin" style="min-width:132px;width:calc({{ size }}px + 33px);float:left;margin-left:20px">
25 <div class="panel-heading">
26 <h3 class="panel-title">MD5 <i class="fa-solid fa-lock" title="Secure connection (https)"></i> <i class="fa-solid fa-at" title="mail: {{ form.mail.value }}"></i></h3>
27 </div>
28 <div class="panel-body">
29 <a href="{{ mailurl_secure }}">
30 <center><img src="{{ mailurl_secure }}" style="max-width: {{ size }}px; max-height: {{ size }}px;"></center>
31 </a>
32</div>
33</div>
34<div class="panel panel-tortin" style="min-width:132px;width:calc({{ size }}px + 33px);float:left;margin-left:20px">
35 <div class="panel-heading">
36 <h3 class="panel-title">SHA256 <i class="fa-solid fa-lock" title="Secure connection (https)"></i> <i class="fa-solid fa-at" title="mail: {{ form.mail.value }}"></i></h3>
37 </div>
38 <div class="panel-body">
39 <a href="{{ mailurl_secure_256 }}">
40 <center><img src="{{ mailurl_secure_256 }}" style="max-width: {{ size }}px; max-height: {{ size }}px;"></center>
41 </a>
42</div>
43</div>
44 {% endif %}
46 {% if openidurl %}
47<div class="panel panel-tortin" style="min-width:132px;width:calc({{ size }}px + 33px);float:left;margin-left:20px">
48 <div class="panel-heading">
49 <h3 class="panel-title">SHA256 <i class="fa-solid fa-lock" title="Secure connection (http)"></i> <i class="fa-solid fa-openid" title="openid: {{ form.openid.value }}"></i></h3>
50 </div>
51 <div class="panel-body">
52 <a href="{{ openidurl_secure }}">
53 <center><img src="{{ openidurl_secure }}" style="max-width: {{ size }}px; max-height: {{ size }}px;"></center>
54 </a>
55</div>
56</div>
57 {% endif %}
58 </div>
59{% endif %}
61<h1>{% trans 'Check e-mail or openid' %}</h1>
63{% if form.errors %}
64 {% for error in form.non_field_errors %}
65 <div class="alert alert-danger" role="alert">{{ error|escape }}</div>
66 {% endfor %}
67{% endif %}
69<div class="form-container">
70<form method="post" name="check">
71{% csrf_token %}
72<div class="form-group">
73 <label for="id_mail" class="form-label">{% trans 'E-Mail' %}</label>
74 <input type="email" name="mail" maxlength="254" minlength="6" class="form-control" placeholder="{% trans 'E-Mail' %}" {% if form.mail.value %} value="{{ form.mail.value }}" {% endif %} id="id_mail">
75</div>
76<div class="form-group">
77 <label for="id_openid" class="form-label">{% trans 'OpenID' %}</label>
78 <input type="text" name="openid" maxlength="255" minlength="11" class="form-control" placeholder="{% trans 'OpenID' %}" {% if form.openid.value %} value="{{ form.openid.value }}" {% endif %} id="id_openid">
79</div>
80<div class="form-group">
81 <label for="id_size" class="form-label">{% trans 'Size' %}</label>
82 <input type="number" name="size" min="5" max="512" class="form-control" placeholder="{% trans 'Size' %}" {% if form.size.value %} value="{{ form.size.value }}" {% else %} value="100" {% endif %} required id="id_size">
83</div>
84<div class="form-group">
85 <label for="id_default_url" class="form-label">{% trans 'Default URL or special keyword' %}</label>
86 <input type="text" name="default_url" class="form-control" placeholder="{% trans 'Default' %}" {% if form.default_url.value %} value="{{ form.default_url.value }}" {% endif %} id="id_default_url">
87</div>
88<div class="form-group">
89 <label class="form-label">{% trans 'Default (special keyword)' %}</label>
90 {% for opt in form.default_opt.field.choices %}
91 <div class="form-check">
92 <input type="radio" name="default_opt" value="{{ opt.0 }}" class="form-check-input" id="default_opt-{{ opt.0 }}" {% if form.default_opt.value == opt.0 %}checked{% endif %}>
93 <label for="default_opt-{{ opt.0 }}" class="form-check-label">{{ opt.1 }}</label>
94 </div>
95 {% endfor %}
96</div>
98<div class="button-group">
99 <button type="submit" class="btn btn-primary">{% trans 'Check' %}</button>
100</div>
101</form>
102</div>
104<div style="height:40px"></div>
105{% endblock content %}