mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 06:13:36 -06:00
20190 review feedback
This commit is contained in:
parent
26fb733b3a
commit
109c85f764
@ -5,20 +5,19 @@
|
||||
<h2 class="card-header">{% trans "Related Objects" %}</h2>
|
||||
<ul class="list-group list-group-flush" role="presentation">
|
||||
{% for related_object_count in related_models %}
|
||||
{% with viewname=related_object_count.queryset.model|validated_viewname:"list" %}
|
||||
{% if viewname is not None %}
|
||||
<a href="{% url viewname %}?{{ related_object_count.filter_param }}={{ object.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between">
|
||||
{{ related_object_count.name }}
|
||||
{% with count=related_object_count.queryset.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 %}
|
||||
{% endwith %}
|
||||
{% action_url qs.model 'list' as list_url %}
|
||||
{% if list_url %}
|
||||
<a href="{{ list_url }}?{{ related_object_count.filter_param }}={{ object.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between">
|
||||
{{ related_object_count.name }}
|
||||
{% with count=related_object_count.queryset.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 %}
|
||||
|
@ -164,7 +164,7 @@ def sync_button(instance):
|
||||
|
||||
# TODO: Remove in NetBox v4.7
|
||||
@register.inclusion_tag('buttons/add.html')
|
||||
def add_button(model, return_url=None, action='add'):
|
||||
def add_button(model, action='add', return_url=None):
|
||||
try:
|
||||
url = get_action_url(model, action=action)
|
||||
except NoReverseMatch:
|
||||
|
Loading…
Reference in New Issue
Block a user