Fix settings
This commit is contained in:
@@ -1868,235 +1868,6 @@ th.sort-desc::after {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===== SETTINGS MODAL STYLES - TERMINAL EDITION ===== */
|
|
||||||
.settings-modal-backdrop {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: rgba(0, 0, 0, 0.85);
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal {
|
|
||||||
background: var(--bg-primary);
|
|
||||||
border: 3px double var(--terminal-green);
|
|
||||||
border-radius: 0;
|
|
||||||
width: 500px;
|
|
||||||
max-width: 90%;
|
|
||||||
box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
|
|
||||||
padding: 0;
|
|
||||||
position: relative;
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ASCII corners for modal */
|
|
||||||
.settings-modal::before {
|
|
||||||
content: '╔';
|
|
||||||
position: absolute;
|
|
||||||
top: -3px;
|
|
||||||
left: -3px;
|
|
||||||
font-size: 1.5rem;
|
|
||||||
color: var(--terminal-green);
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal::after {
|
|
||||||
content: '╗';
|
|
||||||
position: absolute;
|
|
||||||
top: -3px;
|
|
||||||
right: -3px;
|
|
||||||
font-size: 1.5rem;
|
|
||||||
color: var(--terminal-green);
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
border-bottom: 2px solid var(--terminal-green);
|
|
||||||
padding: 15px 20px;
|
|
||||||
margin: 0;
|
|
||||||
background: var(--bg-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal-header h2 {
|
|
||||||
margin: 0;
|
|
||||||
color: var(--terminal-amber);
|
|
||||||
text-shadow: var(--glow-amber);
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal-header h2::before {
|
|
||||||
content: '═══ ';
|
|
||||||
color: var(--terminal-green);
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal-header h2::after {
|
|
||||||
content: ' ═══';
|
|
||||||
color: var(--terminal-green);
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-modal {
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
font-size: 24px;
|
|
||||||
cursor: pointer;
|
|
||||||
color: var(--terminal-green);
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-modal::before {
|
|
||||||
content: '[';
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-modal::after {
|
|
||||||
content: ']';
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-modal:hover {
|
|
||||||
color: var(--priority-1);
|
|
||||||
text-shadow: var(--glow-red);
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-group {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
padding: 0 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-group label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
color: var(--terminal-green);
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-group label::before {
|
|
||||||
content: '> ';
|
|
||||||
color: var(--terminal-amber);
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-group select {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
border: 2px solid var(--terminal-green);
|
|
||||||
border-radius: 0;
|
|
||||||
background: var(--bg-primary);
|
|
||||||
color: var(--terminal-green);
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal-footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 10px;
|
|
||||||
border-top: 2px solid var(--terminal-green);
|
|
||||||
padding: 15px 20px;
|
|
||||||
background: var(--bg-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-settings, .cancel-settings {
|
|
||||||
padding: 10px 20px;
|
|
||||||
border-radius: 0;
|
|
||||||
border: 2px solid var(--terminal-green);
|
|
||||||
background: transparent;
|
|
||||||
color: var(--terminal-green);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
font-weight: bold;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-settings::before,
|
|
||||||
.cancel-settings::before {
|
|
||||||
content: '[ ';
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-settings::after,
|
|
||||||
.cancel-settings::after {
|
|
||||||
content: ' ]';
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-settings {
|
|
||||||
color: var(--terminal-amber);
|
|
||||||
border-color: var(--terminal-amber);
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-settings:hover,
|
|
||||||
.cancel-settings:hover {
|
|
||||||
background: rgba(0, 255, 65, 0.1);
|
|
||||||
text-shadow: var(--glow-green);
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-settings {
|
|
||||||
background: #3b82f6;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cancel-settings {
|
|
||||||
background: var(--hover-bg);
|
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
|
||||||
/* Bulk Actions Styles (Admin only) */
|
|
||||||
.bulk-actions-toolbar {
|
|
||||||
display: none;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 1rem;
|
|
||||||
background: var(--toolbar-bg, #1a202c);
|
|
||||||
border: 1px solid var(--toolbar-border, #ffc107);
|
|
||||||
border-radius: 0;
|
|
||||||
margin: 1rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bulk-actions-info {
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--text-primary, #333);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bulk-actions-buttons {
|
|
||||||
display: flex;
|
|
||||||
gap: 0.5rem;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-bulk {
|
|
||||||
padding: 0.5rem 1rem;
|
|
||||||
background: var(--btn-bulk-bg, #007bff);
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
transition: background 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-bulk:hover {
|
|
||||||
background: var(--btn-bulk-hover, #0056b3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-secondary {
|
|
||||||
padding: 0.5rem 1rem;
|
|
||||||
background: var(--btn-secondary-bg, #6c757d);
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
transition: background 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-secondary:hover {
|
|
||||||
background: var(--btn-secondary-hover, #5a6268);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dark mode bulk actions */
|
/* Dark mode bulk actions */
|
||||||
body.dark-mode .bulk-actions-toolbar {
|
body.dark-mode .bulk-actions-toolbar {
|
||||||
--toolbar-bg: #2d3748;
|
--toolbar-bg: #2d3748;
|
||||||
@@ -2629,7 +2400,7 @@ body.dark-mode select option {
|
|||||||
box-shadow: var(--glow-green);
|
box-shadow: var(--glow-green);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Settings Modal Container */
|
/* Settings Modal Container - acts as backdrop */
|
||||||
.settings-modal {
|
.settings-modal {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -2637,27 +2408,20 @@ body.dark-mode select option {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
}
|
background: rgba(0, 0, 0, 0.85);
|
||||||
|
|
||||||
.settings-backdrop {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: rgba(0, 0, 0, 0.8);
|
|
||||||
backdrop-filter: blur(5px);
|
backdrop-filter: blur(5px);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-content {
|
.settings-content {
|
||||||
position: absolute;
|
position: relative;
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
background: var(--bg-secondary);
|
background: var(--bg-secondary);
|
||||||
border: 2px solid var(--terminal-green);
|
border: 2px solid var(--terminal-green);
|
||||||
box-shadow: 0 0 30px rgba(0, 255, 65, 0.5);
|
box-shadow: 0 0 30px rgba(0, 255, 65, 0.5);
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
|
width: 90%;
|
||||||
max-height: 90vh;
|
max-height: 90vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
font-family: var(--font-mono);
|
font-family: var(--font-mono);
|
||||||
@@ -2668,11 +2432,11 @@ body.dark-mode select option {
|
|||||||
@keyframes settingsSlideIn {
|
@keyframes settingsSlideIn {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translate(-50%, -60%);
|
transform: translateY(-30px);
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translate(-50%, -50%);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -162,79 +162,7 @@ function sortTable(table, column) {
|
|||||||
rows.forEach(row => tbody.appendChild(row));
|
rows.forEach(row => tbody.appendChild(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSettingsModal() {
|
// Old settings modal functions removed - now using settings.js with new settings modal
|
||||||
const backdrop = document.createElement('div');
|
|
||||||
backdrop.className = 'settings-modal-backdrop';
|
|
||||||
backdrop.innerHTML = `
|
|
||||||
<div class="settings-modal ascii-frame-outer">
|
|
||||||
<span class="bottom-left-corner">╚</span>
|
|
||||||
<span class="bottom-right-corner">╝</span>
|
|
||||||
|
|
||||||
<div class="ascii-section-header">Dashboard Settings</div>
|
|
||||||
|
|
||||||
<div class="ascii-content">
|
|
||||||
<div class="ascii-frame-inner">
|
|
||||||
<div class="setting-group">
|
|
||||||
<h3>Rows per Page</h3>
|
|
||||||
<select id="rows-per-page">
|
|
||||||
<option value="15">15</option>
|
|
||||||
<option value="25">25</option>
|
|
||||||
<option value="50">50</option>
|
|
||||||
<option value="100">100</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ascii-divider"></div>
|
|
||||||
|
|
||||||
<div class="ascii-content">
|
|
||||||
<div class="settings-modal-footer">
|
|
||||||
<button class="save-settings">Save Settings</button>
|
|
||||||
<button class="cancel-settings">Cancel</button>
|
|
||||||
<button class="close-modal">×</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
document.body.appendChild(backdrop);
|
|
||||||
|
|
||||||
// Load saved rows per page setting
|
|
||||||
const savedRowsPerPage = localStorage.getItem('ticketsPerPage') || '15';
|
|
||||||
const rowsPerPageSelect = backdrop.querySelector('#rows-per-page');
|
|
||||||
rowsPerPageSelect.value = savedRowsPerPage;
|
|
||||||
|
|
||||||
// Event listeners
|
|
||||||
backdrop.querySelector('.close-modal').addEventListener('click', closeSettingsModal);
|
|
||||||
backdrop.querySelector('.cancel-settings').addEventListener('click', closeSettingsModal);
|
|
||||||
backdrop.querySelector('.save-settings').addEventListener('click', saveSettings);
|
|
||||||
|
|
||||||
backdrop.addEventListener('click', (e) => {
|
|
||||||
if (e.target === backdrop) {
|
|
||||||
closeSettingsModal();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeSettingsModal() {
|
|
||||||
const backdrop = document.querySelector('.settings-modal-backdrop');
|
|
||||||
if (backdrop) {
|
|
||||||
backdrop.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveSettings() {
|
|
||||||
// Save rows per page
|
|
||||||
const rowsPerPage = document.querySelector('#rows-per-page').value;
|
|
||||||
localStorage.setItem('ticketsPerPage', rowsPerPage);
|
|
||||||
|
|
||||||
// Set cookie for PHP to read
|
|
||||||
document.cookie = `ticketsPerPage=${rowsPerPage}; path=/`;
|
|
||||||
|
|
||||||
// Reload page to apply pagination changes
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
function initStatusFilter() {
|
function initStatusFilter() {
|
||||||
const filterContainer = document.createElement('div');
|
const filterContainer = document.createElement('div');
|
||||||
|
|||||||
@@ -122,6 +122,15 @@ function closeSettingsModal() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close modal when clicking on backdrop (outside the settings content)
|
||||||
|
function closeOnBackdropClick(event) {
|
||||||
|
const modal = document.getElementById('settingsModal');
|
||||||
|
// Only close if clicking directly on the modal backdrop, not on content
|
||||||
|
if (event.target === modal) {
|
||||||
|
closeSettingsModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Keyboard shortcut to open settings (Alt+S)
|
// Keyboard shortcut to open settings (Alt+S)
|
||||||
document.addEventListener('keydown', (e) => {
|
document.addEventListener('keydown', (e) => {
|
||||||
if (e.altKey && e.key === 's') {
|
if (e.altKey && e.key === 's') {
|
||||||
|
|||||||
@@ -349,8 +349,7 @@
|
|||||||
<!-- END OUTER FRAME -->
|
<!-- END OUTER FRAME -->
|
||||||
|
|
||||||
<!-- Settings Modal -->
|
<!-- Settings Modal -->
|
||||||
<div class="settings-modal" id="settingsModal" style="display: none;">
|
<div class="settings-modal" id="settingsModal" style="display: none;" onclick="closeOnBackdropClick(event)">
|
||||||
<div class="settings-backdrop" onclick="closeSettingsModal()"></div>
|
|
||||||
<div class="settings-content">
|
<div class="settings-content">
|
||||||
<span class="bottom-left-corner">╚</span>
|
<span class="bottom-left-corner">╚</span>
|
||||||
<span class="bottom-right-corner">╝</span>
|
<span class="bottom-right-corner">╝</span>
|
||||||
|
|||||||
@@ -325,8 +325,7 @@ function formatDetails($details, $actionType) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Settings Modal (same as dashboard) -->
|
<!-- Settings Modal (same as dashboard) -->
|
||||||
<div class="settings-modal" id="settingsModal" style="display: none;">
|
<div class="settings-modal" id="settingsModal" style="display: none;" onclick="closeOnBackdropClick(event)">
|
||||||
<div class="settings-backdrop" onclick="closeSettingsModal()"></div>
|
|
||||||
<div class="settings-content">
|
<div class="settings-content">
|
||||||
<span class="bottom-left-corner">╚</span>
|
<span class="bottom-left-corner">╚</span>
|
||||||
<span class="bottom-right-corner">╝</span>
|
<span class="bottom-right-corner">╝</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user