Allow multiple manufacturers per class (#47)

* Allow multiple manufacturers per class

* Fix REST API serializer
This commit is contained in:
2025-01-20 22:51:56 +01:00
committed by GitHub
parent 0413c1c5ab
commit 1a8f2aace8
5 changed files with 54 additions and 7 deletions

View File

@@ -262,9 +262,12 @@
<tr>
<th scope="row">Manufacturer</th>
<td>
{%if class.manufacturer %}
<a href="{% url 'filtered' _filter="manufacturer" search=class.manufacturer.slug %}">{{ class.manufacturer }}</a>{% if class.manufacturer.website %} <a href="{{ class.manufacturer.website }}" target="_blank"><i class="bi bi-box-arrow-up-right"></i></a>{% endif %}
{% else %}-{% endif %}
{% for m in class.manufacturer.all %}
{% if not forloop.first %} / {% endif %}
<a href="{% url 'filtered' _filter="manufacturer" search=m.slug %}">{{ m }}</a>{% if m.website %} <a href="{{ m.website }}" target="_blank"><i class="bi bi-box-arrow-up-right"></i></a>{% endif %}
{% empty %}
-
{% endfor %}
</td>
</tr>
{% if class.description %}