upskill-event-manager/templates/page-trainer-documentation.php
Ben 49a7791817 feat: Implement comprehensive help documentation page
- Create new WordPress page template for trainer documentation (page-trainer-documentation.php)
- Add editable documentation content via Gutenberg editor
- Implement automatic table of contents sidebar with smooth scrolling
- Create comprehensive help content covering:
  - Platform overview and mission
  - Core concepts (Events, Venues, Organizers, Tickets, RSVPs, Orders, Certificates)
  - Profile customization guide
  - Venue and organizer management
  - Event creation and management process
  - Event attendance tracking methods
  - Certificate generation workflow
  - Comprehensive FAQs section
  - Support resources and contact information
- Add responsive design with mobile-friendly layout
- Include interactive TOC with active section highlighting
- Update deployment script to set correct page template
- Fix documentation page to use new template system

The documentation page now provides trainers with a complete guide to using the platform,
including step-by-step instructions for all major features and answers to common questions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 17:20:51 -03:00

373 lines
No EOL
8.6 KiB
PHP

<?php
/**
* Template Name: Trainer Documentation
* Description: Help and documentation page for HVAC trainers
*/
// Define constant to indicate we're in a page template
define('HVAC_IN_PAGE_TEMPLATE', true);
get_header();
?>
<div class="hvac-page-wrapper hvac-trainer-documentation-page">
<?php
// Display trainer navigation menu
if (class_exists('HVAC_Menu_System')) {
HVAC_Menu_System::instance()->render_trainer_menu();
}
?>
<?php
// Display breadcrumbs
if (class_exists('HVAC_Breadcrumbs')) {
echo HVAC_Breadcrumbs::instance()->render_breadcrumbs();
}
?>
<div class="container hvac-documentation-container">
<div class="hvac-doc-layout">
<!-- Main Content Area -->
<main class="hvac-doc-main">
<?php
// Check if user is logged in
if (!is_user_logged_in()) {
echo '<div class="hvac-notice hvac-notice-warning">';
echo '<p>Please <a href="' . home_url('/training-login/') . '">log in</a> to access the documentation.</p>';
echo '</div>';
} else {
// Display the page content (editable via Gutenberg)
while (have_posts()) : the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('hvac-doc-article'); ?>>
<?php
// If content exists, show it
if (trim(get_the_content()) !== '') {
the_content();
} else {
// Show default content if page is empty
echo do_shortcode('[hvac_documentation_content]');
}
?>
</article>
<?php
endwhile;
}
?>
</main>
<!-- Table of Contents Sidebar -->
<aside class="hvac-doc-sidebar" id="hvac-toc-sidebar">
<div class="hvac-toc-wrapper">
<h3 class="hvac-toc-title">Table of Contents</h3>
<nav class="hvac-toc-nav" id="hvac-toc-nav">
<!-- TOC will be populated by JavaScript -->
</nav>
</div>
</aside>
</div>
</div>
</div>
<style>
/* Documentation Page Layout */
.hvac-documentation-container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
.hvac-doc-layout {
display: flex;
gap: 40px;
align-items: flex-start;
}
.hvac-doc-main {
flex: 1;
min-width: 0;
}
.hvac-doc-sidebar {
width: 280px;
position: sticky;
top: 100px;
max-height: calc(100vh - 120px);
overflow-y: auto;
}
.hvac-toc-wrapper {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 8px;
padding: 20px;
}
.hvac-toc-title {
font-size: 18px;
font-weight: 600;
margin: 0 0 15px 0;
color: #333;
}
.hvac-toc-nav ul {
list-style: none;
padding: 0;
margin: 0;
}
.hvac-toc-nav li {
margin: 0;
}
.hvac-toc-nav a {
display: block;
padding: 8px 12px;
color: #666;
text-decoration: none;
transition: all 0.2s;
border-left: 3px solid transparent;
}
.hvac-toc-nav a:hover {
color: #E9AF28;
background: #fff;
border-left-color: #E9AF28;
}
.hvac-toc-nav a.active {
color: #E9AF28;
font-weight: 600;
background: #fff;
border-left-color: #E9AF28;
}
/* Nested TOC items */
.hvac-toc-nav ul ul {
margin-left: 20px;
margin-top: 5px;
}
.hvac-toc-nav ul ul a {
font-size: 14px;
padding: 6px 12px;
}
/* Documentation Content Styles */
.hvac-doc-article {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.hvac-doc-article h1 {
color: #333;
font-size: 36px;
margin-bottom: 10px;
padding-bottom: 15px;
border-bottom: 3px solid #E9AF28;
}
.hvac-doc-article h2 {
color: #333;
font-size: 28px;
margin-top: 40px;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #f0f0f0;
}
.hvac-doc-article h3 {
color: #555;
font-size: 22px;
margin-top: 30px;
margin-bottom: 15px;
}
.hvac-doc-article h4 {
color: #666;
font-size: 18px;
margin-top: 25px;
margin-bottom: 12px;
}
.hvac-doc-article p {
line-height: 1.8;
margin-bottom: 15px;
color: #555;
}
.hvac-doc-article ul,
.hvac-doc-article ol {
margin-bottom: 20px;
padding-left: 30px;
}
.hvac-doc-article li {
margin-bottom: 10px;
line-height: 1.8;
}
.hvac-doc-article strong {
color: #333;
font-weight: 600;
}
.hvac-doc-article a {
color: #E9AF28;
text-decoration: none;
border-bottom: 1px solid transparent;
transition: border-color 0.2s;
}
.hvac-doc-article a:hover {
border-bottom-color: #E9AF28;
}
/* Notice Styles */
.hvac-notice {
padding: 15px 20px;
border-radius: 6px;
margin-bottom: 20px;
}
.hvac-notice-warning {
background: #fff3cd;
border: 1px solid #ffc107;
color: #856404;
}
.hvac-notice-info {
background: #d1ecf1;
border: 1px solid #bee5eb;
color: #0c5460;
}
.hvac-notice-success {
background: #d4edda;
border: 1px solid #c3e6cb;
color: #155724;
}
/* Responsive Design */
@media (max-width: 992px) {
.hvac-doc-layout {
flex-direction: column;
}
.hvac-doc-sidebar {
width: 100%;
position: static;
margin-top: 30px;
}
}
@media (max-width: 768px) {
.hvac-doc-article {
padding: 20px;
}
.hvac-doc-article h1 {
font-size: 28px;
}
.hvac-doc-article h2 {
font-size: 24px;
}
.hvac-doc-article h3 {
font-size: 20px;
}
}
</style>
<script>
jQuery(document).ready(function($) {
// Generate Table of Contents from headings
function generateTOC() {
var toc = $('#hvac-toc-nav');
var headings = $('.hvac-doc-article').find('h2, h3, h4');
if (headings.length === 0) return;
var tocHTML = '<ul>';
var lastLevel = 2;
headings.each(function() {
var heading = $(this);
var level = parseInt(heading.prop('tagName').substring(1));
var text = heading.text();
var id = heading.attr('id');
// Generate ID if not exists
if (!id) {
id = text.toLowerCase()
.replace(/[^\w\s-]/g, '')
.replace(/\s+/g, '-')
.replace(/-+/g, '-')
.trim();
heading.attr('id', id);
}
// Handle nesting
if (level > lastLevel) {
tocHTML += '<ul>';
} else if (level < lastLevel) {
for (var i = level; i < lastLevel; i++) {
tocHTML += '</ul></li>';
}
} else if (lastLevel > 2) {
tocHTML += '</li>';
}
tocHTML += '<li><a href="#' + id + '">' + text + '</a>';
lastLevel = level;
});
// Close remaining tags
for (var i = 2; i < lastLevel; i++) {
tocHTML += '</ul></li>';
}
tocHTML += '</li></ul>';
toc.html(tocHTML);
}
// Smooth scroll to anchor
$(document).on('click', '.hvac-toc-nav a', function(e) {
e.preventDefault();
var target = $($(this).attr('href'));
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top - 100
}, 500);
}
});
// Highlight active section in TOC
function highlightActiveSection() {
var scrollPos = $(window).scrollTop();
$('.hvac-doc-article h2, .hvac-doc-article h3, .hvac-doc-article h4').each(function() {
var currLink = $('.hvac-toc-nav a[href="#' + $(this).attr('id') + '"]');
var refElement = $(this);
if (refElement.position() && refElement.position().top <= scrollPos + 150) {
$('.hvac-toc-nav a').removeClass('active');
currLink.addClass('active');
}
});
}
// Initialize TOC
generateTOC();
// Update active section on scroll
$(window).on('scroll', highlightActiveSection);
highlightActiveSection();
});
</script>
<?php
get_footer();