mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-25 09:22:21 +00:00
Partialize alllllll the things
Split each form section into its own partial which handles both the form and display view of that section.
This commit is contained in:
41
assets/templates/partials/parent_form.html
Normal file
41
assets/templates/partials/parent_form.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{% load widget_tweaks %}
|
||||
{% load asset_templatetags %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Collection Details
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% if edit or duplicate %}
|
||||
<div class="form-group">
|
||||
<label for="selectpicker">Set Parent</label>
|
||||
{% include 'partials/asset_picker.html' %}
|
||||
</div>
|
||||
{% else %}
|
||||
<dl>
|
||||
<dt>Parent</dt>
|
||||
<dd>
|
||||
{% if object.parent %}
|
||||
<a href="{% url 'asset_detail' object.parent.pk %}">
|
||||
{{ object.parent.asset_id }} - {{ object.parent.description }}
|
||||
</a>
|
||||
{% else %}
|
||||
<span>-</span>
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt>Children</dt>
|
||||
{% if object.asset_parent.all %}
|
||||
{% for child in object.asset_parent.all %}
|
||||
<dd>
|
||||
<a href="{% url 'asset_detail' child.pk %}">
|
||||
{{ child.asset_id }} - {{ child.description }}
|
||||
</a>
|
||||
</dd>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<dd><span>-</span></dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
{% endif%}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user