36 lines
1.0 KiB
HTML
36 lines
1.0 KiB
HTML
{% load i18n %}
|
|
<div {% if not source_pk %}class="inactive"{% endif %}>
|
|
{% if source_pk %}
|
|
<form>
|
|
{% if associations|length %}
|
|
<ul class="formdatas">
|
|
{% for association in associations %}
|
|
<li>
|
|
{% if association.formdata_id %}
|
|
<a href="{{association.formdata_url}}" target="_blank">
|
|
{{association.formdef_name}}
|
|
</a>
|
|
{% else %}
|
|
<a href="#"
|
|
class="create-formdata"
|
|
data-action-url="{% url 'ajax-create-formdata' pk=association.id %}"
|
|
data-association-pk="{{association.id}}">{{association.formdef_name}}</a>
|
|
<a class="remove" href="{% url 'ajax-remove-association' pk=association.id %}">✖</a>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
<li><a href="#" class="plus">{% trans 'Add another' %}</a></li>
|
|
</ul>
|
|
{% endif %}
|
|
|
|
<div class="add-formdef-reference" {% if associations|length %}style="display: none"{% endif %}>
|
|
<div>
|
|
{{form.formdef_reference}}
|
|
</div>
|
|
<button class="add">{% trans 'Add' %}</button>
|
|
</div>
|
|
|
|
</form>
|
|
{% endif %}
|
|
</div>
|