Usability fixes

This commit is contained in:
James Pattinson
2025-12-11 15:42:21 +00:00
parent 5f2aa82e36
commit 7efc2ef37a
2 changed files with 22 additions and 36 deletions

View File

@@ -437,7 +437,7 @@
.form-actions {
display: flex;
gap: 1rem;
justify-content: flex-end;
justify-content: space-between;
padding-top: 1rem;
border-top: 1px solid #eee;
}
@@ -848,18 +848,12 @@
</div>
<div class="modal-body">
<div class="quick-actions">
<button id="btn-confirm" class="btn btn-success btn-sm" onclick="updateStatus('CONFIRMED')">
✓ Confirm
</button>
<button id="btn-landed" class="btn btn-warning btn-sm" onclick="showTimestampModal('LANDED')">
🛬 Land
</button>
<button id="btn-departed" class="btn btn-primary btn-sm" onclick="showTimestampModal('DEPARTED')">
🛫 Depart
</button>
<button id="btn-cancel" class="btn btn-danger btn-sm" onclick="updateStatus('CANCELED')">
❌ Cancel
</button>
</div>
<form id="ppr-form">
@@ -943,11 +937,8 @@
</div>
<div class="form-actions">
<button type="button" class="btn btn-danger" id="delete-btn" onclick="deletePPR()" style="display: none;">
🗑️ Delete
</button>
<button type="button" class="btn btn-primary" onclick="closePPRModal()">
Cancel
<button type="button" class="btn btn-danger" id="btn-cancel" onclick="updateStatus('CANCELED')">
❌ Cancel PPR
</button>
<button type="submit" class="btn btn-success">
💾 Save Changes
@@ -1989,7 +1980,6 @@
currentPPRId = null;
etdManuallyEdited = false; // Reset the manual edit flag for new PPR
document.getElementById('modal-title').textContent = 'New PPR';
document.getElementById('delete-btn').style.display = 'none';
document.getElementById('journal-section').style.display = 'none';
document.querySelector('.quick-actions').style.display = 'none';
@@ -2072,7 +2062,6 @@
isNewPPR = false;
currentPPRId = pprId;
document.getElementById('modal-title').textContent = 'Edit PPR Entry';
document.getElementById('delete-btn').style.display = 'inline-block';
document.querySelector('.quick-actions').style.display = 'flex';
try {
@@ -2087,23 +2076,21 @@
// Show/hide quick action buttons based on current status
if (ppr.status === 'NEW') {
document.getElementById('btn-confirm').style.display = 'inline-block';
document.getElementById('btn-landed').style.display = 'none';
document.getElementById('btn-departed').style.display = 'none';
document.getElementById('btn-cancel').style.display = 'inline-block';
} else if (ppr.status === 'CONFIRMED') {
document.getElementById('btn-confirm').style.display = 'none';
document.getElementById('btn-landed').style.display = 'inline-block';
document.getElementById('btn-departed').style.display = 'none';
document.getElementById('btn-cancel').style.display = 'inline-block';
} else if (ppr.status === 'LANDED') {
document.getElementById('btn-confirm').style.display = 'none';
document.getElementById('btn-landed').style.display = 'none';
document.getElementById('btn-departed').style.display = 'inline-block';
document.getElementById('btn-cancel').style.display = 'inline-block';
} else {
// DEPARTED, CANCELED, DELETED - hide all quick actions
// DEPARTED, CANCELED, DELETED - hide all quick actions and cancel button
document.querySelector('.quick-actions').style.display = 'none';
document.getElementById('btn-cancel').style.display = 'none';
}
await loadJournal(pprId); // Always load journal when opening a PPR