226 lines
11 KiB
HTML
226 lines
11 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Delete Configuration - {{ object.key }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<!-- Breadcrumb -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
|
<h4 class="mb-sm-0">Delete Configuration</h4>
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="{% url 'core:dashboard' %}">Dashboard</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'core:system_configuration' %}">System Configuration</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'core:system_configuration_detail' object.pk %}">{{ object.key }}</a></li>
|
|
<li class="breadcrumb-item active">Delete</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<!-- Main Content -->
|
|
<div class="col-lg-8">
|
|
<div class="card border-danger">
|
|
<div class="card-header bg-danger text-white">
|
|
<div class="d-flex align-items-center">
|
|
<div class="flex-shrink-0">
|
|
<i class="fas fa-exclamation-triangle fa-lg me-2"></i>
|
|
</div>
|
|
<div class="flex-grow-1">
|
|
<h5 class="card-title mb-0">Warning: Confirm Configuration Deletion</h5>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-warning">
|
|
<div class="d-flex">
|
|
<div class="flex-shrink-0">
|
|
<i class="fas fa-exclamation-circle fa-lg"></i>
|
|
</div>
|
|
<div class="flex-grow-1 ms-3">
|
|
<h5 class="alert-heading">This action cannot be undone!</h5>
|
|
<p>You are about to permanently delete the configuration <strong>"{{ object.key }}"</strong>.</p>
|
|
<p class="mb-0">Any systems or applications relying on this configuration may experience issues after deletion.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<h6 class="text-muted mb-3">Configuration Details</h6>
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<th style="width: 30%">Key</th>
|
|
<td>{{ object.key }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Category</th>
|
|
<td>{{ object.category }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Data Type</th>
|
|
<td>{{ object.get_data_type_display }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Description</th>
|
|
<td>{{ object.description|default:"No description provided." }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Created</th>
|
|
<td>{{ object.created_at|date:"M d, Y g:i A" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Last Updated</th>
|
|
<td>{{ object.updated_at|date:"M d, Y g:i A" }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<h6 class="text-muted mb-3">Impact Assessment</h6>
|
|
<div class="alert alert-info">
|
|
<div class="d-flex">
|
|
<div class="flex-shrink-0">
|
|
<i class="fas fa-info-circle fa-lg"></i>
|
|
</div>
|
|
<div class="flex-grow-1 ms-3">
|
|
<h6 class="alert-heading">Potential Impact</h6>
|
|
<ul class="mb-0">
|
|
<li>Systems using this configuration will fall back to default values</li>
|
|
<li>Custom behavior dependent on this configuration will be lost</li>
|
|
<li>Audit logs will retain references to this configuration</li>
|
|
{% if dependent_systems %}
|
|
<li>The following systems may be affected:
|
|
<ul>
|
|
{% for system in dependent_systems %}
|
|
<li>{{ system }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
|
|
<div class="mb-4">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="confirmDelete" required>
|
|
<label class="form-check-label" for="confirmDelete">
|
|
I understand that this action cannot be undone and confirm that I want to delete this configuration.
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-between">
|
|
<a href="{% url 'core:system_configuration_detail' object.pk %}" class="btn btn-outline-secondary">
|
|
<i class="fas fa-arrow-left me-1"></i>
|
|
Cancel
|
|
</a>
|
|
<button type="submit" class="btn btn-danger" id="deleteButton" disabled>
|
|
<i class="fas fa-trash me-1"></i>
|
|
Delete Configuration
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Sidebar -->
|
|
<div class="col-lg-4">
|
|
<!-- Alternative Actions -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="card-title mb-0">
|
|
<i class="fas fa-lightbulb me-2"></i>
|
|
Alternative Actions
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-success">
|
|
<div class="d-flex">
|
|
<div class="flex-shrink-0">
|
|
<i class="fas fa-info-circle"></i>
|
|
</div>
|
|
<div class="flex-grow-1 ms-3">
|
|
<p class="mb-0">Consider these alternatives instead of deletion:</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-grid gap-2">
|
|
<a href="{% url 'core:system_configuration_update' object.pk %}" class="btn btn-outline-primary">
|
|
<i class="fas fa-edit me-2"></i>
|
|
Edit Configuration
|
|
</a>
|
|
|
|
<a href="{% url 'core:deactivate_configuration' object.pk %}" class="btn btn-outline-warning">
|
|
<i class="fas fa-power-off me-2"></i>
|
|
Deactivate Instead
|
|
</a>
|
|
|
|
<a href="{% url 'core:archive_configuration' object.pk %}" class="btn btn-outline-info">
|
|
<i class="fas fa-archive me-2"></i>
|
|
Archive Configuration
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Help Information -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="card-title mb-0">
|
|
<i class="fas fa-question-circle me-2"></i>
|
|
Help Information
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<h6>What happens when I delete a configuration?</h6>
|
|
<p class="text-muted">When you delete a configuration, it is permanently removed from the system. Any applications or services that rely on this configuration will fall back to their default values or may experience issues.</p>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<h6>Can I recover a deleted configuration?</h6>
|
|
<p class="text-muted">No, configuration deletion is permanent and cannot be undone. Consider deactivating or archiving instead if you may need it again in the future.</p>
|
|
</div>
|
|
|
|
<div>
|
|
<h6>What's the difference between delete and deactivate?</h6>
|
|
<p class="text-muted mb-0">Deactivating a configuration keeps it in the system but marks it as inactive, so it won't be used by applications. You can reactivate it later if needed.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const confirmCheckbox = document.getElementById('confirmDelete');
|
|
const deleteButton = document.getElementById('deleteButton');
|
|
|
|
confirmCheckbox.addEventListener('change', function() {
|
|
deleteButton.disabled = !this.checked;
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|