diff --git a/netbox_secretstore/forms/secrets.py b/netbox_secretstore/forms/secrets.py index e473db5..66416c0 100644 --- a/netbox_secretstore/forms/secrets.py +++ b/netbox_secretstore/forms/secrets.py @@ -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: @@ -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 @@ -79,7 +79,7 @@ class Meta: # Secrets # -class SecretForm(BootstrapMixin, CustomFieldModelForm): +class SecretForm(CustomFieldModelForm): device = DynamicModelChoiceField( queryset=Device.objects.all(), required=False @@ -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() @@ -232,7 +232,7 @@ class Meta: ] -class SecretFilterForm(BootstrapMixin, CustomFieldModelFilterForm): +class SecretFilterForm(CustomFieldModelFilterForm): model = Secret q = forms.CharField( required=False, @@ -250,7 +250,7 @@ class SecretFilterForm(BootstrapMixin, CustomFieldModelFilterForm): # UserKeys # -class UserKeyForm(BootstrapMixin, forms.ModelForm): +class UserKeyForm(forms.ModelForm): class Meta: model = UserKey diff --git a/netbox_secretstore/templates/netbox_secretstore/generic/object.html b/netbox_secretstore/templates/netbox_secretstore/generic/object.html deleted file mode 100644 index 8ea7b94..0000000 --- a/netbox_secretstore/templates/netbox_secretstore/generic/object.html +++ /dev/null @@ -1,82 +0,0 @@ -{% extends 'base/layout.html' %} -{% load buttons %} -{% load custom_links %} -{% load helpers %} -{% load perms %} -{% load plugins %} -{% load plugin_buttons %} -{% load static %} - -{% block header %} - {# Breadcrumbs #} - - {{ block.super }} -{% endblock %} - -{% block title %}{{ object }}{% endblock %} - -{% block controls %} - {# Clone/Edit/Delete Buttons #} -
-
- {% custom_links object %} - {% plugin_buttons object %} - - {# Extra buttons #} - {% block extra_controls %}{% endblock %} - - {% if request.user|can_add:object %} - {% clone_button object %} - {% endif %} - {% if request.user|can_change:object %} - {% edit_button object %} - {% endif %} - {% if request.user|can_delete:object %} - {% delete_button object %} - {% endif %} -
-
-{% endblock controls %} - -{% block tabs %} - -{% endblock tabs %} - -{% block content %} -

- - Created {{ object.created|annotated_date }} · - Updated {{ object.last_updated|timesince }} ago - - {{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }} -

-{% endblock content %} -{% block components %}{% endblock %} diff --git a/netbox_secretstore/templates/netbox_secretstore/generic/object_list.html b/netbox_secretstore/templates/netbox_secretstore/generic/object_list.html deleted file mode 100644 index cec99f0..0000000 --- a/netbox_secretstore/templates/netbox_secretstore/generic/object_list.html +++ /dev/null @@ -1,98 +0,0 @@ -{% extends 'base/layout.html' %} -{% load buttons %} -{% load helpers %} -{% load render_table from django_tables2 %} -{% load plugin_helpers %} -{% load static %} - -{% block controls %} -
-
- {% block extra_controls %}{% endblock %} - {% if permissions.add and 'add' in action_buttons %} - {% add_button content_type.model_class|validated_plugin_viewname:"add" %} - {% endif %} - {% if permissions.add and 'import' in action_buttons %} - {% import_button content_type.model_class|validated_plugin_viewname:"import" %} - {% endif %} - {% if 'export' in action_buttons %} - {% export_button content_type %} - {% endif %} -
-
-{% endblock controls %} - -{% block content %} -{% if table.paginator.num_pages > 1 %} -{% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %} -
-
- {% csrf_token %} -
-
- {% if bulk_edit_url and permissions.change %} - - {% endif %} - {% if bulk_delete_url and permissions.delete %} - - {% endif %} -
-
- - -
-
-
-
-{% endwith %} -{% endif %} - -{# Object table #} -
-
- {# Object list filter, table config #} - {% include 'inc/table_controls.html' with table_modal="ObjectTable_config" %} - {% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %} - {% if permissions.change or permissions.delete %} -
- {% csrf_token %} - -
- {% render_table table 'inc/table.html' %} -
-
-
- {% block bulk_buttons %}{% endblock %} - {% if bulk_edit_url and permissions.change %} - - {% endif %} - {% if bulk_delete_url and permissions.delete %} - - {% endif %} -
-
-
- {% else %} -
- {% render_table table 'inc/table.html' %} -
- {% endif %} - {% endwith %} - {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %} -
- {% if filter_form %} - {% include 'inc/filter_list.html' %} - {% endif %} -
-{% table_config_form table table_name="ObjectTable" %} -{% endblock content %} diff --git a/netbox_secretstore/templates/netbox_secretstore/secret.html b/netbox_secretstore/templates/netbox_secretstore/secret.html index 34cddfa..572e0e9 100644 --- a/netbox_secretstore/templates/netbox_secretstore/secret.html +++ b/netbox_secretstore/templates/netbox_secretstore/secret.html @@ -1,4 +1,4 @@ -{% extends 'netbox_secretstore/generic/object.html' %} +{% extends 'netbox_plugin_extensions/generic/object.html' %} {% load buttons %} {% load helpers %} {% load static %} @@ -39,7 +39,7 @@
- {% include 'inc/custom_fields_panel.html' %} + {% include 'inc/panels/custom_fields.html' %} {% plugin_left_page object %}
@@ -68,7 +68,7 @@
- {% 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 %} diff --git a/netbox_secretstore/templates/netbox_secretstore/secretrole.html b/netbox_secretstore/templates/netbox_secretstore/secretrole.html index 570fe8e..fd0e23c 100644 --- a/netbox_secretstore/templates/netbox_secretstore/secretrole.html +++ b/netbox_secretstore/templates/netbox_secretstore/secretrole.html @@ -1,4 +1,4 @@ -{% extends 'netbox_secretstore/generic/object.html' %} +{% extends 'netbox_plugin_extensions/generic/object.html' %} {% load helpers %} {% load plugins %} @@ -8,57 +8,57 @@ {% endblock %} {% block content %} -
-
-
-
- Secret Role -
-
- - - - - - - - - - - - - -
Name{{ object.name }}
Description{{ object.description|placeholder }}
Secrets - {{ secrets_table.rows|length }} -
+
+
+
+
+ Secret Role +
+
+ + + + + + + + + + + + + +
Name{{ object.name }}
Description{{ object.description|placeholder }}
Secrets + {{ secrets_table.rows|length }} +
+
+
+ {% plugin_left_page object %}
+
+ {% include 'inc/panels/custom_fields.html' %} + {% plugin_right_page object %}
- {% plugin_left_page object %} -
-
- {% include 'inc/custom_fields_panel.html' %} - {% plugin_right_page object %}
-
-
-
-
-
- Secrets -
-
- {% include 'inc/table.html' with table=secrets_table %} -
- {% if perms.netbox_secretstore.add_secret %} - {% endblock %} diff --git a/netbox_secretstore/templates/netbox_secretstore/userkey.html b/netbox_secretstore/templates/netbox_secretstore/userkey.html index a343053..eaa4aaa 100644 --- a/netbox_secretstore/templates/netbox_secretstore/userkey.html +++ b/netbox_secretstore/templates/netbox_secretstore/userkey.html @@ -1,4 +1,4 @@ -{% extends 'users/base.html' %} +{% extends 'base/layout.html' %} {% block title %}User Key{% endblock %} diff --git a/netbox_secretstore/templates/netbox_secretstore/userkey_edit.html b/netbox_secretstore/templates/netbox_secretstore/userkey_edit.html index 7d16507..22eacc9 100644 --- a/netbox_secretstore/templates/netbox_secretstore/userkey_edit.html +++ b/netbox_secretstore/templates/netbox_secretstore/userkey_edit.html @@ -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 %}