From 69b7fb723d547103f7fc5e6edebbd5995a4d903e Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 13 Jun 2023 17:02:47 -0700 Subject: [PATCH] 12591 edit button --- netbox/extras/urls.py | 5 ++-- netbox/netbox/navigation/menu.py | 2 +- netbox/templates/extras/configrevision.html | 27 ++++++++++++++++++++- netbox/templates/generic/object.html | 4 +-- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/netbox/extras/urls.py b/netbox/extras/urls.py index 13f8fdf28..0b4ac1e3c 100644 --- a/netbox/extras/urls.py +++ b/netbox/extras/urls.py @@ -117,6 +117,7 @@ urlpatterns = [ path('render/markdown/', views.RenderMarkdownView.as_view(), name="render_markdown"), # Config Revision - path('config-revision/', views.ConfigRevisionView.as_view(), name='config_revision'), - path('config-revision/add/', views.ConfigRevisionEditView.as_view(), name='config_revision_add'), + path('config-revision/', views.ConfigRevisionView.as_view(), name='configrevision'), + path('config-revision/add/', views.ConfigRevisionEditView.as_view(), name='configrevision_add'), + path('config-revision//edit/', views.ConfigRevisionEditView.as_view(), name='configrevision_edit'), ] diff --git a/netbox/netbox/navigation/menu.py b/netbox/netbox/navigation/menu.py index 21fdb74cf..b227a3c55 100644 --- a/netbox/netbox/navigation/menu.py +++ b/netbox/netbox/navigation/menu.py @@ -352,7 +352,7 @@ ADMIN_MENU = Menu( label=_('Configuration'), items=( MenuItem( - link='extras:config_revision', + link='extras:configrevision', link_text=_('Config Revision'), permissions=['extras.config_revision'] ), diff --git a/netbox/templates/extras/configrevision.html b/netbox/templates/extras/configrevision.html index 9e688a6fa..0fabf39c9 100644 --- a/netbox/templates/extras/configrevision.html +++ b/netbox/templates/extras/configrevision.html @@ -1,10 +1,35 @@ {% extends 'generic/object.html' %} +{% load buttons %} +{% load custom_links %} {% load helpers %} +{% load perms %} +{% load plugins %} {% load static %} -{% block header %} +{% block breadcrumbs %} {% endblock %} +{% block controls %} + {# Clone/Edit/Delete Buttons #} +
+
+ {% plugin_buttons object %} + + {# Extra buttons #} + {% block extra_controls %}{% endblock %} + + {% if request.user|can_change:object %} + {% edit_button object %} + {% endif %} + +
+
+ {% custom_links object %} +
+
+{% endblock controls %} + + {% block tabs %} {% endblock %} diff --git a/netbox/templates/generic/object.html b/netbox/templates/generic/object.html index d3a617455..ebbeb2dfc 100644 --- a/netbox/templates/generic/object.html +++ b/netbox/templates/generic/object.html @@ -38,7 +38,7 @@ Context: {{ block.super }} -{% endblock %} +{% endblock header %} {% block title %}{{ object }}{% endblock %} @@ -48,7 +48,7 @@ Context: · Updated {{ object.last_updated|timesince }} ago -{% endblock %} +{% endblock subtitle %} {% block controls %} {# Clone/Edit/Delete Buttons #}