Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/ipmanager/ui/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
from django.urls import path

from django.urls import path, reverse
from . import views
from .views import (CreateGroupView, CreateIPRangeView, CreateRelationView, DeleteGroupView,
DeleteIPRangeView, DeleteRelationView, EditGroupView, GroupListView, RootView,
SingleGroupView, CreateNoteView, DeleteNoteView)

def get_navigation_links(request):
return [
{'label': 'Home', 'url': reverse('index')},
{'label': 'Groups', 'url': reverse('list_all_groups')},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right idea, but it should be added to the existing get_navigation_links function in the src/ipmanager/urls.py file as a key/value pair where the key is the view name and the value is the label:

{
    'list_all_groups': 'Groups',
    # existing link info...
}

]

urlpatterns = [
path('groups', GroupListView.as_view(), name='list_all_groups'),

path('groups/create',
CreateGroupView.as_view(), name='create_group'),
path('groups/<str:key>',
Expand Down Expand Up @@ -43,4 +50,6 @@
DeleteIPRangeView.as_view(),
name='delete_ip_range',
),
]
path('', RootView.as_view(), name='ipmanager_root'),

]