feat: Add navigation bar to Create Event page
- Added consistent navigation header matching other HVAC pages - Navigation includes Dashboard, Generate Certificates, Certificate Reports, Profile, Help, and Logout links - Added comprehensive styling for TEC Community Events form elements - Enhanced form styling includes improved input fields, buttons, date pickers, and venue sections - Integrated tooltips using HVAC_Help_System when available - Maintained error handling for when TEC Community Events is unavailable - Form now has professional appearance matching the overall system design The Create Event page now has the same navigation experience as other pages in the system. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
8121815ded
commit
d163ce328c
1 changed files with 190 additions and 2 deletions
|
|
@ -53,13 +53,16 @@ class HVAC_Manage_Event {
|
||||||
HVAC_Logger::info('Content was processed by do_shortcode', 'ManageEvent');
|
HVAC_Logger::info('Content was processed by do_shortcode', 'ManageEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add navigation bar to the content
|
||||||
|
$navigation_html = $this->get_navigation_bar();
|
||||||
|
|
||||||
// If shortcode wasn't processed (plugin might be inactive), show helpful message
|
// If shortcode wasn't processed (plugin might be inactive), show helpful message
|
||||||
if (strpos($processed_content, '[tribe_community_events') !== false) {
|
if (strpos($processed_content, '[tribe_community_events') !== false) {
|
||||||
if (class_exists('HVAC_Logger')) {
|
if (class_exists('HVAC_Logger')) {
|
||||||
HVAC_Logger::warning('tribe_community_events shortcode not processed - plugin may be inactive', 'ManageEvent');
|
HVAC_Logger::warning('tribe_community_events shortcode not processed - plugin may be inactive', 'ManageEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
$processed_content = '<div class="hvac-notice hvac-error">
|
$error_content = '<div class="hvac-notice hvac-error">
|
||||||
<p><strong>Event Submission Form Unavailable</strong></p>
|
<p><strong>Event Submission Form Unavailable</strong></p>
|
||||||
<p>The event submission form is currently unavailable. Please ensure:</p>
|
<p>The event submission form is currently unavailable. Please ensure:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -82,9 +85,194 @@ class HVAC_Manage_Event {
|
||||||
margin: 15px 0 15px 30px;
|
margin: 15px 0 15px 30px;
|
||||||
}
|
}
|
||||||
</style>';
|
</style>';
|
||||||
|
|
||||||
|
return $navigation_html . $error_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $processed_content;
|
// Wrap the form content with navigation and styling
|
||||||
|
$final_content = $navigation_html . '
|
||||||
|
<div class="hvac-manage-event-content">
|
||||||
|
' . $processed_content . '
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.hvac-manage-event-content {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Style the TEC Community Events form */
|
||||||
|
.tribe-community-events-form {
|
||||||
|
background: #fff;
|
||||||
|
padding: 30px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tribe-community-events-form .tribe-events-page-title {
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
border-bottom: 2px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Form field styling */
|
||||||
|
.tribe-community-events-form .tribe-events-form-row {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tribe-community-events-form label {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tribe-community-events-form input[type="text"],
|
||||||
|
.tribe-community-events-form input[type="email"],
|
||||||
|
.tribe-community-events-form input[type="url"],
|
||||||
|
.tribe-community-events-form textarea,
|
||||||
|
.tribe-community-events-form select {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: border-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tribe-community-events-form input:focus,
|
||||||
|
.tribe-community-events-form textarea:focus,
|
||||||
|
.tribe-community-events-form select:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: #007cba;
|
||||||
|
box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Submit button styling */
|
||||||
|
.tribe-community-events-form input[type="submit"],
|
||||||
|
.tribe-community-events-form .tribe-events-submit {
|
||||||
|
background: #007cba;
|
||||||
|
color: white;
|
||||||
|
padding: 12px 30px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tribe-community-events-form input[type="submit"]:hover,
|
||||||
|
.tribe-community-events-form .tribe-events-submit:hover {
|
||||||
|
background: #005a87;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TinyMCE editor styling */
|
||||||
|
.tribe-community-events-form .wp-editor-wrap {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Date picker styling */
|
||||||
|
.tribe-community-events-form .tribe-datetime-block {
|
||||||
|
background: #f9f9f9;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Venue fields styling */
|
||||||
|
.tribe-community-events-form .tribe-events-venue-form {
|
||||||
|
background: #f9f9f9;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Error and success messages */
|
||||||
|
.tribe-community-events-form .tribe-events-notices {
|
||||||
|
padding: 15px;
|
||||||
|
margin: 20px 0;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tribe-community-events-form .tribe-events-error {
|
||||||
|
background: #f8d7da;
|
||||||
|
color: #721c24;
|
||||||
|
border: 1px solid #f5c6cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tribe-community-events-form .tribe-events-success {
|
||||||
|
background: #d1e7dd;
|
||||||
|
color: #0f5132;
|
||||||
|
border: 1px solid #badbcc;
|
||||||
|
}
|
||||||
|
</style>';
|
||||||
|
|
||||||
|
return $final_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the navigation bar HTML
|
||||||
|
*/
|
||||||
|
private function get_navigation_bar() {
|
||||||
|
// Check if Help System is available for tooltips
|
||||||
|
$help_available = class_exists('HVAC_Help_System');
|
||||||
|
|
||||||
|
$nav_html = '
|
||||||
|
<div class="hvac-dashboard-header">
|
||||||
|
<h1 class="entry-title">Create Event</h1>
|
||||||
|
<div class="hvac-dashboard-nav">';
|
||||||
|
|
||||||
|
// Dashboard link
|
||||||
|
if ($help_available) {
|
||||||
|
$nav_html .= HVAC_Help_System::add_tooltip(
|
||||||
|
'<a href="' . esc_url(home_url('/hvac-dashboard/')) . '" class="ast-button ast-button-secondary">Dashboard</a>',
|
||||||
|
'Return to your main dashboard to view stats and manage events'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$nav_html .= '<a href="' . esc_url(home_url('/hvac-dashboard/')) . '" class="ast-button ast-button-secondary">Dashboard</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate Certificates link
|
||||||
|
if ($help_available) {
|
||||||
|
$nav_html .= HVAC_Help_System::add_tooltip(
|
||||||
|
'<a href="' . esc_url(home_url('/generate-certificates/')) . '" class="ast-button ast-button-primary">Generate Certificates</a>',
|
||||||
|
'Create professional certificates for attendees who completed your training'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$nav_html .= '<a href="' . esc_url(home_url('/generate-certificates/')) . '" class="ast-button ast-button-primary">Generate Certificates</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Certificate Reports link
|
||||||
|
if ($help_available) {
|
||||||
|
$nav_html .= HVAC_Help_System::add_tooltip(
|
||||||
|
'<a href="' . esc_url(home_url('/certificate-reports/')) . '" class="ast-button ast-button-primary">Certificate Reports</a>',
|
||||||
|
'View and manage all certificates you\'ve issued to attendees'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$nav_html .= '<a href="' . esc_url(home_url('/certificate-reports/')) . '" class="ast-button ast-button-primary">Certificate Reports</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trainer Profile link
|
||||||
|
if ($help_available) {
|
||||||
|
$nav_html .= HVAC_Help_System::add_tooltip(
|
||||||
|
'<a href="' . esc_url(home_url('/trainer-profile/')) . '" class="ast-button ast-button-secondary">View Profile</a>',
|
||||||
|
'Update your professional credentials, business information, and training specialties'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$nav_html .= '<a href="' . esc_url(home_url('/trainer-profile/')) . '" class="ast-button ast-button-secondary">View Profile</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Help and Logout links
|
||||||
|
$nav_html .= '
|
||||||
|
<a href="' . esc_url(home_url('/hvac-documentation/')) . '" class="ast-button ast-button-secondary">Help</a>
|
||||||
|
<a href="' . esc_url(wp_logout_url(home_url('/community-login/'))) . '" class="ast-button ast-button-secondary">Logout</a>
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
return $nav_html;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue