Enhance the check possibilities

This commit is contained in:
Oliver Falk
2019-02-28 13:27:22 +01:00
parent 7e9a57cfad
commit c5c3bd8f1b
3 changed files with 16 additions and 4 deletions

View File

@@ -56,8 +56,10 @@ class CheckForm(forms.Form):
required=True,
)
default_url = forms.URLField(
default_url = forms.CharField(
label=_('Default URL'),
min_length=1,
max_length=MAX_LENGTH_URL,
required=False,
)

View File

@@ -8,6 +8,12 @@
<h1>{% trans 'Check e-mail or openid' %}</h1>
{% if form.errors %}
<p class="error">{% trans "Please correct errors below:" %}<br>
{{ form.errors|join:', ' }}
</p>
{% endif %}
<div style="max-width:640px">
<form method="post" name="check">
{% csrf_token %}
@@ -17,8 +23,8 @@
<input type="text" name="openid" maxlength="255" minlength="11" class="form-control" placeholder="{% trans 'OpenID' %}" {% if openidurl %} value="{{ form.openid.value }}" {% endif %} id="id_openid"></div>
<div class="form-group"><label for="id_size">{% trans 'Size' %}</label>
<input type="number" name="size" min="5" max="512" class="form-control" placeholder="{% trans 'Size' %}" {% if mailurl or openidurl %} value="{{ form.size.value }}" {% else %} value="100" {% endif %} required id="id_size"></div>
<div class="form-group"><label for="id_default_url">{% trans 'Default URL' %}</label>
<input type="url" name="default_url" class="form-control" placeholder="{% trans 'Default URL' %}" {% if mailurl or openidurl %} value="{{ form.default_url.value }}" {% endif %} id="id_default_url"></div>
<div class="form-group"><label for="id_default_url">{% trans 'Default URL or special keyword' %}</label>
<input type="text" name="default_url" class="form-control" placeholder="{% trans 'Default' %}" {% if mailurl or openidurl %} value="{{ form.default_url.value }}" {% endif %} id="id_default_url"></div>
<div class="form-group">
<button type="submit" class="btn btn-default">{% trans 'Check' %}</button>
</div>

View File

@@ -45,8 +45,12 @@
</a>
<ul class="dropdown-menu" aria-labelledby="tools_dropdown">
<li><a id="tools-check" href="{% url 'tools_check' %}">
<i class="fa fa-fw fa-check-square" aria-hidden="true"></i> {% trans 'Check' %}
<i class="fa fa-fw fa-check-square" aria-hidden="true"></i> {% trans 'Check ID' %}
</a></li>
<li><a id="tools-check-domain" href="{% url 'tools_check_domain' %}">
<i class="fa fa-fw fa-check-square" aria-hidden="true"></i> {% trans 'Check Domain' %}
</a></li>
</ul>
</li>
</ul>