Rename modal classes to custom-modal to avoid Bootstrap conflicts

Bootstrap's JavaScript modal system was interfering with our custom modals
because both used the .modal class. Renamed all modal-related classes to
use custom- prefix:
- .modal -> .custom-modal
- .modal-dialog -> .custom-modal-dialog
- .modal-header -> .custom-modal-header
- .modal-body -> .custom-modal-body
- .modal-footer -> .custom-modal-footer
- .modal-title -> .custom-modal-title

This prevents Bootstrap from trying to manage our custom modals.
parent 091d1023
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% block title %}API Tokens - Fixture Manager{% endblock %} {% block title %}API Tokens - Fixture Manager{% endblock %}
{% block extra_css %} {% block extra_css %}
/* Modal styles */ /* Custom Modal styles - using custom prefix to avoid Bootstrap conflicts */
.modal { .custom-modal {
display: none; display: none;
position: fixed; position: fixed;
z-index: 1000; z-index: 1000;
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
background-color: rgba(0,0,0,0.5); background-color: rgba(0,0,0,0.5);
} }
.modal.show { .custom-modal.show {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.modal-dialog { .custom-modal-dialog {
background: white; background: white;
border-radius: 8px; border-radius: 8px;
max-width: 500px; max-width: 500px;
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
box-shadow: 0 4px 20px rgba(0,0,0,0.3); box-shadow: 0 4px 20px rgba(0,0,0,0.3);
} }
.modal-header { .custom-modal-header {
padding: 1rem; padding: 1rem;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
display: flex; display: flex;
...@@ -41,22 +41,22 @@ ...@@ -41,22 +41,22 @@
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
} }
.modal-header.bg-success { .custom-modal-header.bg-success {
background-color: #28a745; background-color: #28a745;
color: white; color: white;
} }
.modal-title { .custom-modal-title {
margin: 0; margin: 0;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: bold; font-weight: bold;
} }
.modal-body { .custom-modal-body {
padding: 1rem; padding: 1rem;
} }
.modal-footer { .custom-modal-footer {
padding: 1rem; padding: 1rem;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
display: flex; display: flex;
...@@ -451,14 +451,14 @@ ...@@ -451,14 +451,14 @@
</div> </div>
<!-- Create Token Modal --> <!-- Create Token Modal -->
<div class="modal" id="createTokenModal"> <div class="custom-modal" id="createTokenModal">
<div class="modal-dialog"> <div class="custom-modal-dialog">
<div class="modal-header"> <div class="custom-modal-header">
<h5 class="modal-title">Create New API Token</h5> <h5 class="custom-modal-title">Create New API Token</h5>
<button type="button" class="close-btn" onclick="hideCreateModal()">×</button> <button type="button" class="close-btn" onclick="hideCreateModal()">×</button>
</div> </div>
<form id="createTokenForm"> <form id="createTokenForm">
<div class="modal-body"> <div class="custom-modal-body">
<div class="mb-3"> <div class="mb-3">
<label for="tokenName" class="form-label">Token Name</label> <label for="tokenName" class="form-label">Token Name</label>
<input type="text" class="form-control" id="tokenName" name="name" required <input type="text" class="form-control" id="tokenName" name="name" required
...@@ -469,7 +469,7 @@ ...@@ -469,7 +469,7 @@
⚠️ <strong>Important:</strong> The token will only be shown once after creation. Make sure to copy and store it securely. ⚠️ <strong>Important:</strong> The token will only be shown once after creation. Make sure to copy and store it securely.
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="custom-modal-footer">
<button type="button" class="btn btn-secondary" onclick="hideCreateModal()">Cancel</button> <button type="button" class="btn btn-secondary" onclick="hideCreateModal()">Cancel</button>
<button type="submit" class="btn"> <button type="submit" class="btn">
➕ Create Token ➕ Create Token
...@@ -480,15 +480,15 @@ ...@@ -480,15 +480,15 @@
</div> </div>
<!-- Token Created Modal --> <!-- Token Created Modal -->
<div class="modal" id="tokenCreatedModal"> <div class="custom-modal" id="tokenCreatedModal">
<div class="modal-dialog"> <div class="custom-modal-dialog">
<div class="modal-header bg-success"> <div class="custom-modal-header bg-success">
<h5 class="modal-title" style="color: white;"> <h5 class="custom-modal-title" style="color: white;">
✅ Token Created Successfully ✅ Token Created Successfully
</h5> </h5>
<button type="button" class="close-btn white" onclick="hideTokenCreatedModal()">×</button> <button type="button" class="close-btn white" onclick="hideTokenCreatedModal()">×</button>
</div> </div>
<div class="modal-body"> <div class="custom-modal-body">
<div class="success-message"> <div class="success-message">
<strong>Your new API token has been created!</strong> <strong>Your new API token has been created!</strong>
</div> </div>
...@@ -505,21 +505,21 @@ ...@@ -505,21 +505,21 @@
⚠️ <strong>Warning:</strong> This token will not be shown again. Make sure to copy and store it in a secure location. ⚠️ <strong>Warning:</strong> This token will not be shown again. Make sure to copy and store it in a secure location.
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="custom-modal-footer">
<button type="button" class="btn" onclick="hideTokenCreatedModal()">I've Saved the Token</button> <button type="button" class="btn" onclick="hideTokenCreatedModal()">I've Saved the Token</button>
</div> </div>
</div> </div>
</div> </div>
<!-- Extend Token Modal --> <!-- Extend Token Modal -->
<div class="modal" id="extendTokenModal"> <div class="custom-modal" id="extendTokenModal">
<div class="modal-dialog"> <div class="custom-modal-dialog">
<div class="modal-header"> <div class="custom-modal-header">
<h5 class="modal-title">Extend Token Expiration</h5> <h5 class="custom-modal-title">Extend Token Expiration</h5>
<button type="button" class="close-btn" onclick="hideExtendModal()">×</button> <button type="button" class="close-btn" onclick="hideExtendModal()">×</button>
</div> </div>
<form id="extendTokenForm"> <form id="extendTokenForm">
<div class="modal-body"> <div class="custom-modal-body">
<p>Extend the expiration date for token: <strong id="extendTokenName"></strong></p> <p>Extend the expiration date for token: <strong id="extendTokenName"></strong></p>
<div class="mb-3"> <div class="mb-3">
<label for="extensionDays" class="form-label">Extend by (days)</label> <label for="extensionDays" class="form-label">Extend by (days)</label>
...@@ -531,7 +531,7 @@ ...@@ -531,7 +531,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="custom-modal-footer">
<button type="button" class="btn btn-secondary" onclick="hideExtendModal()">Cancel</button> <button type="button" class="btn btn-secondary" onclick="hideExtendModal()">Cancel</button>
<button type="submit" class="btn btn-outline-info"> <button type="submit" class="btn btn-outline-info">
🕒 Extend Token 🕒 Extend Token
...@@ -759,8 +759,8 @@ function showAlert(message, type) { ...@@ -759,8 +759,8 @@ function showAlert(message, type) {
// Event listeners for token action buttons // Event listeners for token action buttons
document.addEventListener('click', function(e) { document.addEventListener('click', function(e) {
// Only close modal if clicking directly on the modal backdrop element itself // Only close modal if clicking directly on the modal backdrop element itself
// e.target is the actual element clicked - if it's the modal, the click was on the backdrop // e.target is the actual element clicked - if it's the custom-modal, the click was on the backdrop
if (e.target.classList.contains('modal') && e.target.classList.contains('show')) { if (e.target.classList.contains('custom-modal') && e.target.classList.contains('show')) {
e.target.classList.remove('show'); e.target.classList.remove('show');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment