upskill-event-manager/assets/css/hvac-announcements-admin.css
ben 2a06bb1f15 fix: resolve announcements modal z-index stacking issue (v2.1.5)
Changes:
- Fix z-index conflict where announcement modal (999999) was higher than WordPress media modals (160000)
- Reduce announcement modal z-index to 100000 to allow WordPress media library to stack on top
- Remove duplicate TinyMCE initialization that was unnecessary
- Add custom "Add Media" button that renders when modal opens (prevents hidden modal issues)
- Improve page detection with multi-layered approach (URL path, template, slug, queried object)
- Move script loading to footer for better WordPress editor compatibility

Technical Details:
- WordPress core media modals use z-index 160000-160010
- Custom plugin modals should use 100000-159000 range to avoid conflicts
- wp_editor() with media_buttons => true in hidden modals causes auto-open issues
- Solution: media_buttons => false + custom button added via JavaScript when modal opens

Testing:
- Verified with MCP Playwright browser automation
- Media modal now properly appears above announcement modal
- All form functionality preserved
- Screenshot verification shows correct stacking order

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 19:23:02 -04:00

402 lines
No EOL
6.6 KiB
CSS

/**
* HVAC Announcements Admin Styles
*
* @package HVAC_Community_Events
*/
/* Page Layout */
.hvac-master-announcements-page {
padding: 20px 0;
}
.hvac-announcements-wrapper {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Page Header */
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 2px solid #e0e0e0;
}
.page-header h1 {
margin: 0;
font-size: 28px;
color: #003366;
}
#add-announcement-btn {
display: flex;
align-items: center;
gap: 5px;
padding: 10px 20px;
font-size: 14px;
}
/* Controls */
.announcements-controls {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding: 15px;
background: #f5f5f5;
border-radius: 4px;
}
.filter-group {
display: flex;
align-items: center;
gap: 10px;
}
.filter-select {
padding: 5px 10px;
border: 1px solid #ddd;
border-radius: 4px;
}
.search-group {
display: flex;
gap: 5px;
}
#announcement-search {
width: 250px;
padding: 5px 10px;
border: 1px solid #ddd;
border-radius: 4px;
}
/* Table */
.announcements-table-wrapper {
overflow-x: auto;
}
#announcements-table {
width: 100%;
border-collapse: collapse;
}
#announcements-table th {
background: #f0f0f0;
font-weight: 600;
text-align: left;
padding: 10px;
}
#announcements-table td {
padding: 10px;
border-top: 1px solid #e0e0e0;
}
#announcements-table .no-items {
text-align: center;
color: #666;
font-style: italic;
}
/* Status badges */
.status-publish {
display: inline-block;
padding: 2px 8px;
background: #4caf50;
color: white;
border-radius: 3px;
font-size: 12px;
}
.status-draft {
display: inline-block;
padding: 2px 8px;
background: #ff9800;
color: white;
border-radius: 3px;
font-size: 12px;
}
.status-private {
display: inline-block;
padding: 2px 8px;
background: #9c27b0;
color: white;
border-radius: 3px;
font-size: 12px;
}
/* Column widths */
.column-title { width: 30%; }
.column-status { width: 10%; }
.column-categories { width: 20%; }
.column-author { width: 15%; }
.column-date { width: 15%; }
.column-actions { width: 10%; text-align: right; }
/* Action buttons */
.column-actions .button-small {
padding: 2px 8px;
font-size: 12px;
margin-left: 5px;
}
/* Pagination */
.announcements-pagination {
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #e0e0e0;
}
.page-info {
color: #666;
}
/* Modal */
.hvac-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 100000; /* Below WordPress media modal (160000) to allow media library to stack on top */
display: flex;
justify-content: center;
align-items: center;
}
.modal-content {
background: white;
width: 90%;
max-width: 800px;
max-height: 90vh;
overflow-y: auto;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
border-bottom: 1px solid #e0e0e0;
}
.modal-header h2 {
margin: 0;
color: #003366;
}
.modal-close {
background: none;
border: none;
font-size: 28px;
cursor: pointer;
color: #666;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}
.modal-close:hover {
color: #000;
}
.modal-body {
padding: 20px;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 20px;
border-top: 1px solid #e0e0e0;
background: #f5f5f5;
}
/* Form */
.form-field {
margin-bottom: 20px;
}
.form-field label {
display: block;
margin-bottom: 5px;
font-weight: 600;
color: #333;
}
.form-field input[type="text"],
.form-field input[type="datetime-local"],
.form-field textarea,
.form-field select {
width: 100%;
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.form-field textarea {
resize: vertical;
}
.form-field .description {
margin-top: 5px;
color: #666;
font-size: 12px;
font-style: italic;
}
.checkbox-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
background: #f9f9f9;
}
.featured-image-section {
border: 1px solid #ddd;
border-radius: 4px;
padding: 15px;
background: #f9f9f9;
}
.featured-image-buttons {
display: flex;
gap: 10px;
margin-top: 10px;
}
.form-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #e0e0e0;
}
.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
.required {
color: #d32f2f;
}
/* Categories */
#categories-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
}
.category-checkbox {
display: flex;
align-items: center;
cursor: pointer;
}
.category-checkbox input {
margin-right: 5px;
}
/* Featured Image */
.featured-image-container {
display: flex;
flex-direction: column;
gap: 10px;
}
#featured-image-preview {
max-width: 300px;
}
#featured-image-preview img {
max-width: 100%;
height: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
/* Notices */
.notice {
padding: 12px;
margin: 10px 0;
border-left: 4px solid;
background: #fff;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
.notice-success {
border-left-color: #4caf50;
background: #f0f8f0;
}
.notice-error {
border-left-color: #d32f2f;
background: #fff5f5;
}
/* Responsive */
@media (max-width: 768px) {
.page-header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
.announcements-controls {
flex-direction: column;
gap: 15px;
}
.search-group {
width: 100%;
}
#announcement-search {
flex: 1;
}
.form-row {
grid-template-columns: 1fr;
}
.modal-content {
width: 95%;
margin: 20px;
}
#announcements-table {
font-size: 14px;
}
.column-categories,
.column-author {
display: none;
}
}