forked from mirrors/bookwyrm
Fixes id clashes in shelf forms
This commit is contained in:
parent
746d4bdba4
commit
4dc504c058
1 changed files with 6 additions and 3 deletions
|
@ -1,19 +1,21 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load utilities %}
|
||||||
|
{% with 0|uuid as uuid %}
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||||
|
|
||||||
{% if editable %}
|
{% if editable %}
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" for="id_name">{% trans "Name:" %}</label>
|
<label class="label" for="id_name">{% trans "Name:" %}</label>
|
||||||
{{ form.name }}
|
<input type="text" name="name" value="{{ form.name.value|default:'' }}" maxlength="100" class="input" required="" id="id_name">
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="hidden" name="name" required="true" value="{{ shelf.name }}">
|
<input type="hidden" name="name" required="true" value="{{ shelf.name }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" for="id_description">{% trans "Description:" %}</label>
|
<label class="label" for="id_description_{{ uuid }}">{% trans "Description:" %}</label>
|
||||||
{{ form.description }}
|
<textarea name="description" cols="40" rows="5" maxlength="500" class="textarea" id="id_description_{{ uuid }}">{{ form.description.value|default:'' }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="field has-addons">
|
<div class="field has-addons">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
|
@ -23,3 +25,4 @@
|
||||||
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
|
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endwith %}
|
||||||
|
|
Loading…
Reference in a new issue