Initial commit of slide manager plugin

This commit is contained in:
2026-02-08 21:39:31 -08:00
commit 40099aa68a
32 changed files with 11284 additions and 0 deletions
+369
View File
@@ -0,0 +1,369 @@
<?php
/**
* Template Name: Slide Dashboard
*
* Divi full-width template for the slide management dashboard
*
* @package Hi_School_Slide_Manager
* @since 1.0.0
*/
// Prevent direct access
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct access forbidden.' );
}
get_header(); ?>
<div id="main-content">
<div class="container-fluid">
<div id="content-area" class="clearfix full-width">
<!-- Custom Dashboard Header with Navigation -->
<div class="hssm-header-bar">
<div class="hssm-header-content">
<div class="hssm-logo-section">
<h1 class="hssm-site-title">
Slide Management Dashboard
</h1>
</div>
<div class="hssm-header-nav">
<a href="<?php echo home_url(); ?>" class="hssm-nav-btn hssm-nav-home">
<span class="dashicons dashicons-admin-home"></span>
Home
</a>
<a href="<?php echo admin_url(); ?>" class="hssm-nav-btn hssm-nav-admin">
<span class="dashicons dashicons-admin-generic"></span>
Admin
</a>
<a href="<?php echo home_url( '/slide-preview/' ); ?>" class="hssm-nav-btn hssm-nav-preview" target="_blank">
<span class="dashicons dashicons-visibility"></span>
Slide Preview
</a>
<div class="hssm-user-menu">
<span class="hssm-user-name">
<?php echo esc_html( wp_get_current_user()->display_name ); ?>
</span>
<a href="<?php echo wp_logout_url( home_url() ); ?>" class="hssm-nav-btn hssm-nav-logout">
<span class="dashicons dashicons-exit"></span>
Logout
</a>
</div>
</div>
</div>
</div>
<!-- Main Dashboard Content -->
<div class="hssm-dashboard-main">
<!-- Messages Container -->
<div id="hssm-messages" class="hssm-messages"></div>
<!-- Dashboard Navigation -->
<div class="hssm-dashboard-nav">
<ul class="hssm-nav-tabs">
<li class="active">
<a href="#create-slides" data-tab="create-slides">
<span class="dashicons dashicons-plus-alt"></span>
Create Slides
</a>
</li>
<li>
<a href="#manage-slides" data-tab="manage-slides">
<span class="dashicons dashicons-admin-page"></span>
Manage Slides
</a>
</li>
<li>
<a href="#analytics" data-tab="analytics">
<span class="dashicons dashicons-chart-area"></span>
Analytics
</a>
</li>
<li>
<a href="#notifications" data-tab="notifications">
<span class="dashicons dashicons-email"></span>
Notifications
</a>
</li>
</ul>
</div>
<!-- Create Slides Tab -->
<div id="create-slides" class="hssm-tab-content active">
<div class="hssm-tab-header">
<h2>Create New Slides</h2>
<div class="hssm-tab-actions">
<button id="add-slide-form" class="hssm-btn hssm-btn-primary" data-max-forms="5">
<span class="dashicons dashicons-plus"></span> Add New Slide Form
</button>
<button id="import-slides" class="hssm-btn hssm-btn-secondary">
<span class="dashicons dashicons-upload"></span> Import Slides
</button>
</div>
</div>
<div id="slide-forms-container">
<!-- Initial slide form will be inserted here -->
</div>
<div class="hssm-bulk-actions">
<button id="save-all-slides" class="hssm-btn hssm-btn-success hssm-btn-large">
<span class="dashicons dashicons-yes"></span> Save All Slides
</button>
<button id="save-draft-all" class="hssm-btn hssm-btn-secondary">
<span class="dashicons dashicons-edit"></span> Save as Drafts
</button>
<button id="clear-all-forms" class="hssm-btn hssm-btn-outline">
<span class="dashicons dashicons-trash"></span> Clear All Forms
</button>
</div>
</div>
<!-- Manage Slides Tab -->
<div id="manage-slides" class="hssm-tab-content">
<div class="hssm-tab-header">
<h2>Manage Existing Slides</h2>
<div class="hssm-filters">
<select id="filter-site" class="hssm-select">
<option value="">All Sites</option>
<option value="hi-school">Hi-School Pharmacy</option>
<option value="one-stop">One Stop Hardware</option>
<option value="ace">Ace Hardware</option>
</select>
<select id="filter-client" class="hssm-select">
<option value="">All Clients</option>
</select>
<select id="filter-status" class="hssm-select">
<option value="">All Status</option>
<option value="publish">Published</option>
<option value="draft">Draft</option>
<option value="scheduled">Scheduled</option>
</select>
<button id="apply-filters" class="hssm-btn hssm-btn-primary">
<span class="dashicons dashicons-filter"></span> Apply Filters
</button>
<button id="export-slides" class="hssm-btn hssm-btn-secondary">
<span class="dashicons dashicons-download"></span> Export
</button>
</div>
</div>
<div id="slides-list" class="hssm-slides-list">
<!-- Existing slides will be loaded here -->
</div>
</div>
<!-- Analytics Tab -->
<div id="analytics" class="hssm-tab-content">
<div class="hssm-tab-header">
<h2>Slide Analytics</h2>
<div class="hssm-analytics-controls">
<select id="analytics-timeframe" class="hssm-select">
<option value="7">Last 7 Days</option>
<option value="30">Last 30 Days</option>
<option value="90">Last 90 Days</option>
</select>
<button id="generate-report" class="hssm-btn hssm-btn-primary">
<span class="dashicons dashicons-chart-area"></span> Generate Report
</button>
</div>
</div>
<div id="analytics-content" class="hssm-analytics-content">
<div class="hssm-analytics-cards">
<div class="hssm-analytics-card">
<h3>Total Slides Created</h3>
<div class="hssm-analytics-number">--</div>
</div>
<div class="hssm-analytics-card">
<h3>Active Campaigns</h3>
<div class="hssm-analytics-number">--</div>
</div>
<div class="hssm-analytics-card">
<h3>Scheduled Slides</h3>
<div class="hssm-analytics-number">--</div>
</div>
</div>
</div>
</div>
<!-- Notifications Tab -->
<div id="notifications" class="hssm-tab-content">
<div class="hssm-tab-header">
<h2>Notification Settings</h2>
</div>
<div class="hssm-notifications-settings">
<form id="notification-settings-form">
<div class="hssm-form-section">
<h3>Editor Notifications</h3>
<p class="description">Recipients for slide scheduling and approval requests.</p>
<div class="hssm-field">
<label for="editor_emails">Editor Email(s)</label>
<textarea id="editor_emails" name="editor_emails" class="hssm-textarea" rows="3" placeholder="Enter email addresses, separated by commas or new lines"></textarea>
</div>
</div>
<div class="hssm-form-section">
<h3>I.T.C.Guys Notifications</h3>
<p class="description">Recipients for LIVE confirmation checks.</p>
<div class="hssm-field">
<label for="itc_emails">I.T.C.Guys Email(s)</label>
<textarea id="itc_emails" name="itc_emails" class="hssm-textarea" rows="3" placeholder="Enter email addresses, separated by commas or new lines"></textarea>
</div>
</div>
<div class="hssm-form-actions">
<button type="submit" id="save-notifications" class="hssm-btn hssm-btn-primary">
<span class="dashicons dashicons-saved"></span> Save Settings
</button>
</div>
</form>
</div>
</div>
</div> <!-- .hssm-dashboard-main -->
</div> <!-- #content-area -->
</div> <!-- .container-fluid -->
</div> <!-- #main-content -->
<!-- Slide Form Template (Hidden) -->
<script type="text/html" id="slide-form-template">
<div class="hssm-slide-form" data-form-id="{{form_id}}">
<div class="hssm-form-header">
<h3><strong>New Slide #{{form_number}}</strong></h3>
<button type="button" class="hssm-remove-form" aria-label="Remove this form">
<span class="dashicons dashicons-no"> test</span>
</button>
</div>
<div class="hssm-form-grid">
<!-- Left Column: Basic Information -->
<div class="hssm-form-section hssm-form-basic">
<h4>Basic Information</h4>
<div class="hssm-field-row">
<div class="hssm-field">
<label for="title_{{form_id}}">Title *</label>
<input type="text" id="title_{{form_id}}" name="title" class="hssm-input" required>
</div>
<div class="hssm-field">
<label for="client_{{form_id}}">Client</label>
<input type="text" id="client_{{form_id}}" name="client" class="hssm-input">
</div>
</div>
<div class="hssm-field">
<label for="subtitle_{{form_id}}">Subtitle</label>
<input type="text" id="subtitle_{{form_id}}" name="subtitle" class="hssm-input">
</div>
<div class="hssm-field">
<label for="content_{{form_id}}">Content</label>
<textarea id="content_{{form_id}}" name="content" class="hssm-textarea" rows="3"></textarea>
</div>
</div>
<!-- Center Column: Image & Buttons -->
<div class="hssm-form-section hssm-form-media">
<h4>Background Image</h4>
<div class="hssm-image-upload-compact">
<div class="hssm-image-preview-small" id="image_preview_{{form_id}}">
<span class="hssm-placeholder">Click to upload</span>
</div>
<div class="hssm-image-controls">
<input type="file" id="image_upload_{{form_id}}" name="background_image" accept="image/*" style="display: none;">
<input type="hidden" id="image_id_{{form_id}}" name="featured_image_id" value="">
<button type="button" class="hssm-btn hssm-btn-small hssm-upload-btn" data-target="{{form_id}}">
Choose Image
</button>
<button type="button" class="hssm-btn hssm-btn-small hssm-btn-text hssm-remove-image" data-target="{{form_id}}" style="display: none;">
Remove
</button>
</div>
</div>
<h4>Call-to-Action Buttons</h4>
<div class="hssm-buttons-container-compact" id="buttons_{{form_id}}">
<div class="hssm-button-row-compact">
<input type="text" name="buttons[0][text]" placeholder="Button Text" class="hssm-input-small">
<input type="url" name="buttons[0][url]" placeholder="Button URL" class="hssm-input-small">
<button type="button" class="hssm-btn hssm-btn-tiny hssm-remove-button">×</button>
</div>
</div>
<button type="button" class="hssm-btn hssm-btn-small hssm-add-button" data-form="{{form_id}}">
<span class="dashicons dashicons-plus"></span> Add Button
</button>
</div>
<!-- Right Column: Targeting & Scheduling -->
<div class="hssm-form-section hssm-form-targeting">
<h4>Targeting & Scheduling</h4>
<div class="hssm-field">
<label>Target Sites *</label>
<div class="hssm-checkboxes-compact">
<label class="hssm-checkbox-compact">
<input type="checkbox" name="target_sites[]" value="hi-school">
Hi-School Pharmacy
</label>
<label class="hssm-checkbox-compact">
<input type="checkbox" name="target_sites[]" value="one-stop">
One Stop Hardware
</label>
<label class="hssm-checkbox-compact">
<input type="checkbox" name="target_sites[]" value="ace">
Ace Hardware
</label>
</div>
</div>
<div class="hssm-field" style="margin-top: 15px;">
<label class="hssm-checkbox-compact hssm-hide-text-option">
<input type="checkbox" name="hide_all_text" value="1">
Hide All Text (Image Only)
<small style="display: block; color: #666; margin-top: 5px;">Check this to display only the image without any overlay text</small>
</label>
</div>
<div class="hssm-field-row">
<div class="hssm-field">
<label for="start_date_{{form_id}}">Start Date</label>
<input type="date" id="start_date_{{form_id}}" name="start_date" class="hssm-input">
</div>
<div class="hssm-field">
<label for="end_date_{{form_id}}">End Date</label>
<input type="date" id="end_date_{{form_id}}" name="end_date" class="hssm-input">
</div>
</div>
<div class="hssm-field-row">
<div class="hssm-field">
<label for="order_{{form_id}}">Display Order</label>
<input type="number" id="order_{{form_id}}" name="order" class="hssm-input" value="0" min="0">
</div>
<div class="hssm-field">
<!-- Spacer for alignment -->
</div>
</div>
</div>
</div>
<div class="hssm-form-actions">
<button type="button" class="hssm-btn hssm-btn-secondary hssm-schedule-slide" data-form="{{form_id}}">
<span class="dashicons dashicons-calendar-alt"></span> Schedule for Approval
</button>
<button type="button" class="hssm-btn hssm-btn-primary hssm-publish-slide" data-form="{{form_id}}">
<span class="dashicons dashicons-yes"></span> Publish Immediately
</button>
<button type="button" class="hssm-btn hssm-btn-outline hssm-preview-slide" data-form="{{form_id}}">
<span class="dashicons dashicons-visibility"></span> Preview
</button>
</div>
</div>
</script>
<?php get_footer(); ?>