Просмотр исходного кода

Closes #6955: Include type, ID, and slug on object view

jeremystretch 4 лет назад
Родитель
Сommit
69aaf28b9c
2 измененных файлов с 7 добавлено и 0 удалено
  1. 1 0
      docs/release-notes/version-3.0.md
  2. 6 0
      netbox/templates/generic/object.html

+ 1 - 0
docs/release-notes/version-3.0.md

@@ -5,6 +5,7 @@
 ### Enhancements
 
 * [#6850](https://github.com/netbox-community/netbox/issues/6850) - Default to current user when creating journal entries via REST API
+* [#6955](https://github.com/netbox-community/netbox/issues/6955) - Include type, ID, and slug on object view
 * [#7462](https://github.com/netbox-community/netbox/issues/7462) - Include count of assigned virtual machines under platform view
 
 ### Bug Fixes

+ 6 - 0
netbox/templates/generic/object.html

@@ -8,6 +8,12 @@
 {% block header %}
   {# Breadcrumbs #}
   <nav class="breadcrumb-container px-3" aria-label="breadcrumb">
+    <div class="float-end">
+      <code class="text-muted" title="Object type and ID">
+        {{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }}
+        {% if object.slug %}({{ object.slug }}){% endif %}
+      </code>
+    </div>
     <ol class="breadcrumb">
       {% block breadcrumbs %}
         <li class="breadcrumb-item"><a href="{% url object|viewname:'list' %}">{{ object|meta:'verbose_name_plural'|bettertitle }}</a></li>