List works on project page

This commit is contained in:
Tris Forster 2023-03-02 13:28:24 +11:00
parent 6edc612ed6
commit 2a6554471d

View File

@ -1,12 +1,12 @@
{% with project.items.count as items %}
{% if items %}
<p>
There {{ items|pluralize:"is,are" }} currently {{ items}} item{{ items|pluralize }} for this project.<br/>
Click the '<a href="{% url 'item_list' project=project.pk %}">My Music</a>' button below to access your parts...
</p>
{% else %}
<p>
There are no items listed yet for this project - please check back later...
</p>
{% endif %}
{% endwith %}
<h4 class="is-size-4">Items</h4>
<ul>
{% for item in project.items.all %}
{% with work=item.work %}
<li>
<a href="{% url 'work_detail' item.work.collection.pk item.work.pk %}">{{ item.work.name }}</a>
</li>
{% endwith %}
{% empty %}
<li>There are no items listed yet for this project - please check back later...</li>
{% endfor %}
</ul>