added additional plugins

This commit is contained in:
Rodolfo Martinez 2025-12-12 19:05:48 -05:00
parent c85895d306
commit 00e60ec1b7
132 changed files with 27514 additions and 0 deletions

View file

@ -0,0 +1,850 @@
/**
* Ticket Tailor - Admin Styles
* Version: 3.1 - Enhanced with Canadian/UK English
*/
/* General Admin Styles */
.ticket-tailor-admin h1 {
margin-bottom: 1.5rem;
}
.ticket-tailor-admin .description {
margin-top: 0.5rem;
font-size: 0.9rem;
color: #646970;
}
/* Dashboard Stats Grid - FIXED VERSION */
.tt-stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.tt-stat-card {
padding: 1.5rem;
background: #fff;
border: 1px solid #c3c4c7;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
transition: all 0.3s ease;
text-align: center;
}
.tt-stat-card:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
transform: translateY(-2px);
}
/* Fixed: Use tt-stat-value for the number */
.tt-stat-value {
display: block;
font-size: 2.5rem;
font-weight: 700;
line-height: 1;
color: #2271b1;
margin-bottom: 0.75rem;
}
.tt-stat-label {
display: block;
font-size: 0.875rem;
color: #50575e;
text-transform: uppercase;
letter-spacing: 0.5px;
font-weight: 600;
}
/* Quick Actions Section - FIXED FOR BUTTON DISPLAY */
.tt-quick-actions {
background: #fff;
border: 1px solid #c3c4c7;
border-radius: 8px;
padding: 1.5rem;
margin: 2rem 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
overflow: visible; /* Ensure buttons aren't cut off */
}
.tt-quick-actions h2 {
margin-top: 0;
margin-bottom: 1rem;
font-size: 1.25rem;
color: #1d2327;
}
.tt-quick-actions .button-group {
display: flex;
gap: 0.75rem; /* Increased gap for better spacing */
flex-wrap: wrap;
align-items: center;
min-height: 42px; /* Ensure minimum height for buttons */
}
/* ENHANCED BUTTON STYLING FOR ADMIN AREA */
.ticket-tailor-admin .button,
.tt-quick-actions .button,
.ticket-tailor-admin input[type="submit"],
.ticket-tailor-admin .page-title-action {
border-radius: 6px !important;
box-shadow:
0 2px 4px rgba(0, 0, 0, 0.08),
0 1px 2px rgba(0, 0, 0, 0.06) !important;
font-size: 14px !important;
padding: 8px 16px !important;
font-weight: 500 !important;
transition: all 0.2s ease !important;
border: 1px solid rgba(0, 0, 0, 0.1) !important;
text-transform: none !important;
letter-spacing: 0.3px;
line-height: 1.5 !important;
display: inline-block !important;
flex: 0 0 auto; /* Prevent flex shrinking */
}
/* Primary buttons get special treatment */
.ticket-tailor-admin .button-primary,
.tt-quick-actions .button-primary {
background: #2271b1 !important;
border-color: #1e5f9a !important;
color: #fff !important;
box-shadow:
0 2px 4px rgba(34, 113, 177, 0.2),
0 1px 2px rgba(34, 113, 177, 0.15) !important;
}
.ticket-tailor-admin .button-primary:hover,
.tt-quick-actions .button-primary:hover {
background: #135e96 !important;
border-color: #0a4b7c !important;
box-shadow:
0 4px 8px rgba(34, 113, 177, 0.25),
0 2px 4px rgba(34, 113, 177, 0.2) !important;
transform: translateY(-1px);
}
/* Secondary buttons */
.ticket-tailor-admin .button:not(.button-primary):hover,
.tt-quick-actions .button:not(.button-primary):hover {
background: #f6f7f7 !important;
border-color: #8c8f94 !important;
box-shadow:
0 3px 6px rgba(0, 0, 0, 0.12),
0 2px 4px rgba(0, 0, 0, 0.08) !important;
transform: translateY(-1px);
}
/* Small buttons */
.ticket-tailor-admin .button-small {
font-size: 13px !important;
padding: 6px 12px !important;
}
/* Page title actions (like "Sync Events" on the events page) */
.ticket-tailor-admin .page-title-action {
margin-left: 10px !important;
vertical-align: middle !important;
}
/* Dashboard Section */
.tt-dashboard-section {
background: #fff;
border: 1px solid #c3c4c7;
border-radius: 8px;
padding: 1.5rem;
margin: 2rem 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.tt-dashboard-section h2 {
margin-top: 0;
margin-bottom: 1rem;
font-size: 1.25rem;
color: #1d2327;
border-bottom: 2px solid #f0f0f1;
padding-bottom: 0.75rem;
}
/* Dashboard Widget */
.tt-dashboard-widget {
padding: 0;
}
.tt-dashboard-widget h4 {
margin: 1rem 0 0.5rem;
font-size: 0.95rem;
color: #1d2327;
font-weight: 600;
}
.tt-dashboard-widget ul {
margin: 0;
padding: 0;
list-style: none;
}
.tt-dashboard-widget li {
padding: 0.75rem 0;
border-top: 1px solid #e1e1e1;
}
.tt-dashboard-widget li:first-child {
border-top: none;
}
.tt-dashboard-widget .description {
color: #646970;
font-size: 0.875rem;
}
.tt-dashboard-links {
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid #e1e1e1;
}
/* TABLE STYLES - FIXED CORNERS */
.ticket-tailor-admin .wp-list-table {
border: 1px solid #c3c4c7;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
overflow: hidden; /* This ensures border-radius clips content */
border-collapse: separate; /* Required for border-radius to work */
}
/* Fix for table header background to respect rounded corners */
.ticket-tailor-admin .wp-list-table thead {
background: #f6f7f7;
}
.ticket-tailor-admin .wp-list-table thead tr:first-child th:first-child {
border-top-left-radius: 7px;
}
.ticket-tailor-admin .wp-list-table thead tr:first-child th:last-child {
border-top-right-radius: 7px;
}
/* Fix for table body to respect rounded corners */
.ticket-tailor-admin .wp-list-table tbody tr:last-child td:first-child {
border-bottom-left-radius: 7px;
}
.ticket-tailor-admin .wp-list-table tbody tr:last-child td:last-child {
border-bottom-right-radius: 7px;
}
.ticket-tailor-admin .wp-list-table th {
font-weight: 600;
font-size: 0.875rem;
text-transform: uppercase;
letter-spacing: 0.3px;
color: #2c3338;
border-bottom: 1px solid #c3c4c7;
}
.ticket-tailor-admin .wp-list-table td {
padding: 12px 10px;
vertical-align: middle;
border-bottom: 1px solid #f0f0f1;
}
.ticket-tailor-admin .wp-list-table tbody tr:last-child td {
border-bottom: none;
}
/* Striped table rows */
.ticket-tailor-admin .wp-list-table.striped tbody tr:nth-child(odd) {
background-color: #f9f9f9;
}
/* Table hover effect */
.ticket-tailor-admin .wp-list-table tbody tr:hover {
background-color: #f0f6fc;
transition: background-color 0.2s ease;
}
/* Status Badges */
.tt-status-badge {
display: inline-block;
padding: 0.35rem 0.75rem;
border-radius: 12px;
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.3px;
}
.tt-status-live,
.tt-status-published,
.tt-status-on_sale {
background: #d1f4e0;
color: #0f5132;
}
.tt-status-draft {
background: #fff3cd;
color: #856404;
}
.tt-status-archived,
.tt-status-cancelled {
background: #e2e3e5;
color: #41464b;
}
.tt-status-completed,
.tt-status-paid {
background: #cfe2ff;
color: #084298;
}
.tt-status-pending {
background: #fff3cd;
color: #856404;
}
.tt-status-refunded,
.tt-status-sold_out {
background: #f8d7da;
color: #721c24;
}
.tt-status-unknown {
background: #e7e7e7;
color: #6c757d;
}
/* Help Page Styles */
.tt-help-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin: 2rem 0;
}
.tt-help-section {
background: #fff;
border: 1px solid #c3c4c7;
border-radius: 8px;
padding: 1.5rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.tt-help-section h2 {
margin-top: 0;
margin-bottom: 1rem;
font-size: 1.1rem;
color: #1d2327;
border-bottom: 2px solid #2271b1;
padding-bottom: 0.5rem;
}
.tt-help-section h3 {
margin-top: 1.5rem;
margin-bottom: 0.5rem;
font-size: 1rem;
color: #50575e;
}
.tt-help-section code {
display: block;
padding: 0.75rem;
background: #f6f7f7;
border: 1px solid #c3c4c7;
border-radius: 4px;
font-family: "Courier New", monospace;
font-size: 0.9rem;
margin: 0.5rem 0;
overflow-x: auto;
}
.tt-help-section ul,
.tt-help-section ol {
padding-left: 1.5rem;
margin: 0.5rem 0;
}
.tt-help-section li {
margin-bottom: 0.5rem;
}
/* ENHANCED SETTINGS PAGE STYLING */
/* Override WordPress admin background for settings pages */
.ticket-tailor_page_ticket-tailor-settings {
background: #f0f2f5 !important;
}
/* Main settings container with white background */
.ticket-tailor_page_ticket-tailor-settings .wrap {
background: white;
padding: 30px;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
margin-top: 20px;
max-width: 1200px;
}
/* Settings page title */
.ticket-tailor_page_ticket-tailor-settings .wrap h1 {
font-size: 24px;
color: #1d2327;
margin-bottom: 25px;
padding-bottom: 15px;
border-bottom: 2px solid #f0f2f5;
}
/* Tab wrapper styling */
.ticket-tailor-admin .nav-tab-wrapper {
margin-bottom: 2rem;
border-bottom: none;
background: #f8f9fa;
padding: 8px;
border-radius: 10px;
display: inline-flex;
gap: 8px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
/* Individual tab styling - rounded and modern */
.ticket-tailor-admin .nav-tab {
background: transparent;
border: none;
margin: 0;
padding: 10px 20px;
font-size: 14px;
font-weight: 500;
color: #50575e;
border-radius: 6px;
transition: all 0.2s ease;
cursor: pointer;
text-decoration: none;
}
.ticket-tailor-admin .nav-tab:hover {
background: rgba(255, 255, 255, 0.5);
color: #2c3338;
}
/* Active tab styling */
.ticket-tailor-admin .nav-tab-active,
.ticket-tailor-admin .nav-tab-active:focus,
.ticket-tailor-admin .nav-tab-active:hover {
background: white !important;
color: #2271b1;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
border: none;
font-weight: 600;
}
/* Form table improvements */
.ticket-tailor-admin .form-table {
margin-top: 2rem;
background: white;
width: 100%;
}
.ticket-tailor-admin .form-table tr {
border-bottom: 1px solid #f0f2f5;
}
.ticket-tailor-admin .form-table tr:last-child {
border-bottom: none;
}
.ticket-tailor-admin .form-table th {
width: 250px;
padding: 20px 20px 20px 0;
font-weight: 600;
color: #1d2327;
vertical-align: top;
}
.ticket-tailor-admin .form-table td {
padding: 20px;
}
.ticket-tailor-admin .form-table .description {
margin-top: 8px;
color: #646970;
font-size: 13px;
line-height: 1.6;
}
/* Form inputs enhancement */
.ticket-tailor-admin input[type="text"],
.ticket-tailor-admin input[type="number"],
.ticket-tailor-admin select {
border-radius: 4px;
border: 1px solid #c3c4c7;
font-size: 14px;
padding: 8px 12px;
transition: border-color 0.2s ease;
}
.ticket-tailor-admin input[type="text"]:focus,
.ticket-tailor-admin input[type="number"]:focus,
.ticket-tailor-admin select:focus {
border-color: #2271b1;
box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.08);
}
/* Checkbox styling */
.ticket-tailor-admin input[type="checkbox"] {
border-radius: 3px;
margin-right: 8px;
}
/* Code blocks in settings */
.ticket-tailor-admin code {
background: #f0f2f5;
padding: 4px 8px;
border-radius: 4px;
font-family: "Monaco", "Courier New", monospace;
font-size: 13px;
}
/* Submit buttons section */
.ticket-tailor-admin .submit {
padding: 20px 0;
margin: 20px 0 0;
border-top: 2px solid #f0f2f5;
background: white;
}
/* Cache management section styling */
.ticket-tailor-admin hr {
border: none;
border-top: 2px solid #f0f2f5;
margin: 30px 0;
}
.ticket-tailor-admin h2 {
font-size: 18px;
color: #1d2327;
margin: 30px 0 15px;
}
/* Notice boxes in settings */
.ticket-tailor_page_ticket-tailor-settings .notice {
border-radius: 8px;
margin: 15px 0;
padding: 12px 15px;
border-left-width: 4px;
}
/* Settings section cards (for Style tab preview, etc.) */
.ticket-tailor-admin .settings-section {
background: #f8f9fa;
border-radius: 8px;
padding: 20px;
margin: 20px 0;
}
/* Live preview section enhancement */
.ticket-tailor-admin h3 {
font-size: 16px;
color: #1d2327;
margin: 25px 0 15px;
font-weight: 600;
}
/* Colour Picker Enhancements */
.wp-picker-container {
display: inline-flex;
align-items: center;
gap: 10px;
}
.wp-picker-container .wp-color-result {
margin-bottom: 0;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
vertical-align: middle;
}
/* Hex value display - styled as inline text label */
.tt-hex-display {
display: inline-block;
padding: 6px 10px;
border-radius: 4px;
font-family: "Monaco", "Courier New", monospace;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.5px;
min-width: 70px;
text-align: center;
transition: all 0.2s ease;
vertical-align: middle;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Hide the default "Select Color" button text */
.wp-picker-container .wp-color-result .wp-color-result-text {
display: none;
}
/* Make the colour square more prominent */
.wp-picker-container .wp-color-result {
width: 40px;
height: 32px;
padding: 0;
border: 2px solid #c3c4c7;
}
.wp-picker-container .wp-color-result:hover {
border-color: #8c8f94;
}
.wp-picker-container .wp-color-result:after {
display: none; /* Remove the dropdown arrow */
}
/* Ensure proper alignment in form table */
.ticket-tailor-admin .form-table .wp-picker-container {
margin-top: 4px;
}
/* Default/Clear button styling - always visible */
.wp-picker-container .wp-picker-clear,
.wp-picker-container .wp-picker-default {
margin-left: 8px;
height: 32px;
line-height: 30px;
padding: 0 12px !important;
font-size: 13px;
border-radius: 4px;
vertical-align: middle;
display: inline-block !important;
visibility: visible !important;
opacity: 1 !important;
background: #f0f0f1;
color: #50575e;
border: 1px solid #c3c4c7;
text-decoration: none;
transition: all 0.2s ease;
}
.wp-picker-container .wp-picker-clear:hover,
.wp-picker-container .wp-picker-default:hover {
background: #e7e7e7;
border-color: #8c8f94;
color: #2c3338;
}
/* Ensure the clear button is always shown */
.wp-picker-container.wp-picker-active .wp-picker-clear,
.wp-picker-container:not(.wp-picker-active) .wp-picker-clear {
display: inline-block !important;
visibility: visible !important;
}
/* Iris colour picker popup positioning */
.wp-picker-container .wp-picker-holder {
position: absolute;
z-index: 100;
margin-top: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
border-radius: 4px;
overflow: hidden;
}
/* Loading States */
.tt-loading {
text-align: center;
padding: 2rem;
color: #646970;
}
.tt-loading::before {
content: "";
display: inline-block;
width: 20px;
height: 20px;
margin-right: 0.5rem;
border: 2px solid #2271b1;
border-radius: 50%;
border-top-color: transparent;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Notice Styles */
.ticket-tailor-admin .notice {
margin: 1rem 0;
border-radius: 4px;
}
.ticket-tailor-admin .notice-success {
border-left-color: #46b450;
}
.ticket-tailor-admin .notice-warning {
border-left-color: #ffb900;
}
.ticket-tailor-admin .notice-error {
border-left-color: #dc3232;
}
.ticket-tailor-admin .notice-info {
border-left-color: #2271b1;
}
/* Filter/Action Bar Above Tables */
.ticket-tailor-admin .tablenav {
margin: 1rem 0;
}
.ticket-tailor-admin .tablenav select {
border-radius: 4px;
font-size: 14px;
padding: 6px 24px 6px 8px;
border: 1px solid #8c8f94;
}
/* Responsive Styles */
@media (max-width: 1200px) {
.tt-stats-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 782px) {
.tt-stats-grid {
grid-template-columns: 1fr;
}
.tt-help-grid {
grid-template-columns: 1fr;
}
.tt-quick-actions .button-group {
flex-direction: column;
align-items: stretch; /* Make buttons full width on mobile */
}
.tt-quick-actions .button {
width: 100%;
text-align: center;
margin-bottom: 0.5rem;
}
.tt-quick-actions .button:last-child {
margin-bottom: 0;
}
/* Settings page mobile adjustments */
.ticket-tailor_page_ticket-tailor-settings .wrap {
padding: 20px;
border-radius: 0;
margin: 0;
}
.ticket-tailor-admin .nav-tab-wrapper {
display: flex;
flex-direction: column;
padding: 6px;
gap: 6px;
}
.ticket-tailor-admin .nav-tab {
display: block;
text-align: center;
margin: 0;
padding: 12px;
width: 100%;
}
.ticket-tailor-admin .form-table th,
.ticket-tailor-admin .form-table td {
display: block;
width: 100%;
padding: 15px 0;
}
.ticket-tailor-admin .form-table th {
font-weight: 600;
padding-bottom: 8px;
}
}
@media (max-width: 600px) {
.tt-stat-value {
font-size: 2rem;
}
.tt-dashboard-section {
padding: 1rem;
}
.ticket-tailor-admin .wp-list-table {
font-size: 0.85rem;
}
.ticket-tailor-admin .wp-list-table td {
padding: 8px 5px;
}
/* Ensure buttons remain readable on very small screens */
.ticket-tailor-admin .button {
font-size: 13px !important;
padding: 7px 14px !important;
}
}
/* Accessibility Improvements */
.ticket-tailor-admin a:focus,
.ticket-tailor-admin button:focus,
.ticket-tailor-admin input:focus,
.ticket-tailor-admin select:focus,
.ticket-tailor-admin textarea:focus {
outline: 2px solid #2271b1;
outline-offset: 2px;
}
.ticket-tailor-admin .button:focus {
box-shadow:
0 0 0 2px #fff,
0 0 0 4px #2271b1 !important;
}
.screen-reader-text {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
padding: 0 !important;
border: 0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
/* Print Styles */
@media print {
.ticket-tailor-admin .button,
.ticket-tailor-admin .nav-tab-wrapper,
.tt-quick-actions {
display: none;
}
.tt-stat-card {
break-inside: avoid;
}
}
/* Fix for WordPress admin bar overlap */
.ticket-tailor-admin {
margin-top: 0;
}
/* Ensure proper spacing in admin area */
.wrap.ticket-tailor-admin {
margin-right: 20px;
}

View file

@ -0,0 +1,605 @@
/**
* Ticket Tailor - Frontend Styles
* Version: 4.0.0 - White background for image areas
* This version fixes stretched/cut-off logos while maintaining layout
*/
/* ============================================
CRITICAL OVERRIDES - FORCE 220px CARDS
============================================ */
/* Override ALL grid layouts with inline styles */
.tt-event-listing.tt-layout-grid,
.tt-event-listing.tt-layout-grid.tt-columns-3,
.tt-event-listing.tt-layout-grid[style*="grid-template-columns"],
.tt-event-listing.tt-columns-responsive {
display: grid !important;
grid-template-columns: repeat(auto-fit, 220px) !important;
gap: 3rem !important;
justify-content: center !important;
align-items: stretch !important;
grid-auto-rows: 1fr !important;
max-width: 100% !important;
}
/* Force specific column counts */
.tt-event-listing.tt-layout-grid.tt-columns-4 {
grid-template-columns: repeat(4, 220px) !important;
}
.tt-event-listing.tt-layout-grid.tt-columns-3 {
grid-template-columns: repeat(3, 220px) !important;
}
.tt-event-listing.tt-layout-grid.tt-columns-2 {
grid-template-columns: repeat(2, 220px) !important;
}
/* Force card width */
.tt-event-card {
width: 220px !important;
max-width: 220px !important;
min-width: 220px !important;
display: flex !important;
flex-direction: column !important;
background: #ffffff !important;
border: 1px solid #e1e1e1 !important;
border-radius: 12px !important;
overflow: hidden !important;
transition: all 0.3s ease !important;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
height: 100% !important;
}
.tt-event-card:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
transform: translateY(-2px) !important;
border-color: #d1d1d1 !important;
}
/* Force image container width - with white background */
.tt-event-image {
width: 220px !important;
max-width: 220px !important;
height: 147px !important;
position: relative !important;
overflow: hidden !important;
background: #ffffff !important; /* White background for empty space */
flex: 0 0 auto !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
/* FIXED: Use contain for thumbnails to prevent cropping */
.tt-event-image.tt-image-thumbnail img {
width: auto !important;
height: auto !important;
max-width: 100% !important;
max-height: 100% !important;
object-fit: contain !important; /* Changed from cover to contain */
object-position: center !important;
display: block !important;
transition: transform 0.3s ease !important;
padding: 10px !important; /* Add breathing room for logos */
}
/* Keep cover for header/banner images */
.tt-event-image.tt-image-header img {
width: 100% !important;
height: 100% !important;
object-fit: cover !important; /* Keep cover for banner images */
object-position: center !important;
display: block !important;
transition: transform 0.3s ease !important;
padding: 0 !important; /* No padding for banner images */
}
/* Default for images without specific class */
.tt-event-image img {
width: auto !important;
height: auto !important;
max-width: 100% !important;
max-height: 100% !important;
object-fit: contain !important; /* Default to contain */
object-position: center !important;
display: block !important;
transition: transform 0.3s ease !important;
padding: 10px !important;
}
.tt-event-card:hover .tt-event-image img {
transform: scale(1.05) !important;
}
/* Force content width */
.tt-event-content {
width: 220px !important;
max-width: 220px !important;
display: flex !important;
flex-direction: column !important;
padding: 0.875rem !important;
flex: 1 !important;
box-sizing: border-box !important;
}
/* ============================================
EVENT LISTING STYLES
============================================ */
.tt-event-listing {
margin: 2rem auto;
max-width: 100%;
}
/* Event Listing Wrapper */
.tt-event-listing-wrapper {
width: 100%;
max-width: 100%;
overflow-x: hidden;
}
/* Full Width Wrapper */
.tt-full-width {
width: 100%;
max-width: 100%;
overflow-x: hidden;
}
.tt-full-width .tt-event-listing {
max-width: 100%;
padding: 0 1rem;
}
/* List Layout */
.tt-event-listing.tt-layout-list {
display: flex !important;
flex-direction: column !important;
gap: 1.5rem !important;
align-items: center !important;
}
.tt-event-listing.tt-layout-list .tt-event-card {
display: grid !important;
grid-template-columns: 220px 1fr !important;
gap: 1.5rem !important;
max-width: 900px !important;
width: 100% !important;
}
/* List layout images should also use contain */
.tt-event-listing.tt-layout-list .tt-event-image img {
object-fit: contain !important;
padding: 10px !important;
}
/* ============================================
EVENT CONTENT ELEMENTS
============================================ */
/* Event Title */
.tt-event-title {
margin: 0 0 0.625rem 0 !important;
font-size: 1rem !important;
line-height: 1.3 !important;
color: #2c3e50 !important;
font-weight: 600 !important;
display: -webkit-box !important;
-webkit-line-clamp: 2 !important;
-webkit-box-orient: vertical !important;
overflow: hidden !important;
}
/* Date and Venue */
.tt-event-date,
.tt-event-venue {
display: flex !important;
align-items: flex-start !important;
margin-bottom: 0.4rem !important;
font-size: 0.85rem !important;
color: #666 !important;
line-height: 1.3 !important;
}
.tt-event-date .dashicons,
.tt-event-venue .dashicons {
margin-right: 0.375rem !important;
color: #2271b1 !important;
flex-shrink: 0 !important;
width: 14px !important;
height: 14px !important;
font-size: 14px !important;
margin-top: 1px !important;
}
/* Spacer to push button down */
.tt-event-content::before {
content: "" !important;
flex: 1 !important;
min-height: 0.25rem !important;
}
/* Hide PHP spacer */
.tt-event-spacer {
display: none !important;
}
/* Button Container */
.tt-event-button-container {
margin-top: auto !important;
padding-top: 0.625rem !important;
text-align: center !important; /* Center the button */
}
/* Event Button */
.tt-event-button,
a.tt-event-button {
display: inline-block !important;
width: auto !important; /* Auto width instead of 100% */
padding: 0.75rem 1.5rem !important; /* Padding determines size */
background: #2271b1 !important;
color: #ffffff !important;
text-decoration: none !important;
text-align: center !important;
border-radius: 6px !important;
font-weight: 700 !important; /* Bold text */
font-size: 1rem !important; /* Larger text */
transition: all 0.3s ease !important;
border: none !important;
cursor: pointer !important;
white-space: nowrap !important; /* Prevent text wrapping */
}
.tt-event-button:hover,
a.tt-event-button:hover {
background: #135e96 !important;
color: #ffffff !important;
transform: translateY(-1px) !important;
box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3) !important;
}
/* Event excerpt (list view only) */
.tt-event-excerpt {
font-size: 0.875rem !important;
color: #666 !important;
line-height: 1.4 !important;
margin-bottom: 0.75rem !important;
display: -webkit-box !important;
-webkit-line-clamp: 2 !important;
-webkit-box-orient: vertical !important;
overflow: hidden !important;
}
/* ============================================
SINGLE EVENT STYLES
============================================ */
.tt-single-event {
background: #fff;
border: 1px solid #e1e1e1;
border-radius: 12px;
overflow: hidden;
margin: 2rem 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.tt-single-event-wrapper {
margin: 2rem 0;
}
.tt-event-header-image {
width: 100%;
max-height: 400px;
overflow: hidden;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
/* Single event header images can use cover */
.tt-event-header-image img {
width: 100%;
height: auto;
display: block;
object-fit: cover; /* Keep cover for single event headers */
}
.tt-event-details {
padding: 2rem;
}
.tt-event-details .tt-event-title {
font-size: 2rem;
margin-bottom: 1.5rem;
color: #2c3e50;
}
.tt-event-meta {
display: flex;
flex-direction: column;
gap: 1rem;
margin-bottom: 2rem;
padding: 1.5rem;
background: #f8f9fa;
border-radius: 8px;
}
.tt-meta-item {
display: flex;
align-items: flex-start;
gap: 0.75rem;
color: #666;
}
.tt-meta-item strong {
font-weight: 600;
color: #333;
}
.tt-event-description {
font-size: 1rem;
line-height: 1.6;
color: #444;
margin-bottom: 2rem;
}
.tt-event-description p {
margin-bottom: 1rem;
}
.tt-event-cta {
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid #e1e1e1;
text-align: center;
}
.tt-button {
display: inline-block;
padding: 1rem 2rem;
background: #971320;
color: #fff;
text-decoration: none;
border-radius: 6px;
font-weight: 600;
font-size: 1.1rem;
transition: all 0.3s ease;
}
.tt-button:hover {
background: #dd1c3d;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}
/* ============================================
WORDPRESS BLOCK SUPPORT
============================================ */
.wp-block-ticket-tailor-event-listing,
.wp-block-ticket-tailor-single-event,
.wp-block-ticket-tailor-category-events {
margin: 2rem 0;
}
.alignfull .tt-event-listing {
padding: 0 2rem;
}
/* ============================================
STATUS, ERROR & WIDGET STYLES
============================================ */
.tt-status {
display: inline-block;
padding: 0.25rem 0.75rem;
border-radius: 4px;
font-size: 0.85rem;
font-weight: 500;
text-transform: uppercase;
}
.tt-status-on_sale {
background: #d4f4dd;
color: #1e7e34;
}
.tt-status-sold_out {
background: #f8d7da;
color: #721c24;
}
.tt-status-cancelled {
background: #e7e7e7;
color: #666;
}
.tt-status-postponed {
background: #fff3cd;
color: #856404;
}
.tt-error,
.tt-no-events {
padding: 2rem;
text-align: center;
background: #f8f9fa;
border: 1px solid #e1e1e1;
border-radius: 8px;
color: #666;
margin: 2rem 0;
}
.tt-error {
background: #f8d7da;
color: #721c24;
border-color: #f5c6cb;
}
.tt-block-placeholder {
padding: 2rem;
background: #f8f9fa;
border: 2px dashed #dee2e6;
border-radius: 8px;
text-align: center;
color: #6c757d;
font-style: italic;
}
.tt-widget-block {
margin: 2rem 0;
}
.tt-widget-error {
padding: 1rem;
background: #f8d7da;
color: #721c24;
border-radius: 4px;
text-align: center;
}
/* ============================================
CATEGORY EVENTS
============================================ */
.tt-category-events-wrapper {
margin: 2rem 0;
}
.tt-category-header {
text-align: center;
margin-bottom: 2rem;
}
.tt-category-title {
font-size: 2rem;
color: #2c3e50;
margin: 0;
}
/* ============================================
RESPONSIVE DESIGN
============================================ */
@media (max-width: 1200px) {
.tt-event-listing.tt-layout-grid.tt-columns-5 {
grid-template-columns: repeat(4, 220px) !important;
}
}
@media (max-width: 1024px) {
.tt-event-listing.tt-layout-grid.tt-columns-4,
.tt-event-listing.tt-layout-grid.tt-columns-3 {
grid-template-columns: repeat(3, 220px) !important;
}
}
@media (max-width: 768px) {
.tt-event-listing.tt-layout-grid.tt-columns-5,
.tt-event-listing.tt-layout-grid.tt-columns-4,
.tt-event-listing.tt-layout-grid.tt-columns-3 {
grid-template-columns: repeat(2, 220px) !important;
}
.tt-event-listing.tt-layout-list .tt-event-card {
grid-template-columns: 1fr !important;
width: 100% !important;
}
}
@media (max-width: 576px) {
.tt-event-listing.tt-layout-grid {
grid-template-columns: 220px !important;
justify-content: center !important;
}
}
@media (max-width: 400px) {
.tt-event-title {
font-size: 0.95rem !important;
}
.tt-event-date,
.tt-event-venue {
font-size: 0.8rem !important;
}
.tt-event-button {
padding: 0.5rem 0.875rem !important;
font-size: 0.85rem !important;
}
}
/* ============================================
UTILITY CLASSES
============================================ */
.tt-loading {
text-align: center;
padding: 3rem;
color: #666;
}
.tt-loading::after {
content: "";
display: inline-block;
width: 20px;
height: 20px;
margin-left: 0.5rem;
border: 2px solid #ddd;
border-top-color: #2271b1;
border-radius: 50%;
animation: tt-spin 0.8s linear infinite;
}
@keyframes tt-spin {
to {
transform: rotate(360deg);
}
}
.tt-centered {
max-width: 1200px;
margin-left: auto;
margin-right: auto;
padding: 0 1rem;
}
/* ============================================
ACCESSIBILITY
============================================ */
.tt-event-button:focus,
.tt-button:focus,
.tt-event-card:focus-within {
outline: 2px solid #2271b1;
outline-offset: 2px;
}
.screen-reader-text,
.tt-sr-only {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important;
}
/* ============================================
PRINT STYLES
============================================ */
@media print {
.tt-event-button,
.tt-button,
.tt-widget-block {
display: none;
}
.tt-event-listing.tt-layout-grid {
grid-template-columns: repeat(3, 220px) !important;
}
.tt-event-card {
break-inside: avoid;
box-shadow: none;
border: 1px solid #ddd;
}
}

View file

@ -0,0 +1,2 @@
<?php
// Silence is golden.

View file

@ -0,0 +1,288 @@
/**
* Ticket Tailor - Frontend Styles
*/
/* Event Listing Styles */
.tt-event-listing {
margin: 2rem 0;
}
.tt-event-listing.tt-layout-grid {
display: grid;
gap: 2rem;
}
.tt-event-listing.tt-columns-2 {
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.tt-event-listing.tt-columns-3 {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.tt-event-listing.tt-columns-4 {
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.tt-event-listing.tt-layout-list .tt-event-card {
margin-bottom: 2rem;
}
/* Event Card */
.tt-event-card {
background: #fff;
border: 1px solid #e1e1e1;
border-radius: 8px;
overflow: hidden;
transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.tt-event-card:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
.tt-event-image {
position: relative;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
overflow: hidden;
background: #f5f5f5;
}
.tt-event-image img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.tt-event-content {
padding: 1.5rem;
}
.tt-event-title {
margin: 0 0 1rem;
font-size: 1.25rem;
font-weight: 600;
line-height: 1.4;
color: #111;
}
.tt-event-date,
.tt-event-venue {
display: flex;
align-items: center;
margin-bottom: 0.75rem;
font-size: 0.9rem;
color: #666;
}
.tt-event-date .dashicons,
.tt-event-venue .dashicons {
margin-right: 0.5rem;
color: #2271b1;
}
.tt-event-excerpt {
margin-bottom: 1rem;
color: #555;
line-height: 1.6;
}
.tt-event-button {
display: inline-block;
padding: 0.75rem 1.5rem;
background: #2271b1;
color: #fff !important;
text-decoration: none;
border-radius: 4px;
font-weight: 500;
transition: background 0.3s ease;
}
.tt-event-button:hover {
background: #135e96;
}
/* Single Event Styles */
.tt-single-event {
margin: 2rem 0;
}
.tt-event-header-image {
margin-bottom: 2rem;
border-radius: 8px;
overflow: hidden;
}
.tt-event-header-image img {
width: 100%;
height: auto;
display: block;
}
.tt-event-details {
max-width: 800px;
}
.tt-event-details .tt-event-title {
font-size: 2rem;
margin-bottom: 1.5rem;
}
.tt-event-meta {
margin-bottom: 2rem;
padding: 1.5rem;
background: #f8f9fa;
border-radius: 8px;
}
.tt-meta-item {
display: flex;
align-items: flex-start;
margin-bottom: 1rem;
font-size: 0.95rem;
}
.tt-meta-item:last-child {
margin-bottom: 0;
}
.tt-meta-item .dashicons {
margin-right: 0.75rem;
margin-top: 0.1rem;
color: #2271b1;
}
.tt-meta-item strong {
margin-right: 0.5rem;
}
.tt-event-description {
margin-bottom: 2rem;
line-height: 1.8;
color: #333;
}
.tt-event-description p {
margin-bottom: 1rem;
}
.tt-event-cta {
margin-top: 2rem;
}
.tt-button {
display: inline-block;
padding: 1rem 2rem;
text-decoration: none;
border-radius: 6px;
font-weight: 600;
font-size: 1rem;
transition: all 0.3s ease;
}
.tt-button-primary {
background: #2271b1;
color: #fff !important;
}
.tt-button-primary:hover {
background: #135e96;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}
/* Status Badges */
.tt-status {
display: inline-block;
padding: 0.25rem 0.75rem;
border-radius: 12px;
font-size: 0.85rem;
font-weight: 500;
}
.tt-status[class*="live"] {
background: #d1f4e0;
color: #0f5132;
}
.tt-status[class*="draft"] {
background: #f8d7da;
color: #721c24;
}
/* Error & Empty States */
.tt-error,
.tt-no-events {
padding: 1.5rem;
background: #fff3cd;
border: 1px solid #ffc107;
border-radius: 6px;
color: #856404;
text-align: center;
}
.tt-error {
background: #f8d7da;
border-color: #f5c2c7;
color: #721c24;
}
.tt-widget-error {
padding: 1rem;
background: #f8d7da;
border: 1px solid #f5c2c7;
border-radius: 4px;
color: #721c24;
}
/* Widget Container */
.tt-widget-container {
margin: 2rem 0;
}
/* Responsive Styles */
@media (max-width: 768px) {
.tt-event-listing.tt-layout-grid {
grid-template-columns: 1fr;
}
.tt-event-details .tt-event-title {
font-size: 1.5rem;
}
.tt-button {
display: block;
text-align: center;
}
}
/* Loading State */
.tt-loading {
text-align: center;
padding: 2rem;
color: #666;
}
.tt-loading::after {
content: "⏳";
margin-left: 0.5rem;
}
/* Accessibility */
.tt-event-button:focus,
.tt-button:focus {
outline: 2px solid #2271b1;
outline-offset: 2px;
}
/* Print Styles */
@media print {
.tt-event-button,
.tt-button {
display: none;
}
}

View file

@ -0,0 +1,2 @@
<?php
// Silence is golden.

View file

@ -0,0 +1,399 @@
/**
* Ticket Tailor Admin Scripts
* Version: 3.0 - Enhanced with Color Picker Improvements
*/
(function ($) {
"use strict";
$(document).ready(function () {
// ===========================
// EXISTING FUNCTIONALITY
// ===========================
// Confirm actions
$(".tt-confirm-action").on("click", function (e) {
if (!confirm(ticketTailorAdmin.confirmMessage || "Are you sure?")) {
e.preventDefault();
return false;
}
});
// Test API connection
$("#tt-test-api").on("click", function (e) {
e.preventDefault();
const $button = $(this);
const $status = $("#tt-api-status");
$button.prop("disabled", true).text("Testing...");
$status.removeClass("success error").text("");
$.ajax({
url: ticketTailorAdmin.ajaxUrl,
type: "POST",
data: {
action: "ticket_tailor_test_api",
nonce: ticketTailorAdmin.nonce,
},
success: function (response) {
if (response.success) {
$status.addClass("success").text("✔ API connection successful!");
} else {
$status
.addClass("error")
.text("✗ API connection failed: " + response.data);
}
},
error: function () {
$status.addClass("error").text("✗ Connection error");
},
complete: function () {
$button.prop("disabled", false).text("Test Connection");
},
});
});
// Auto-dismiss notices
setTimeout(function () {
$(".notice.is-dismissible").fadeOut();
}, 5000);
// Sync progress indicators
$(".tt-sync-button").on("click", function () {
$(this)
.prop("disabled", true)
.html(
'<span class="dashicons dashicons-update spin"></span> Syncing...',
);
});
// Table row actions
$(".tt-row-actions a").on("click", function (e) {
const action = $(this).data("action");
if (
action === "delete" &&
!confirm("Are you sure you want to delete this item?")
) {
e.preventDefault();
}
});
// ===========================
// ENHANCED COLOR PICKER
// ===========================
// Function to calculate relative luminance for contrast ratio
function getLuminance(hexColor) {
// Convert hex to RGB
const hex = hexColor.replace("#", "");
const r = parseInt(hex.substr(0, 2), 16) / 255;
const g = parseInt(hex.substr(2, 2), 16) / 255;
const b = parseInt(hex.substr(4, 2), 16) / 255;
// Apply gamma correction
const gammaCorrect = (channel) => {
return channel <= 0.03928
? channel / 12.92
: Math.pow((channel + 0.055) / 1.055, 2.4);
};
const rLinear = gammaCorrect(r);
const gLinear = gammaCorrect(g);
const bLinear = gammaCorrect(b);
// Calculate relative luminance
return 0.2126 * rLinear + 0.7152 * gLinear + 0.0722 * bLinear;
}
// Function to determine if white or black text is more readable
function getContrastColor(hexColor) {
const luminance = getLuminance(hexColor);
// Use white text for dark colors, black for light colors
return luminance > 0.5 ? "#000000" : "#ffffff";
}
// Function to format and display hex value with proper contrast
function updateHexDisplay($input, color) {
const $container = $input.closest(".wp-picker-container");
let $hexDisplay = $container.find(".tt-hex-display");
// Create hex display if it doesn't exist
if ($hexDisplay.length === 0) {
$hexDisplay = $('<span class="tt-hex-display"></span>');
// Find the color picker button and insert after it
const $colorButton = $container.find(".wp-color-result");
$hexDisplay.insertAfter($colorButton);
}
// Update hex value and text color
$hexDisplay.text(color.toUpperCase());
const contrastColor = getContrastColor(color);
$hexDisplay.css("color", contrastColor);
// Update background to match the selected color for visual context
$hexDisplay.css("background-color", color);
}
// Initialize color pickers with enhanced functionality
if ($(".tt-color-picker").length > 0) {
$(".tt-color-picker").each(function () {
const $this = $(this);
const currentColor = $this.val() || $this.data("default-color");
// Initialize WordPress color picker
$this.wpColorPicker({
change: function (event, ui) {
const color = ui.color.toString();
const field = $(this).attr("id");
// Update hex display
updateHexDisplay($(this), color);
// Update preview in real-time
if (field === "text_color") {
$(".preview-title, .preview-description, .preview-venue").css(
"color",
color,
);
} else if (field === "border_color") {
$(".tt-preview-card").css("border-color", color);
} else if (field === "button_bg") {
$(".tt-preview-button").css("background-color", color);
} else if (field === "button_text") {
$(".tt-preview-button").css("color", color);
} else if (field === "button_hover") {
// Store hover color for later use
$(".tt-preview-button").data("hover-color", color);
}
},
clear: function () {
const field = $(this).attr("id");
const defaultColor = $(this).data("default-color");
// Update hex display with default color
updateHexDisplay($(this), defaultColor);
// Reset preview to default colors
if (field === "text_color") {
$(".preview-title, .preview-description, .preview-venue").css(
"color",
defaultColor,
);
} else if (field === "border_color") {
$(".tt-preview-card").css("border-color", defaultColor);
} else if (field === "button_bg") {
$(".tt-preview-button").css("background-color", defaultColor);
} else if (field === "button_text") {
$(".tt-preview-button").css("color", defaultColor);
} else if (field === "button_hover") {
$(".tt-preview-button").data("hover-color", defaultColor);
}
},
});
// Initialize hex display for existing colors
if (currentColor) {
updateHexDisplay($this, currentColor);
}
});
// Handle border radius preview in real-time
$("#border_radius").on("input", function () {
const radius = $(this).val();
$(".tt-preview-card").css("border-radius", radius + "px");
});
// Button hover effect for preview
let originalBg =
$("#button_bg").val() || $("#button_bg").data("default-color");
let hoverBg =
$("#button_hover").val() || $("#button_hover").data("default-color");
$(".tt-preview-button").hover(
function () {
const currentHover = $("#button_hover").val() || hoverBg;
$(this).css("background-color", currentHover);
},
function () {
const currentBg = $("#button_bg").val() || originalBg;
$(this).css("background-color", currentBg);
},
);
// Update hover colors when changed
$("#button_hover").on("change", function () {
hoverBg = $(this).val();
updateHexDisplay($(this), hoverBg);
});
$("#button_bg").on("change", function () {
originalBg = $(this).val();
updateHexDisplay($(this), originalBg);
});
// Also update hex display when color picker is opened/closed
$(".wp-color-result").on("click", function () {
const $input = $(this)
.closest(".wp-picker-container")
.find(".tt-color-picker");
const currentColor = $input.val() || $input.data("default-color");
if (currentColor) {
updateHexDisplay($input, currentColor);
}
});
}
// ===========================
// DASHBOARD ENHANCEMENTS
// ===========================
// Add smooth scrolling for anchor links
$('a[href^="#"]').on("click", function (e) {
const target = $(this.getAttribute("href"));
if (target.length) {
e.preventDefault();
$("html, body")
.stop()
.animate(
{
scrollTop: target.offset().top - 40,
},
800,
);
}
});
// Enhanced loading states
$(".button").on("click", function () {
const $btn = $(this);
if ($btn.hasClass("tt-ajax-button")) {
$btn.addClass("tt-loading");
}
});
// AJAX complete handler to remove loading states
$(document).ajaxComplete(function (event, xhr, settings) {
$(".tt-loading").removeClass("tt-loading");
});
// ===========================
// ACCESSIBILITY ENHANCEMENTS
// ===========================
// Add keyboard navigation support for custom elements
$(".tt-stat-card, .tt-help-section").attr("tabindex", "0");
// PERFORMANCE FIX: Use event delegation instead of direct binding
// This prevents memory leaks when elements are dynamically added/removed
$(document)
.on("focus", "a, button, input, select, textarea", function () {
$(this).addClass("has-focus");
})
.on("blur", "a, button, input, select, textarea", function () {
$(this).removeClass("has-focus");
});
// ===========================
// RESPONSIVE IMPROVEMENTS
// ===========================
// Handle responsive table display
function checkTableResponsive() {
$(".wp-list-table").each(function () {
const $table = $(this);
const tableWidth = $table.width();
const containerWidth = $table.parent().width();
if (tableWidth > containerWidth) {
$table.addClass("tt-responsive-table");
} else {
$table.removeClass("tt-responsive-table");
}
});
}
// Check on load and resize
checkTableResponsive();
$(window).on("resize debounce", checkTableResponsive);
// ===========================
// FORM VALIDATION
// ===========================
// Basic form validation for settings
$("form").on("submit", function () {
let isValid = true;
// Check required fields
$(this)
.find("[required]")
.each(function () {
if (!$(this).val()) {
$(this).addClass("error");
isValid = false;
} else {
$(this).removeClass("error");
}
});
// Validate API key format (if present)
const $apiKey = $("#api_key");
if ($apiKey.length && $apiKey.val()) {
// Basic validation - ensure it's not just whitespace
if ($apiKey.val().trim().length < 10) {
$apiKey.addClass("error");
isValid = false;
}
}
if (!isValid) {
// Show error message
if (!$(".tt-validation-error").length) {
$(
'<div class="notice notice-error tt-validation-error"><p>Please fill in all required fields correctly.</p></div>',
)
.insertBefore(this)
.delay(3000)
.fadeOut(function () {
$(this).remove();
});
}
return false;
}
});
// Remove error class on input
$("input, select, textarea").on("input change", function () {
$(this).removeClass("error");
});
// ===========================
// UTILITY FUNCTIONS
// ===========================
// Debounce function for performance
function debounce(func, wait, immediate) {
let timeout;
return function () {
const context = this,
args = arguments;
const later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
const callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}
// Add debounced resize event
$(window).on(
"resize",
debounce(function () {
$(window).trigger("resize.debounce");
}, 250),
);
});
})(jQuery);

View file

@ -0,0 +1,719 @@
/**
* Ticket Tailor Gutenberg Blocks
* Enhanced with full-width control and dynamic columns
*/
(function (wp) {
const { registerBlockType } = wp.blocks;
const { InspectorControls, BlockControls, AlignmentToolbar } = wp.blockEditor;
const { PanelBody, TextControl, ToggleControl, SelectControl, RangeControl } =
wp.components;
const { __ } = wp.i18n;
const { createElement: el, Fragment } = wp.element;
// Block 1: Event Widget (Original)
registerBlockType("ticket-tailor/event-widget", {
title: __("Ticket Tailor Event Widget", "ticket-tailor"),
description: __("Embed a Ticket Tailor event widget", "ticket-tailor"),
icon: "tickets-alt",
category: "embed",
keywords: [
__("ticket", "ticket-tailor"),
__("event", "ticket-tailor"),
__("ticketing", "ticket-tailor"),
],
supports: {
align: ["wide", "full"],
},
attributes: {
url: { type: "string", default: "" },
minimal: { type: "boolean", default: false },
bgFill: { type: "boolean", default: true },
showLogo: { type: "boolean", default: true },
ref: { type: "string", default: "website_widget" },
},
edit: function (props) {
const { attributes, setAttributes } = props;
const { url, minimal, bgFill, showLogo, ref } = attributes;
return el(
Fragment,
{},
el(
InspectorControls,
{},
el(
PanelBody,
{
title: __("Widget Settings", "ticket-tailor"),
initialOpen: true,
},
el(ToggleControl, {
label: __("Minimal Design", "ticket-tailor"),
checked: minimal,
onChange: (value) => setAttributes({ minimal: value }),
}),
el(ToggleControl, {
label: __("Background Fill", "ticket-tailor"),
checked: bgFill,
onChange: (value) => setAttributes({ bgFill: value }),
}),
el(ToggleControl, {
label: __("Show Logo", "ticket-tailor"),
checked: showLogo,
onChange: (value) => setAttributes({ showLogo: value }),
}),
el(TextControl, {
label: __("Tracking Reference", "ticket-tailor"),
value: ref,
onChange: (value) => setAttributes({ ref: value }),
}),
),
),
el(
"div",
{
className: "tt-block-placeholder",
style: {
border: "2px dashed #ccc",
padding: "40px",
textAlign: "center",
background: "#f9f9f9",
},
},
el("span", {
className: "dashicons dashicons-tickets-alt",
style: { fontSize: "48px", color: "#666" },
}),
!url
? el(
"div",
{},
el(
"p",
{ style: { marginBottom: "15px" } },
__("Ticket Tailor Event Widget", "ticket-tailor"),
),
el(TextControl, {
label: __("Event URL", "ticket-tailor"),
placeholder: "https://www.tickettailor.com/events/...",
value: url,
onChange: (value) => setAttributes({ url: value }),
}),
)
: el(
"div",
{},
el("p", {}, __("Widget URL configured", "ticket-tailor")),
el(
"button",
{
className: "button",
onClick: () => setAttributes({ url: "" }),
},
__("Change URL", "ticket-tailor"),
),
),
),
);
},
save: function () {
return null;
},
});
// Block 2: Event Listing - ENHANCED WITH FULL WIDTH OPTIONS
registerBlockType("ticket-tailor/event-listing", {
title: __("Event Listing", "ticket-tailor"),
description: __("Display a list of events", "ticket-tailor"),
icon: "calendar-alt",
category: "widgets",
keywords: [
__("events", "ticket-tailor"),
__("listing", "ticket-tailor"),
__("calendar", "ticket-tailor"),
],
supports: {
align: ["wide", "full"],
customClassName: true,
},
attributes: {
limit: { type: "number", default: 10 },
layout: { type: "string", default: "grid" },
columns: { type: "number", default: 3 },
columnsMode: { type: "string", default: "fixed" }, // 'fixed' or 'responsive'
showPast: { type: "boolean", default: false },
showImage: { type: "boolean", default: true },
imageType: { type: "string", default: "header" },
fullWidth: { type: "boolean", default: true },
maxCardWidth: { type: "string", default: "none" }, // 'none', 'small', 'medium', 'large'
},
edit: function (props) {
const { attributes, setAttributes, className } = props;
const {
limit,
layout,
columns,
columnsMode,
showPast,
showImage,
imageType,
fullWidth,
maxCardWidth,
} = attributes;
return el(
Fragment,
{},
el(
InspectorControls,
{},
el(
PanelBody,
{
title: __("Layout Settings", "ticket-tailor"),
initialOpen: true,
},
el(SelectControl, {
label: __("Layout", "ticket-tailor"),
value: layout,
options: [
{ label: __("Grid", "ticket-tailor"), value: "grid" },
{ label: __("List", "ticket-tailor"), value: "list" },
],
onChange: (value) => setAttributes({ layout: value }),
}),
layout === "grid" &&
el(
Fragment,
{},
el(SelectControl, {
label: __("Columns Mode", "ticket-tailor"),
value: columnsMode,
options: [
{
label: __("Fixed Columns", "ticket-tailor"),
value: "fixed",
},
{
label: __("Responsive (Auto-fit)", "ticket-tailor"),
value: "responsive",
},
],
onChange: (value) => setAttributes({ columnsMode: value }),
help: __(
"Responsive mode automatically adjusts columns based on available space",
"ticket-tailor",
),
}),
el(RangeControl, {
label:
columnsMode === "fixed"
? __("Number of Columns", "ticket-tailor")
: __("Maximum Columns", "ticket-tailor"),
value: columns,
onChange: (value) => setAttributes({ columns: value }),
min: 1,
max: 5,
help:
columnsMode === "responsive"
? __(
"In responsive mode, columns will adjust automatically but won't exceed this number",
"ticket-tailor",
)
: null,
}),
el(SelectControl, {
label: __("Maximum Card Width", "ticket-tailor"),
value: maxCardWidth,
options: [
{
label: __("No Limit (Full Width)", "ticket-tailor"),
value: "none",
},
{
label: __("Small (300px)", "ticket-tailor"),
value: "small",
},
{
label: __("Medium (400px)", "ticket-tailor"),
value: "medium",
},
{
label: __("Large (500px)", "ticket-tailor"),
value: "large",
},
],
onChange: (value) => setAttributes({ maxCardWidth: value }),
help: __(
"Set a maximum width for individual event cards",
"ticket-tailor",
),
}),
),
el(ToggleControl, {
label: __("Full Width Container", "ticket-tailor"),
checked: fullWidth,
onChange: (value) => setAttributes({ fullWidth: value }),
help: __(
"Make the event listing fill the width of its container",
"ticket-tailor",
),
}),
),
el(
PanelBody,
{
title: __("Display Settings", "ticket-tailor"),
initialOpen: false,
},
el(RangeControl, {
label: __("Number of Events", "ticket-tailor"),
value: limit,
onChange: (value) => setAttributes({ limit: value }),
min: 1,
max: 50,
}),
el(ToggleControl, {
label: __("Show Past Events", "ticket-tailor"),
checked: showPast,
onChange: (value) => setAttributes({ showPast: value }),
}),
el(ToggleControl, {
label: __("Show Event Images", "ticket-tailor"),
checked: showImage,
onChange: (value) => setAttributes({ showImage: value }),
}),
showImage &&
el(SelectControl, {
label: __("Image Type", "ticket-tailor"),
value: imageType,
options: [
{
label: __("Thumbnail (Square)", "ticket-tailor"),
value: "thumbnail",
},
{
label: __("Banner (16:9)", "ticket-tailor"),
value: "header",
},
],
onChange: (value) => setAttributes({ imageType: value }),
}),
),
),
el(
"div",
{
className: "tt-block-placeholder",
style: {
border: "2px dashed #ccc",
padding: "40px",
textAlign: "center",
background: "#f9f9f9",
width: fullWidth ? "100%" : "auto",
},
},
el("span", {
className: "dashicons dashicons-calendar-alt",
style: { fontSize: "48px", color: "#666" },
}),
el(
"p",
{
style: {
fontSize: "16px",
fontWeight: "bold",
marginBottom: "10px",
},
},
__("Event Listing", "ticket-tailor"),
),
el(
"p",
{ style: { fontSize: "14px", color: "#666" } },
__("Showing ", "ticket-tailor") +
limit +
__(" events", "ticket-tailor"),
),
el(
"p",
{ style: { fontSize: "13px", color: "#888", marginTop: "10px" } },
layout === "grid"
? columnsMode === "responsive"
? __("Responsive grid with max ", "ticket-tailor") +
columns +
__(" columns", "ticket-tailor")
: columns + __(" column grid", "ticket-tailor")
: __("List layout", "ticket-tailor"),
),
fullWidth &&
el(
"p",
{
style: { fontSize: "12px", color: "#2271b1", marginTop: "5px" },
},
__("✓ Full width enabled", "ticket-tailor"),
),
),
);
},
save: function () {
return null;
},
});
// Block 3: Single Event - ENHANCED WITH WIDTH OPTIONS
registerBlockType("ticket-tailor/single-event", {
title: __("Single Event", "ticket-tailor"),
description: __("Display a specific event", "ticket-tailor"),
icon: "megaphone",
category: "widgets",
keywords: [
__("event", "ticket-tailor"),
__("single", "ticket-tailor"),
__("detail", "ticket-tailor"),
],
supports: {
align: ["wide", "full"],
},
attributes: {
eventId: { type: "string", default: "" },
showDescription: { type: "boolean", default: true },
showTickets: { type: "boolean", default: true },
showImage: { type: "boolean", default: true },
imageType: { type: "string", default: "header" },
fullWidth: { type: "boolean", default: false },
maxWidth: { type: "string", default: "800px" },
},
edit: function (props) {
const { attributes, setAttributes } = props;
const {
eventId,
showDescription,
showTickets,
showImage,
imageType,
fullWidth,
maxWidth,
} = attributes;
const eventOptions =
window.ticketTailorData && window.ticketTailorData.events
? window.ticketTailorData.events
: [{ value: "", label: __("Loading events...", "ticket-tailor") }];
return el(
Fragment,
{},
el(
InspectorControls,
{},
el(
PanelBody,
{ title: __("Event Settings", "ticket-tailor"), initialOpen: true },
el(SelectControl, {
label: __("Select Event", "ticket-tailor"),
value: eventId,
options: [
{ value: "", label: __("Select an event...", "ticket-tailor") },
].concat(eventOptions),
onChange: (value) => setAttributes({ eventId: value }),
}),
el(ToggleControl, {
label: __("Full Width Display", "ticket-tailor"),
checked: fullWidth,
onChange: (value) => setAttributes({ fullWidth: value }),
}),
!fullWidth &&
el(TextControl, {
label: __("Maximum Width", "ticket-tailor"),
value: maxWidth,
onChange: (value) => setAttributes({ maxWidth: value }),
help: __("e.g. 800px, 100%, 60rem", "ticket-tailor"),
}),
el(ToggleControl, {
label: __("Show Event Image", "ticket-tailor"),
checked: showImage,
onChange: (value) => setAttributes({ showImage: value }),
}),
showImage &&
el(SelectControl, {
label: __("Image Type", "ticket-tailor"),
value: imageType,
options: [
{
label: __("Banner (Wide)", "ticket-tailor"),
value: "header",
},
{
label: __("Thumbnail (Square)", "ticket-tailor"),
value: "thumbnail",
},
],
onChange: (value) => setAttributes({ imageType: value }),
}),
el(ToggleControl, {
label: __("Show Description", "ticket-tailor"),
checked: showDescription,
onChange: (value) => setAttributes({ showDescription: value }),
}),
el(ToggleControl, {
label: __("Show Ticket Button", "ticket-tailor"),
checked: showTickets,
onChange: (value) => setAttributes({ showTickets: value }),
}),
),
),
el(
"div",
{
className: "tt-block-placeholder",
style: {
border: "2px dashed #ccc",
padding: "40px",
textAlign: "center",
background: "#f9f9f9",
},
},
el("span", {
className: "dashicons dashicons-megaphone",
style: { fontSize: "48px", color: "#666" },
}),
!eventId
? el(
"p",
{},
__("Please select an event from the sidebar", "ticket-tailor"),
)
: el(
"div",
{},
el("p", {}, __("Single Event Display", "ticket-tailor")),
el(
"p",
{ style: { fontSize: "14px", color: "#666" } },
__("Event ID: ", "ticket-tailor") + eventId,
),
fullWidth &&
el(
"p",
{
style: {
fontSize: "12px",
color: "#2271b1",
marginTop: "5px",
},
},
__("✓ Full width enabled", "ticket-tailor"),
),
),
),
);
},
save: function () {
return null;
},
});
// Block 4: Category Events - ENHANCED
registerBlockType("ticket-tailor/category-events", {
title: __("Category Events", "ticket-tailor"),
description: __("Display events from a specific category", "ticket-tailor"),
icon: "category",
category: "widgets",
keywords: [
__("category", "ticket-tailor"),
__("filter", "ticket-tailor"),
__("events", "ticket-tailor"),
],
supports: {
align: ["wide", "full"],
},
attributes: {
category: { type: "string", default: "" },
limit: { type: "number", default: 10 },
layout: { type: "string", default: "grid" },
columns: { type: "number", default: 3 },
columnsMode: { type: "string", default: "fixed" },
showImage: { type: "boolean", default: true },
imageType: { type: "string", default: "thumbnail" },
fullWidth: { type: "boolean", default: true },
},
edit: function (props) {
const { attributes, setAttributes } = props;
const {
category,
limit,
layout,
columns,
columnsMode,
showImage,
imageType,
fullWidth,
} = attributes;
return el(
Fragment,
{},
el(
InspectorControls,
{},
el(
PanelBody,
{
title: __("Category Settings", "ticket-tailor"),
initialOpen: true,
},
el(TextControl, {
label: __("Category", "ticket-tailor"),
help: __(
"Enter the category name (e.g., Music, Sports, Theatre)",
"ticket-tailor",
),
value: category,
onChange: (value) => setAttributes({ category: value }),
}),
el(RangeControl, {
label: __("Number of Events", "ticket-tailor"),
value: limit,
onChange: (value) => setAttributes({ limit: value }),
min: 1,
max: 50,
}),
el(SelectControl, {
label: __("Layout", "ticket-tailor"),
value: layout,
options: [
{ label: __("Grid", "ticket-tailor"), value: "grid" },
{ label: __("List", "ticket-tailor"), value: "list" },
],
onChange: (value) => setAttributes({ layout: value }),
}),
layout === "grid" &&
el(
Fragment,
{},
el(SelectControl, {
label: __("Columns Mode", "ticket-tailor"),
value: columnsMode,
options: [
{
label: __("Fixed Columns", "ticket-tailor"),
value: "fixed",
},
{
label: __("Responsive (Auto-fit)", "ticket-tailor"),
value: "responsive",
},
],
onChange: (value) => setAttributes({ columnsMode: value }),
}),
el(RangeControl, {
label:
columnsMode === "fixed"
? __("Columns", "ticket-tailor")
: __("Maximum Columns", "ticket-tailor"),
value: columns,
onChange: (value) => setAttributes({ columns: value }),
min: 1,
max: 5,
}),
),
el(ToggleControl, {
label: __("Full Width Container", "ticket-tailor"),
checked: fullWidth,
onChange: (value) => setAttributes({ fullWidth: value }),
}),
el(ToggleControl, {
label: __("Show Event Images", "ticket-tailor"),
checked: showImage,
onChange: (value) => setAttributes({ showImage: value }),
}),
showImage &&
el(SelectControl, {
label: __("Image Type", "ticket-tailor"),
value: imageType,
options: [
{
label: __("Thumbnail (Square)", "ticket-tailor"),
value: "thumbnail",
},
{
label: __("Banner (16:9)", "ticket-tailor"),
value: "header",
},
],
onChange: (value) => setAttributes({ imageType: value }),
}),
),
),
el(
"div",
{
className: "tt-block-placeholder",
style: {
border: "2px dashed #ccc",
padding: "40px",
textAlign: "center",
background: "#f9f9f9",
width: fullWidth ? "100%" : "auto",
},
},
el("span", {
className: "dashicons dashicons-category",
style: { fontSize: "48px", color: "#666" },
}),
!category
? el(
"div",
{},
el(
"p",
{ style: { marginBottom: "15px" } },
__("Category Events Display", "ticket-tailor"),
),
el(
"p",
{ style: { fontSize: "14px", color: "#666" } },
__(
"Enter a category name in the sidebar to display filtered events",
"ticket-tailor",
),
),
)
: el(
"div",
{},
el(
"p",
{ style: { marginBottom: "10px", fontWeight: "bold" } },
__("Category Events: ", "ticket-tailor") + category,
),
el(
"p",
{ style: { fontSize: "14px", color: "#666" } },
__("Showing ", "ticket-tailor") +
limit +
__(" events", "ticket-tailor"),
),
fullWidth &&
el(
"p",
{
style: {
fontSize: "12px",
color: "#2271b1",
marginTop: "5px",
},
},
__("✓ Full width enabled", "ticket-tailor"),
),
),
),
);
},
save: function () {
return null;
},
});
})(window.wp);

View file

@ -0,0 +1,2 @@
<?php
// Silence is golden.