Skip to content

Commit

Permalink
Merge pull request #175 from nautobot/dpb-issue-174
Browse files Browse the repository at this point in the history
Changed extends base.html to extends generic/object_list.html for list templates
  • Loading branch information
smk4664 authored Feb 7, 2023
2 parents b61410a + 03ab9de commit 7054d18
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 62 deletions.
24 changes: 2 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,28 +193,8 @@ $RECYCLE.BIN/
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Jetbrains IDE configs
.idea/

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
Expand Down
1 change: 1 addition & 0 deletions changes/174.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change list views to use generic/object_list.html template.
23 changes: 3 additions & 20 deletions nautobot_chatops/templates/nautobot/access_grant_list.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
{% extends 'base.html' %}
{% load buttons %}
{% load helpers %}
<!-- TODO: Delete file once minimum Nautobot version is 1.5 -->
{% extends 'generic/object_list.html' %}

{% block content %}
<div class="pull-right noprint">
{% if permissions.add %}{% add_button "plugins:nautobot_chatops:accessgrant_add" %}{% endif %}
<!-- TODO: "configure", "import", "export" buttons once functionality is implemented -->
</div>

<h1>{% block title %}Nautobot Access Grants{% endblock %}</h1>

<div class="row">
<div class="col-md-9">
{% include 'utilities/obj_table.html' with bulk_delete_url="plugins:nautobot_chatops:accessgrant_bulk_delete" %}
</div>
<div class="col-md-3 noprint">
{% include 'inc/search_panel.html' %}
</div>
</div>
{% endblock %}
{% block title %}{{ title }}{% endblock %}
23 changes: 3 additions & 20 deletions nautobot_chatops/templates/nautobot/command_token_list.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
{% extends 'base.html' %}
{% load buttons %}
{% load helpers %}
<!-- TODO: Delete file once minimum Nautobot version is 1.5 -->
{% extends 'generic/object_list.html' %}

{% block content %}
<div class="pull-right noprint">
{% if permissions.add %}{% add_button "plugins:nautobot_chatops:commandtoken_add" %}{% endif %}
<!-- TODO: "configure", "import", "export" buttons once functionality is implemented -->
</div>

<h1>{% block title %}Nautobot Command Tokens{% endblock %}</h1>

<div class="row">
<div class="col-md-9">
{% include 'utilities/obj_table.html' with bulk_delete_url="plugins:nautobot_chatops:commandtoken_bulk_delete" %}
</div>
<div class="col-md-3 noprint">
{% include 'inc/search_panel.html' %}
</div>
</div>
{% endblock %}
{% block title %}{{ title }}{% endblock %}
12 changes: 12 additions & 0 deletions nautobot_chatops/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ class AccessGrantListView(PermissionRequiredMixin, ObjectListView):
table = AccessGrantTable
template_name = "nautobot/access_grant_list.html"

def extra_context(self):
"""Add extra context for Access Grant List View."""
return {
"title": "Nautobot Access Grants",
}


class AccessGrantCreateView(PermissionRequiredMixin, ObjectEditView):
"""View for creating a new AccessGrant."""
Expand Down Expand Up @@ -164,6 +170,12 @@ class CommandTokenListView(PermissionRequiredMixin, ObjectListView):
table = CommandTokenTable
template_name = "nautobot/command_token_list.html"

def extra_context(self):
"""Add extra context for Command Token List View."""
return {
"title": "Nautobot Command Tokens",
}


class CommandTokenCreateView(PermissionRequiredMixin, ObjectEditView):
"""View for creating a new CommandToken."""
Expand Down

0 comments on commit 7054d18

Please sign in to comment.