|
@@ -115,14 +115,22 @@
|
|
|
</form>
|
|
</form>
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
- {% if not p.is_active and not p.is_readonly and not p.is_locked %}
|
|
|
|
|
- <li><hr class="dropdown-divider"></li>
|
|
|
|
|
- <li>
|
|
|
|
|
- <form action="/patch-manager/profile/delete" method="post" class="m-0 p-0" onsubmit="return confirm('Delete this profile completely?');">
|
|
|
|
|
- <input type="hidden" name="profile_id" value="{{ p.id }}">
|
|
|
|
|
- <button type="submit" class="dropdown-item text-danger"><i class="bi bi-trash me-2"></i>Delete Profile</button>
|
|
|
|
|
- </form>
|
|
|
|
|
- </li>
|
|
|
|
|
|
|
+ {% if not p.is_active and not p.is_readonly %}
|
|
|
|
|
+ <li><hr class="dropdown-divider"></li>
|
|
|
|
|
+ {% if p.is_locked %}
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <a class="dropdown-item text-danger" href="javascript:void(0)" onclick="openDeleteLockedModal({{ p.id }}, '{{ p.name|escape }}')">
|
|
|
|
|
+ <i class="bi bi-trash me-2"></i>Delete Profile
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ {% else %}
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <form action="/patch-manager/profile/delete" method="post" class="m-0 p-0" onsubmit="return confirm('Delete this profile completely?');">
|
|
|
|
|
+ <input type="hidden" name="profile_id" value="{{ p.id }}">
|
|
|
|
|
+ <button type="submit" class="dropdown-item text-danger"><i class="bi bi-trash me-2"></i>Delete Profile</button>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ {% endif %}
|
|
|
{% endif %}
|
|
{% endif %}
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
@@ -361,6 +369,31 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="modal fade" id="deleteLockedModal" tabindex="-1" aria-hidden="true">
|
|
|
|
|
+ <div class="modal-dialog">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <form action="/patch-manager/profile/delete" method="post">
|
|
|
|
|
+ <div class="modal-header bg-light">
|
|
|
|
|
+ <h5 class="modal-title fw-bold text-danger"><i class="bi bi-trash me-2"></i>Delete Locked Profile</h5>
|
|
|
|
|
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-body p-4">
|
|
|
|
|
+ <input type="hidden" name="profile_id" id="delete-locked-profile-id">
|
|
|
|
|
+ <p>Enter the password to permanently delete <strong id="delete-locked-profile-name"></strong>.</p>
|
|
|
|
|
+ <div class="mb-3">
|
|
|
|
|
+ <label class="form-label text-muted small fw-bold">Password</label>
|
|
|
|
|
+ <input type="password" class="form-control" name="password" required>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-footer bg-light d-flex justify-content-between">
|
|
|
|
|
+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
|
|
|
+ <button type="submit" class="btn btn-danger fw-bold"><i class="bi bi-trash me-1"></i>Delete Profile</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
<footer class="py-3 bg-dark text-white-50 mt-auto">
|
|
<footer class="py-3 bg-dark text-white-50 mt-auto">
|
|
|
<div class="container-fluid px-4 d-flex justify-content-between">
|
|
<div class="container-fluid px-4 d-flex justify-content-between">
|
|
@@ -395,6 +428,12 @@
|
|
|
document.getElementById('unlock-profile-name').innerText = profileName;
|
|
document.getElementById('unlock-profile-name').innerText = profileName;
|
|
|
new bootstrap.Modal(document.getElementById('unlockModal')).show();
|
|
new bootstrap.Modal(document.getElementById('unlockModal')).show();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ function openDeleteLockedModal(profileId, profileName) {
|
|
|
|
|
+ document.getElementById('delete-locked-profile-id').value = profileId;
|
|
|
|
|
+ document.getElementById('delete-locked-profile-name').innerText = profileName;
|
|
|
|
|
+ new bootstrap.Modal(document.getElementById('deleteLockedModal')).show();
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|
|
|
</body>
|
|
</body>
|
|
|
</html>
|
|
</html>
|