From 1f7da36e450c50936b6ba80e6bb70a8304b79f5a Mon Sep 17 00:00:00 2001 From: Ryan Merolle Date: Sun, 10 Jul 2022 09:59:54 -0400 Subject: [PATCH] Feature 16 (#24) * consolidate ACL UI view * remove ACL Rule navigation link --- netbox_access_lists/navigation.py | 11 ++- .../netbox_access_lists/accesslist.html | 37 ++++++++ .../netbox_access_lists/routingpolicy.html | 94 +++++++++++++++++++ 3 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 netbox_access_lists/templates/netbox_access_lists/routingpolicy.html diff --git a/netbox_access_lists/navigation.py b/netbox_access_lists/navigation.py index b0f7db5..5fbe6ec 100644 --- a/netbox_access_lists/navigation.py +++ b/netbox_access_lists/navigation.py @@ -26,9 +26,10 @@ menu_items = ( link_text='Access Lists', buttons=accesslist_buttons ), - PluginMenuItem( - link='plugins:netbox_access_lists:accesslistrule_list', - link_text='Access List Rules', - buttons=accesslistrule_butons - ), + # # Comment out Access List Rule to force creation in the ACL view + # PluginMenuItem( + # link='plugins:netbox_access_lists:accesslistrule_list', + # link_text='Access List Rules', + # buttons=accesslistrule_butons + # ), ) diff --git a/netbox_access_lists/templates/netbox_access_lists/accesslist.html b/netbox_access_lists/templates/netbox_access_lists/accesslist.html index c903a34..e7c75f9 100644 --- a/netbox_access_lists/templates/netbox_access_lists/accesslist.html +++ b/netbox_access_lists/templates/netbox_access_lists/accesslist.html @@ -1,6 +1,43 @@ {% extends 'generic/object.html' %} {% load render_table from django_tables2 %} +{% block breadcrumbs %} + +{% endblock %} +{% block controls %} +
+ {% if perms.netbox_access_lists.change_policy %} + + Rule + + {% endif %} + {% if perms.netbox_access_lists.change_policy %} + + Edit + + {% endif %} + {% if perms.netbox_access_lists.delete_policy %} + + Delete + + {% endif %} +
+{% endblock controls %} +{% block tabs %} + +{% endblock tabs %} + {% block content %}
diff --git a/netbox_access_lists/templates/netbox_access_lists/routingpolicy.html b/netbox_access_lists/templates/netbox_access_lists/routingpolicy.html new file mode 100644 index 0000000..00ec953 --- /dev/null +++ b/netbox_access_lists/templates/netbox_access_lists/routingpolicy.html @@ -0,0 +1,94 @@ +{% extends 'generic/object.html' %} +{% load buttons %} +{% load custom_links %} +{% load helpers %} +{% load plugins %} +{% load render_table from django_tables2 %} + +{% block breadcrumbs %} + +{% endblock %} +{% block controls %} +
+ {% if perms.netbox_bgp.change_policy %} + + Rule + + {% endif %} + {% if perms.netbox_bgp.change_policy %} + + Edit + + {% endif %} + {% if perms.netbox_bgp.delete_policy %} + + Delete + + {% endif %} +
+{% endblock controls %} +{% block tabs %} + +{% endblock tabs %} + +{% block content %} +
+
+
+
+ Routing Policy +
+
+ + + + + + + + + +
name{{ object.name }}
Description{{ object.description|placeholder }}
+
+
+ {% include 'inc/panels/custom_fields.html' %} + {% include 'inc/panels/tags.html' %} + {% plugin_left_page object %} +
+
+
+
+ Related BGP Sessions +
+
+ {% render_table related_session_table 'inc/table.html' %} +
+ {% plugin_right_page object %} +
+
+
+
+
+
+
+ Rules +
+
+ {% render_table rules_table 'inc/table.html' %} +
+ {% plugin_full_width_page object %} +
+
+
+{% endblock %} \ No newline at end of file