993 lines
33 KiB
HTML
993 lines
33 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>User Dashboard - BNKops Influence</title>
|
|
<link rel="icon" href="data:,">
|
|
<link rel="stylesheet" href="css/styles.css">
|
|
<style>
|
|
.dashboard-container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 2rem;
|
|
}
|
|
|
|
.dashboard-header {
|
|
background: #2c3e50;
|
|
color: white;
|
|
padding: 2rem 0;
|
|
margin-bottom: 2rem;
|
|
text-align: center;
|
|
}
|
|
|
|
.user-info {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
background: #f8f9fa;
|
|
padding: 1rem;
|
|
border-radius: 8px;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.user-details h3 {
|
|
margin: 0 0 0.5rem 0;
|
|
color: #2c3e50;
|
|
}
|
|
|
|
.user-details p {
|
|
margin: 0;
|
|
color: #666;
|
|
}
|
|
|
|
.dashboard-nav {
|
|
display: flex;
|
|
background: #34495e;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.nav-btn {
|
|
flex: 1;
|
|
padding: 1rem;
|
|
background: none;
|
|
border: none;
|
|
color: white;
|
|
cursor: pointer;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.nav-btn:hover {
|
|
background: #3498db;
|
|
}
|
|
|
|
.nav-btn.active {
|
|
background: #3498db;
|
|
}
|
|
|
|
.tab-content {
|
|
display: none;
|
|
}
|
|
|
|
.tab-content.active {
|
|
display: block;
|
|
}
|
|
|
|
.campaign-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
|
gap: 1.5rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.campaign-card {
|
|
border: 1px solid #ddd;
|
|
border-radius: 8px;
|
|
padding: 0;
|
|
background: white;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.campaign-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
|
|
}
|
|
|
|
.campaign-card-cover {
|
|
background-size: cover;
|
|
background-position: center;
|
|
min-height: 180px;
|
|
position: relative;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
}
|
|
|
|
.campaign-card-cover-overlay {
|
|
background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
|
|
width: 100%;
|
|
padding: 1.5rem;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.campaign-card-cover-overlay h3 {
|
|
margin: 0;
|
|
color: white;
|
|
text-shadow: 0 2px 4px rgba(0,0,0,0.5);
|
|
font-size: 1.2rem;
|
|
}
|
|
|
|
.campaign-card > .campaign-meta,
|
|
.campaign-card > .campaign-actions {
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.campaign-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-start;
|
|
margin-bottom: 1rem;
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.campaign-header h3 {
|
|
margin: 0;
|
|
color: #2c3e50;
|
|
font-size: 1.2rem;
|
|
}
|
|
|
|
.status-badge {
|
|
padding: 0.25rem 0.75rem;
|
|
border-radius: 20px;
|
|
font-size: 0.8rem;
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.status-draft {
|
|
background: #f39c12;
|
|
color: white;
|
|
}
|
|
|
|
.status-active {
|
|
background: #27ae60;
|
|
color: white;
|
|
}
|
|
|
|
.status-paused {
|
|
background: #e74c3c;
|
|
color: white;
|
|
}
|
|
|
|
.status-archived {
|
|
background: #95a5a6;
|
|
color: white;
|
|
}
|
|
|
|
.campaign-meta {
|
|
color: #666;
|
|
font-size: 0.9rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.campaign-meta p {
|
|
margin: 0.25rem 0;
|
|
}
|
|
|
|
.campaign-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.btn {
|
|
padding: 0.5rem 1rem;
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
font-size: 0.9rem;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: #3498db;
|
|
color: white;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: #95a5a6;
|
|
color: white;
|
|
}
|
|
|
|
.btn-success {
|
|
background: #27ae60;
|
|
color: white;
|
|
}
|
|
|
|
.btn-danger {
|
|
background: #e74c3c;
|
|
color: white;
|
|
}
|
|
|
|
.btn:hover {
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 3rem;
|
|
color: #666;
|
|
}
|
|
|
|
.loading {
|
|
text-align: center;
|
|
padding: 2rem;
|
|
}
|
|
|
|
.spinner {
|
|
border: 4px solid #f3f3f3;
|
|
border-radius: 50%;
|
|
border-top: 4px solid #3498db;
|
|
width: 40px;
|
|
height: 40px;
|
|
animation: spin 1s linear infinite;
|
|
margin: 0 auto 1rem;
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
.hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
.message-success {
|
|
background: #d4edda;
|
|
color: #155724;
|
|
border: 1px solid #c3e6cb;
|
|
padding: 1rem;
|
|
border-radius: 4px;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.message-error {
|
|
background: #f8d7da;
|
|
color: #721c24;
|
|
border: 1px solid #f5c6cb;
|
|
padding: 1rem;
|
|
border-radius: 4px;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.stats-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 1rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.stat-card {
|
|
background: #f8f9fa;
|
|
padding: 1.5rem;
|
|
border-radius: 8px;
|
|
text-align: center;
|
|
}
|
|
|
|
.stat-card h3 {
|
|
font-size: 2rem;
|
|
margin: 0 0 0.5rem 0;
|
|
color: #3498db;
|
|
}
|
|
|
|
.stat-card p {
|
|
margin: 0;
|
|
color: #666;
|
|
}
|
|
|
|
.account-info {
|
|
background: white;
|
|
padding: 2rem;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
font-weight: 600;
|
|
color: #2c3e50;
|
|
margin-bottom: 0.5rem;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.form-group input {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: 2px solid #e0e6ed;
|
|
border-radius: 8px;
|
|
font-size: 0.95rem;
|
|
transition: border-color 0.3s, box-shadow 0.3s;
|
|
}
|
|
|
|
.form-group input:focus,
|
|
.form-group textarea:focus,
|
|
.form-group select:focus {
|
|
outline: none;
|
|
border-color: #3498db;
|
|
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
|
|
}
|
|
|
|
.form-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 1.5rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.form-group textarea,
|
|
.form-group select {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: 2px solid #e0e6ed;
|
|
border-radius: 8px;
|
|
font-size: 0.95rem;
|
|
transition: border-color 0.3s, box-shadow 0.3s;
|
|
resize: vertical;
|
|
}
|
|
|
|
.form-row {
|
|
display: flex;
|
|
gap: 1rem;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.section-header {
|
|
font-weight: 600;
|
|
color: #2c3e50;
|
|
margin: 2rem 0 1rem 0;
|
|
padding-bottom: 0.5rem;
|
|
border-bottom: 2px solid #e0e6ed;
|
|
font-size: 1.1rem;
|
|
}
|
|
|
|
.checkbox-group {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
|
|
.checkbox-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.checkbox-item input[type="checkbox"] {
|
|
width: auto;
|
|
margin: 0;
|
|
transform: scale(1.2);
|
|
}
|
|
|
|
.checkbox-item label {
|
|
margin: 0;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
|
|
.user-badge {
|
|
padding: 0.25rem 0.75rem;
|
|
border-radius: 20px;
|
|
font-size: 0.8rem;
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.user-badge.admin {
|
|
background: #e74c3c;
|
|
color: white;
|
|
}
|
|
|
|
.user-badge.user {
|
|
background: #3498db;
|
|
color: white;
|
|
}
|
|
|
|
.user-badge.temp {
|
|
background: #f39c12;
|
|
color: white;
|
|
}
|
|
|
|
/* Campaign Selector Dropdown Styles */
|
|
.campaign-selector {
|
|
margin-bottom: 2rem;
|
|
background: #f8f9fa;
|
|
padding: 1.5rem;
|
|
border-radius: 12px;
|
|
border: 2px solid #e9ecef;
|
|
}
|
|
|
|
.campaign-selector label {
|
|
display: block;
|
|
font-weight: 600;
|
|
color: #2c3e50;
|
|
margin-bottom: 0.75rem;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.search-dropdown {
|
|
position: relative;
|
|
width: 100%;
|
|
}
|
|
|
|
.search-dropdown input {
|
|
width: 100%;
|
|
padding: 0.75rem 2.5rem 0.75rem 0.75rem;
|
|
border: 2px solid #e0e6ed;
|
|
border-radius: 8px;
|
|
font-size: 0.95rem;
|
|
background: white;
|
|
transition: border-color 0.3s, box-shadow 0.3s;
|
|
}
|
|
|
|
.search-dropdown input:focus {
|
|
outline: none;
|
|
border-color: #3498db;
|
|
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
|
|
}
|
|
|
|
.dropdown-arrow {
|
|
position: absolute;
|
|
right: 0.75rem;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
color: #666;
|
|
pointer-events: none;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
.dropdown-menu {
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 0;
|
|
right: 0;
|
|
background: white;
|
|
border: 2px solid #e0e6ed;
|
|
border-top: none;
|
|
border-radius: 0 0 8px 8px;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
z-index: 1000;
|
|
display: none;
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.dropdown-menu.show {
|
|
display: block;
|
|
}
|
|
|
|
.dropdown-item {
|
|
padding: 0.75rem;
|
|
cursor: pointer;
|
|
border-bottom: 1px solid #f1f3f4;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.dropdown-item:hover {
|
|
background: #f8f9fa;
|
|
}
|
|
|
|
.dropdown-item.selected {
|
|
background: #e3f2fd;
|
|
color: #1976d2;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.dropdown-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.dropdown-item.no-results {
|
|
color: #666;
|
|
font-style: italic;
|
|
cursor: default;
|
|
}
|
|
|
|
.dropdown-item.no-results:hover {
|
|
background: white;
|
|
}
|
|
|
|
/* Response moderation styles */
|
|
.response-card {
|
|
background: white;
|
|
border: 1px solid #ddd;
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
margin-bottom: 1rem;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.response-card.pending {
|
|
border-left: 4px solid #f39c12;
|
|
}
|
|
|
|
.response-card.approved {
|
|
border-left: 4px solid #27ae60;
|
|
}
|
|
|
|
.response-card.rejected {
|
|
border-left: 4px solid #e74c3c;
|
|
}
|
|
|
|
.response-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-start;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.response-meta {
|
|
color: #666;
|
|
font-size: 0.9rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.response-meta p {
|
|
margin: 0.25rem 0;
|
|
}
|
|
|
|
.response-content {
|
|
background: #f8f9fa;
|
|
padding: 1rem;
|
|
border-radius: 4px;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.response-content h4 {
|
|
margin: 0 0 0.5rem 0;
|
|
color: #2c3e50;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.response-content p {
|
|
margin: 0;
|
|
color: #444;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.response-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.response-screenshot {
|
|
max-width: 200px;
|
|
margin-top: 0.5rem;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.response-screenshot:hover {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.dashboard-nav {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.campaign-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.user-info {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.stats-grid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="dashboard-header">
|
|
<div class="dashboard-container">
|
|
<h1>My Campaign Dashboard</h1>
|
|
<p>Manage your influence campaigns</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="dashboard-container">
|
|
<!-- User Info -->
|
|
<div class="user-info">
|
|
<div class="user-details">
|
|
<h3 id="user-name">Loading...</h3>
|
|
<p id="user-email">Loading...</p>
|
|
</div>
|
|
<div class="user-actions">
|
|
<span id="user-role-badge" class="user-badge">User</span>
|
|
<button id="logout-btn" class="btn btn-secondary">Logout</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Navigation -->
|
|
<nav class="dashboard-nav">
|
|
<button class="nav-btn active" data-tab="campaigns">My Campaigns</button>
|
|
<button class="nav-btn" data-tab="create">Create Campaign</button>
|
|
<button class="nav-btn" data-tab="edit">Edit Campaign</button>
|
|
<button class="nav-btn" data-tab="responses">Responses</button>
|
|
<button class="nav-btn" data-tab="analytics">Analytics</button>
|
|
<button class="nav-btn" data-tab="account">Account</button>
|
|
</nav>
|
|
|
|
<!-- Success/Error Messages -->
|
|
<div id="message-container" class="hidden"></div>
|
|
|
|
<!-- My Campaigns Tab -->
|
|
<div id="campaigns-tab" class="tab-content active">
|
|
<div style="margin-bottom: 2rem;">
|
|
<h2 style="margin: 0;">My Campaigns</h2>
|
|
</div>
|
|
|
|
<div id="campaigns-loading" class="loading hidden">
|
|
<div class="spinner"></div>
|
|
<p>Loading your campaigns...</p>
|
|
</div>
|
|
|
|
<div id="campaigns-list" class="campaign-grid">
|
|
<!-- Campaigns will be loaded here -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Create Campaign Tab -->
|
|
<div id="create-tab" class="tab-content">
|
|
<h2>Create New Campaign</h2>
|
|
|
|
<!-- Campaign Search Dropdown -->
|
|
<div class="campaign-selector">
|
|
<label for="create-campaign-selector">Select existing campaign as template (optional):</label>
|
|
<div class="search-dropdown">
|
|
<input type="text" id="create-campaign-selector" placeholder="Search campaigns..." autocomplete="off">
|
|
<div class="dropdown-arrow">▼</div>
|
|
<div class="dropdown-menu" id="create-dropdown-menu">
|
|
<div class="dropdown-item" data-campaign-id="new">Create New Campaign</div>
|
|
<!-- Campaign options will be populated here -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<form id="create-campaign-form">
|
|
<div class="form-grid">
|
|
<div class="form-group">
|
|
<label for="create-title">Campaign Title *</label>
|
|
<input type="text" id="create-title" name="title" required
|
|
placeholder="Save Alberta Parks">
|
|
</div>
|
|
|
|
<div class="form-group status-select">
|
|
<label for="create-status">Campaign Status</label>
|
|
<select id="create-status" name="status">
|
|
<option value="draft">📝 Draft</option>
|
|
<option value="active">🚀 Active</option>
|
|
<option value="paused">⏸️ Paused</option>
|
|
<option value="archived">📦 Archived</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="create-description">Description</label>
|
|
<textarea id="create-description" name="description" rows="3"
|
|
placeholder="A brief description of the campaign"></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="create-email-subject">Email Subject *</label>
|
|
<input type="text" id="create-email-subject" name="email_subject" required
|
|
placeholder="Protect Alberta's Provincial Parks">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="create-email-body">Email Body *</label>
|
|
<textarea id="create-email-body" name="email_body" rows="8" required
|
|
placeholder="Dear [Representative Name],
|
|
|
|
I am writing as your constituent to express my concern about...
|
|
|
|
Sincerely,
|
|
[Your Name]"></textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="create-call-to-action">Call to Action</label>
|
|
<textarea id="create-call-to-action" name="call_to_action" rows="3"
|
|
placeholder="Join thousands of Albertans in protecting our provincial parks. Send an email to your representatives today!"></textarea>
|
|
</div>
|
|
|
|
<div class="section-header">⚙️ Campaign Settings</div>
|
|
<div class="form-group">
|
|
<div class="checkbox-group">
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-allow-smtp" name="allow_smtp_email" checked>
|
|
<label for="create-allow-smtp">📧 Allow SMTP Email Sending</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-allow-mailto" name="allow_mailto_link" checked>
|
|
<label for="create-allow-mailto">🔗 Allow Mailto Links</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-collect-info" name="collect_user_info" checked>
|
|
<label for="create-collect-info">👤 Collect User Information</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-show-count" name="show_email_count" checked>
|
|
<label for="create-show-count">📊 Show Email Count</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-allow-editing" name="allow_email_editing">
|
|
<label for="create-allow-editing">✏️ Allow Email Editing</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section-header">🏛️ Target Government Levels</div>
|
|
<div class="form-group">
|
|
<div class="checkbox-group">
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-federal" name="target_government_levels" value="Federal" checked>
|
|
<label for="create-federal">🍁 Federal (MPs)</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-provincial" name="target_government_levels" value="Provincial" checked>
|
|
<label for="create-provincial">🏛️ Provincial (MLAs)</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-municipal" name="target_government_levels" value="Municipal" checked>
|
|
<label for="create-municipal">🏙️ Municipal (Mayors, Councillors)</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="create-school" name="target_government_levels" value="School Board">
|
|
<label for="create-school">🎓 School Board</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<button type="submit" class="btn btn-primary">Create Campaign</button>
|
|
<button type="button" class="btn btn-secondary" data-action="cancel-create">Cancel</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Edit Campaign Tab -->
|
|
<div id="edit-tab" class="tab-content">
|
|
<h2>Edit Campaign</h2>
|
|
|
|
<!-- Campaign Search Dropdown -->
|
|
<div class="campaign-selector">
|
|
<label for="edit-campaign-selector">Select campaign to edit:</label>
|
|
<div class="search-dropdown">
|
|
<input type="text" id="edit-campaign-selector" placeholder="Search campaigns..." autocomplete="off">
|
|
<div class="dropdown-arrow">▼</div>
|
|
<div class="dropdown-menu" id="edit-dropdown-menu">
|
|
<div class="dropdown-item" data-campaign-id="">Select a campaign to edit...</div>
|
|
<!-- Campaign options will be populated here -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<form id="edit-campaign-form">
|
|
<div class="form-grid">
|
|
<div class="form-group">
|
|
<label for="edit-title">Campaign Title *</label>
|
|
<input type="text" id="edit-title" name="title" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="edit-status">Status</label>
|
|
<select id="edit-status" name="status">
|
|
<option value="draft">📝 Draft</option>
|
|
<option value="active">🚀 Active</option>
|
|
<option value="paused">⏸️ Paused</option>
|
|
<option value="archived">📦 Archived</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="edit-description">Description</label>
|
|
<textarea id="edit-description" name="description" rows="3"></textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="edit-email-subject">Email Subject *</label>
|
|
<input type="text" id="edit-email-subject" name="email_subject" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="edit-email-body">Email Body *</label>
|
|
<textarea id="edit-email-body" name="email_body" rows="8" required></textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="edit-call-to-action">Call to Action</label>
|
|
<textarea id="edit-call-to-action" name="call_to_action" rows="3"></textarea>
|
|
</div>
|
|
|
|
<div class="section-header">⚙️ Campaign Settings</div>
|
|
<div class="form-group">
|
|
<div class="checkbox-group">
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-allow-smtp" name="allow_smtp_email">
|
|
<label for="edit-allow-smtp">📧 Allow SMTP Email Sending</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-allow-mailto" name="allow_mailto_link">
|
|
<label for="edit-allow-mailto">🔗 Allow Mailto Links</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-collect-info" name="collect_user_info">
|
|
<label for="edit-collect-info">👤 Collect User Information</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-show-count" name="show_email_count">
|
|
<label for="edit-show-count">📊 Show Email Count</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-allow-editing" name="allow_email_editing">
|
|
<label for="edit-allow-editing">✏️ Allow Email Editing</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section-header">🏛️ Target Government Levels</div>
|
|
<div class="form-group">
|
|
<div class="checkbox-group">
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-federal" name="target_government_levels" value="Federal">
|
|
<label for="edit-federal">🍁 Federal (MPs)</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-provincial" name="target_government_levels" value="Provincial">
|
|
<label for="edit-provincial">🏛️ Provincial (MLAs)</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-municipal" name="target_government_levels" value="Municipal">
|
|
<label for="edit-municipal">🏙️ Municipal (Mayors, Councillors)</label>
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="edit-school" name="target_government_levels" value="School Board">
|
|
<label for="edit-school">🎓 School Board</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<button type="submit" class="btn btn-primary">Update Campaign</button>
|
|
<button type="button" class="btn btn-secondary" data-action="cancel-edit">Cancel</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Analytics Tab -->
|
|
<!-- Analytics Tab -->
|
|
<div id="analytics-tab" class="tab-content">
|
|
<h2>Your Campaign Analytics</h2>
|
|
|
|
<div id="analytics-loading" class="loading hidden">
|
|
<div class="spinner"></div>
|
|
<p>Loading analytics...</p>
|
|
</div>
|
|
|
|
<div id="analytics-content">
|
|
<div class="stats-grid">
|
|
<div class="stat-card">
|
|
<h3 id="total-campaigns">0</h3>
|
|
<p>Total Campaigns</p>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h3 id="active-campaigns">0</h3>
|
|
<p>Active Campaigns</p>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h3 id="total-emails">0</h3>
|
|
<p>Emails Sent</p>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h3 id="total-users-reached">0</h3>
|
|
<p>Users Reached</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Responses Tab -->
|
|
<div id="responses-tab" class="tab-content">
|
|
<h2>Moderate Responses</h2>
|
|
|
|
<div style="display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;">
|
|
<div class="campaign-selector" style="flex: 1; min-width: 300px; margin: 0;">
|
|
<label for="responses-campaign-filter">Filter by Campaign:</label>
|
|
<select id="responses-campaign-filter" style="width: 100%; padding: 0.75rem; border: 2px solid #e0e6ed; border-radius: 8px;">
|
|
<option value="">All My Campaigns</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="campaign-selector" style="flex: 1; min-width: 200px; margin: 0;">
|
|
<label for="responses-status-filter">Filter by Status:</label>
|
|
<select id="responses-status-filter" style="width: 100%; padding: 0.75rem; border: 2px solid #e0e6ed; border-radius: 8px;">
|
|
<option value="all">All Statuses</option>
|
|
<option value="pending" selected>Pending</option>
|
|
<option value="approved">Approved</option>
|
|
<option value="rejected">Rejected</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="responses-loading" class="loading hidden">
|
|
<div class="spinner"></div>
|
|
<p>Loading responses...</p>
|
|
</div>
|
|
|
|
<div id="responses-list">
|
|
<!-- Responses will be loaded here -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Account Tab -->
|
|
<div id="account-tab" class="tab-content">
|
|
<h2>Account Settings</h2>
|
|
|
|
<div class="account-info">
|
|
<form id="account-form">
|
|
<div class="form-group">
|
|
<label for="account-name">Full Name</label>
|
|
<input type="text" id="account-name" name="name" readonly>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="account-email">Email Address</label>
|
|
<input type="email" id="account-email" name="email" readonly>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="account-phone">Phone Number</label>
|
|
<input type="tel" id="account-phone" name="phone" readonly>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="account-role">User Role</label>
|
|
<input type="text" id="account-role" name="role" readonly>
|
|
</div>
|
|
<div class="form-group" id="account-expiration" style="display: none;">
|
|
<label for="account-expires">Account Expires</label>
|
|
<input type="text" id="account-expires" name="expires" readonly>
|
|
</div>
|
|
</form>
|
|
|
|
<p style="color: #666; font-size: 0.9rem; margin-top: 1rem;">
|
|
To update your account information, please contact an administrator.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="js/api-client.js"></script>
|
|
<script src="js/auth.js"></script>
|
|
<script src="js/dashboard.js"></script>
|
|
</body>
|
|
</html> |