Skip to content

Commit

Permalink
* Update for 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Dec 9, 2021
1 parent cdcc6ef commit a0260c8
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 408 deletions.
12 changes: 6 additions & 6 deletions netbox_secretstore/forms/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def validate_rsa_key(key, is_secret=True):
# Secret roles
#

class SecretRoleForm(BootstrapMixin, CustomFieldModelForm):
class SecretRoleForm(CustomFieldModelForm):
slug = SlugField()

class Meta:
Expand All @@ -61,7 +61,7 @@ class Meta:
fields = SecretRole.csv_headers


class SecretRoleBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
class SecretRoleBulkEditForm(CustomFieldModelBulkEditForm):
pk = forms.ModelMultipleChoiceField(
queryset=SecretRole.objects.all(),
widget=forms.MultipleHiddenInput
Expand All @@ -79,7 +79,7 @@ class Meta:
# Secrets
#

class SecretForm(BootstrapMixin, CustomFieldModelForm):
class SecretForm(CustomFieldModelForm):
device = DynamicModelChoiceField(
queryset=Device.objects.all(),
required=False
Expand Down Expand Up @@ -212,7 +212,7 @@ def save(self, *args, **kwargs):
return s


class SecretBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldModelBulkEditForm):
class SecretBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
pk = forms.ModelMultipleChoiceField(
queryset=Secret.objects.all(),
widget=forms.MultipleHiddenInput()
Expand All @@ -232,7 +232,7 @@ class Meta:
]


class SecretFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
class SecretFilterForm(CustomFieldModelFilterForm):
model = Secret
q = forms.CharField(
required=False,
Expand All @@ -250,7 +250,7 @@ class SecretFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
# UserKeys
#

class UserKeyForm(BootstrapMixin, forms.ModelForm):
class UserKeyForm(forms.ModelForm):

class Meta:
model = UserKey
Expand Down

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions netbox_secretstore/templates/netbox_secretstore/secret.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'netbox_secretstore/generic/object.html' %}
{% extends 'netbox_plugin_extensions/generic/object.html' %}
{% load buttons %}
{% load helpers %}
{% load static %}
Expand Down Expand Up @@ -39,7 +39,7 @@ <h5 class="card-header">
</table>
</div>
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'inc/panels/custom_fields.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
Expand Down Expand Up @@ -68,7 +68,7 @@ <h5 class="card-header">
</div>
</div>
</div>
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='plugins:netbox_secretstore:secret_list' %}
{% include 'inc/panels/tags.html' with tags=object.tags.all url='plugins:netbox_secretstore:secret_list' %}
{% plugin_right_page object %}
</div>
</div>
Expand Down
96 changes: 48 additions & 48 deletions netbox_secretstore/templates/netbox_secretstore/secretrole.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'netbox_secretstore/generic/object.html' %}
{% extends 'netbox_plugin_extensions/generic/object.html' %}
{% load helpers %}
{% load plugins %}

Expand All @@ -8,57 +8,57 @@
{% endblock %}

{% block content %}
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Secret Role
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Secrets</th>
<td>
<a href="{% url 'plugins:netbox_secretstore:secret_list' %}?role_id={{ object.pk }}">{{ secrets_table.rows|length }}</a>
</td>
</tr>
</table>
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Secret Role
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Secrets</th>
<td>
<a href="{% url 'plugins:netbox_secretstore:secret_list' %}?role_id={{ object.pk }}">{{ secrets_table.rows|length }}</a>
</td>
</tr>
</table>
</div>
</div>
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
{% include 'inc/panels/custom_fields.html' %}
{% plugin_right_page object %}
</div>
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">
Secrets
</h5>
<div class="card-body">
{% include 'inc/table.html' with table=secrets_table %}
</div>
{% if perms.netbox_secretstore.add_secret %}
<div class="card-footer text-end noprint">
<a href="{% url 'plugins:netbox_secretstore:secret_add' %}?role={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Secret
</a>
<div class="row">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">
Secrets
</h5>
<div class="card-body">
{% include 'inc/table.html' with table=secrets_table %}
</div>
{% endif %}
{% if perms.netbox_secretstore.add_secret %}
<div class="card-footer text-end noprint">
<a href="{% url 'plugins:netbox_secretstore:secret_add' %}?role={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Secret
</a>
</div>
{% endif %}
</div>
{% include 'inc/paginator.html' with paginator=secrets_table.paginator page=secrets_table.page %}
{% plugin_full_width_page object %}
</div>
{% include 'inc/paginator.html' with paginator=secrets_table.paginator page=secrets_table.page %}
{% plugin_full_width_page object %}
</div>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'users/base.html' %}
{% extends 'base/layout.html' %}

{% block title %}User Key{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{% extends 'users/base.html' %}
{% extends 'netbox_plugin_extensions/generic/object_edit.html' %}
{% load form_helpers %}
{% load plugins %}
{% load static %}

{% block title %}User Key{% endblock %}

{% block content %}
{% if object.is_active %}
<div class="alert alert-danger" role="alert">
Expand Down
Empty file.
Loading

0 comments on commit a0260c8

Please sign in to comment.