Use urlfield

This commit is contained in:
Mouse Reeve
2021-12-15 12:40:31 -08:00
parent 1d6b200172
commit 4f576b77a0
7 changed files with 36 additions and 14 deletions

View File

@ -351,7 +351,10 @@
{% if book.file_links %}
<ul>
{% for link in book.file_links.all %}
<li><a href="{{ link.url }}">{{ link.name }}</a> ({{ link.filetype }})</li>
<li>
<a href="{{ link.url }}" rel="noopener" target="_blank" title="{{ link.url }}">{{ link.name }}</a>
({{ link.filetype }})
</li>
{% endfor %}
</ul>
{% endif %}

View File

@ -19,7 +19,7 @@
<div class="columns">
<div class="column is-four-fifths">
<label class="label" for="id_url">{% trans "URL:" %}</label>
<input type="text" name="url" maxlength="255" class="input" required="" id="id_url" value="{% firstof file_link_form.url.value "" %}" placeholder="https://...">
<input type="url" name="url" maxlength="255" class="input" required="" id="id_url" value="{% firstof file_link_form.url.value "" %}" placeholder="https://...">
</div>
<div class="column is-one-fifth">
<label class="label" for="id_filetype">{% trans "File type:" %}</label>