diff --git a/netbox_custom_objects/models.py b/netbox_custom_objects/models.py index 14b4600..e0d17ab 100644 --- a/netbox_custom_objects/models.py +++ b/netbox_custom_objects/models.py @@ -115,6 +115,12 @@ def get_absolute_url(self): }, ) + def get_list_url(self): + return reverse( + "plugins:netbox_custom_objects:customobject_list", + kwargs={"custom_object_type": self.custom_object_type.name.lower()}, + ) + class CustomObjectType(NetBoxModel): # Class-level cache for generated models diff --git a/netbox_custom_objects/templates/netbox_custom_objects/customobject.html b/netbox_custom_objects/templates/netbox_custom_objects/customobject.html index 8e9b0fe..bf7a9f4 100644 --- a/netbox_custom_objects/templates/netbox_custom_objects/customobject.html +++ b/netbox_custom_objects/templates/netbox_custom_objects/customobject.html @@ -13,55 +13,59 @@ {% block extra_controls %} {% endblock %} -{% block page-header %} -
-
+{% block breadcrumbs %} + + +{% endblock breadcrumbs %} - {# Title #} -
-

{% block title %}{{ object }}{% endblock title %}

- {% block subtitle %}{% endblock %} -
+{% block object_identifier %} +{{ object|meta:"app_label" }}.{{ object.custom_object_type.name }}:{{ object.pk }} +{% if object.slug %}({{ object.slug }}){% endif %} +{% endblock object_identifier %} - {# Controls #} -
- {% block controls %} -
- {% block control-buttons %} - {# Default buttons #} - {% if perms.extras.add_bookmark and object.bookmarks %} - {% custom_object_bookmark_button object %} - {% endif %} - {% if perms.extras.add_subscription and object.subscriptions %} - {% custom_object_subscribe_button object %} - {% endif %} - {% if request.user|can_add:object %} - {% custom_object_clone_button object %} - {% endif %} - {% if request.user|can_change:object %} - {% custom_object_edit_button object %} - {% endif %} - {% if request.user|can_delete:object %} - {% custom_object_delete_button object %} - {% endif %} - {% endblock %} -
+{% block title %}{{ object }}{% endblock title %} - {# Custom links #} -
-
- {% block custom-links %} - {% custom_links object %} - {% endblock custom-links %} -
-
- - {% endblock controls %} -
+{% block subtitle %} +
+ {% trans "Created" %} {{ object.created|isodatetime:"minutes" }} + {% if object.last_updated %} + · + {% trans "Updated" %} {{ object.last_updated|isodatetime:"minutes" }} + {% endif %} +
+{% endblock subtitle %} +{% block controls %} +
+ {% block control-buttons %} + {# Default buttons #} + {% if perms.extras.add_bookmark and object.bookmarks %} + {% custom_object_bookmark_button object %} + {% endif %} + {% if perms.extras.add_subscription and object.subscriptions %} + {% custom_object_subscribe_button object %} + {% endif %} + {% if request.user|can_add:object %} + {% custom_object_clone_button object %} + {% endif %} + {% if request.user|can_change:object %} + {% custom_object_edit_button object %} + {% endif %} + {% if request.user|can_delete:object %} + {% custom_object_delete_button object %} + {% endif %} + {% endblock %}
-
-{% endblock %} + + {# Custom links #} +
+
+ {% block custom-links %} + {% custom_links object %} + {% endblock custom-links %} +
+
+{% endblock controls %} {% block tabs %}