mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 04:42:22 -06:00
* #20048 add get_action_url utility function * #20048 add get_action_url utility function * #20048 add get_action_url utility function * #20048 add get_action_url utility function * #20048 add get_action_url utility function * #20048 action_url template tag * #20048 action_url template tag * #20048 fix test * #20048 review feedback * #20048 fix tags
26 lines
958 B
HTML
26 lines
958 B
HTML
{% load helpers %}
|
|
{% load i18n %}
|
|
|
|
<div class="card">
|
|
<h2 class="card-header">{% trans "Related Objects" %}</h2>
|
|
<ul class="list-group list-group-flush" role="presentation">
|
|
{% for qs, filter_param in related_models %}
|
|
{% action_url qs.model 'list' as list_url %}
|
|
{% if list_url %}
|
|
<a href="{{ list_url }}?{{ filter_param }}={{ object.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between">
|
|
{{ qs.model|meta:"verbose_name_plural"|bettertitle }}
|
|
{% with count=qs.count %}
|
|
{% if count %}
|
|
<span class="badge text-bg-primary rounded-pill">{{ count }}</span>
|
|
{% else %}
|
|
<span class="badge text-bg-light rounded-pill">—</span>
|
|
{% endif %}
|
|
{% endwith %}
|
|
</a>
|
|
{% endif %}
|
|
{% empty %}
|
|
<span class="list-group-item text-muted">{% trans "None" %}</span>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|