Closes #2809: Remove VRF child prefixes table; link to main prefixes view

This commit is contained in:
Jeremy Stretch 2019-01-31 10:06:08 -05:00
parent b508415983
commit ae0c8deec2
3 changed files with 14 additions and 13 deletions

View File

@ -1,5 +1,9 @@
v2.5.5 (FUTURE) v2.5.5 (FUTURE)
## Enhancements
* [#2809](https://github.com/digitalocean/netbox/issues/2809) - Remove VRF child prefixes table; link to main prefixes view
## Bug Fixes ## Bug Fixes
* [#2824](https://github.com/digitalocean/netbox/issues/2824) - Fix template exception when viewing rack elevations list * [#2824](https://github.com/digitalocean/netbox/issues/2824) - Fix template exception when viewing rack elevations list

View File

@ -126,14 +126,11 @@ class VRFView(View):
def get(self, request, pk): def get(self, request, pk):
vrf = get_object_or_404(VRF.objects.all(), pk=pk) vrf = get_object_or_404(VRF.objects.all(), pk=pk)
prefix_table = tables.PrefixTable( prefix_count = Prefix.objects.filter(vrf=vrf).count()
list(Prefix.objects.filter(vrf=vrf).select_related('site', 'role')), orderable=False
)
prefix_table.exclude = ('vrf',)
return render(request, 'ipam/vrf.html', { return render(request, 'ipam/vrf.html', {
'vrf': vrf, 'vrf': vrf,
'prefix_table': prefix_table, 'prefix_count': prefix_count,
}) })

View File

@ -83,19 +83,19 @@
<tr> <tr>
<td>Description</td> <td>Description</td>
<td>{{ vrf.description|placeholder }}</td> <td>{{ vrf.description|placeholder }}</td>
</tr>
<tr>
<td>Prefixes</td>
<td>
<a href="{% url 'ipam:prefix_list' %}?vrf={{ vrf.rd }}">{{ prefix_count }}</a>
</td>
</tr> </tr>
</table> </table>
</div> </div>
{% include 'inc/custom_fields_panel.html' with obj=vrf %}
{% include 'extras/inc/tags_panel.html' with tags=vrf.tags.all url='ipam:vrf_list' %} {% include 'extras/inc/tags_panel.html' with tags=vrf.tags.all url='ipam:vrf_list' %}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="panel panel-default"> {% include 'inc/custom_fields_panel.html' with obj=vrf %}
<div class="panel-heading"> </div>
<strong>Prefixes</strong>
</div>
{% include 'responsive_table.html' with table=prefix_table %}
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}