{% for inv in invoices__ %}
<div class="row">
<div class="col-md-12">
<div class="accordion" id="accordionExample">
<div class="card">
<div class="card-header" id="{{inv.headingId}}">
<div class="row headerContiner">
<div class="col-md-10">
<h5 data-toggle="collapse" data-target="{{inv.collapseTarget}}">{{inv.ttl}}</h5>
</div>
<div class="col-md-2">
<a href="{% url 'invoice_update' inv.id__ %}" class="btn text-secondary px-0">
<i class="fa fa-edit fa-lg"></i></a>
<a href="{% url 'invoice_delete' inv.id__ %}" class="btn text-secondary px-0">
<i class="far fa-trash-alt fa-lg text-danger float-right"></i></a>
<a href="{% url 'invoice_details' inv.id__ %}" class="btn text-secondary px-0">
<i class="fas fa-file-invoice"></i></a>
<a href="{% url 'invoice_status' inv.id__ %}" class="btn text-secondary px-0">
<i class="fas fa-tasks"></i></a>
</div>
</div>
</div>
<div id="{{inv.collapseId}}" class="collapse" aria-labelledby="{{inv.headingId}}" data-parent="#accordionExample">
<div class="card-body">
<div class="row">
{% for stg in inv.stages %}
<div class="col-md-3 stags">
<h6 class="stepHeading">Step {{stg.counter__}}: {{stg.title}}</h6>
<p>HTML stands for HyperText Markup Language. HTML is the standard markup language for describing the structure of web pages. <a href="https://www.tutorialrepublic.com/html-tutorial/" target="_blank">Learn more.</a></p>
{% if stg.isCreated %}
<a href="{% url stg.editLink inv.id__ %}" class="btn text-secondary px-0">
<i class="fa fa-edit fa-lg"></i>
</a>
<a href="{% url stg.deleteLink inv.id__ %}" class="btn text-secondary px-0">
<i class="far fa-trash-alt fa-lg text-danger float-right"></i>
</a>
<a href="{% url stg.previewLink inv.id__ %}" class="btn text-secondary px-0">
<i class="fas fa-file-invoice"></i>
</a>
{% else %}
<a href="{% url stg.addLink %}" class="btn text-secondary px-0">
<i class="fas fa-plus"></i></a>
</a>
{%endif%}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
I am attempting to create an accordion where only the currently clicked card is displayed, collapsing others. However, when I click on one card, they all expand at once.
The code functions flawlessly aside from this issue with clicking. Any assistance would be greatly appreciated, thank you in advance.
I am generating classes and IDs dynamically from a Django view and passing them as part of the context to the template.
No jQuery or JavaScript events have been added to it.