Coverage for ivatar/tools/templates/check.html: 95%
96 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +0000
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +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 fa-lock" title="Secure connection (https)"></i> <i class="fa 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 fa-lock" title="Secure connection (https)"></i> <i class="fa 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 fa-lock" title="Secure connection (http)"></i> <i class="fa 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 style="max-width:640px">
70<form method="post" name="check">
71{% csrf_token %}
72<div class="form-group"><label for="id_mail">{% trans 'E-Mail' %}</label>
73<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"></div>
74<div class="form-group"><label for="id_openid">{% trans 'OpenID' %}</label>
75<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"></div>
76<div class="form-group"><label for="id_size">{% trans 'Size' %}</label>
77<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"></div>
78{% if form.default_url.errors %}
79<div class="alert alert-danger" role="alert">{{ form.default_url.errors }}</div>
80{% endif %}
81<div class="form-group"><label for="id_default_url">{% trans 'Default URL or special keyword' %}</label>
82<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"></div>
83{% if form.default_opt.errors %}
84<div class="alert alert-danger" role="alert">{{ form.default_opt.errors }}</div>
85{% endif %}
87<div class="form-group"><label for="id_default_opt">{% trans 'Default (special keyword)' %}</label>
88 {% for opt in form.default_opt.field.choices %}
89 <div class="radio" {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}>
90 <input type="radio" name="default_opt" value="{{ opt.0 }}"
91 id="default_opt-{{ opt.0 }}"
92 {% if form.default_opt.value == opt.0 %}checked{% endif %}
93 >
94 <label for="default_opt-{{ opt.0 }}">{{ opt.1 }}</label>
95 </div>
96 {% endfor %}
97</div>
99 <div class="form-group">
100 <button type="submit" class="button">{% trans 'Check' %}</button>
101</div>
102</form>
103</div>
105<div style="height:40px"></div>
106{% endblock content %}