1199 lines
39 KiB
HTML
1199 lines
39 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Admin Panel - BNKops Influence Campaign Tool</title>
|
|
<link rel="icon" href="data:,">
|
|
<link rel="stylesheet" href="css/styles.css">
|
|
<style>
|
|
.admin-container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 2rem;
|
|
}
|
|
|
|
.admin-header {
|
|
background: #2c3e50;
|
|
color: white;
|
|
padding: 2rem 0;
|
|
margin-bottom: 2rem;
|
|
text-align: center;
|
|
}
|
|
|
|
.admin-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;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.form-row {
|
|
display: flex;
|
|
gap: 1rem;
|
|
align-items: flex-end;
|
|
}
|
|
|
|
.form-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.checkbox-group {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 0.5rem;
|
|
margin-top: 0.5rem;
|
|
}
|
|
|
|
.checkbox-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.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);
|
|
overflow: hidden;
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
}
|
|
|
|
.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);
|
|
}
|
|
|
|
.campaign-card > .campaign-meta,
|
|
.campaign-card > .campaign-actions {
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.campaign-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 1rem;
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.campaign-header h3 {
|
|
margin: 0;
|
|
color: #2c3e50;
|
|
}
|
|
|
|
.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-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;
|
|
}
|
|
|
|
.analytics-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 1rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.analytics-stat {
|
|
background: #f8f9fa;
|
|
padding: 1.5rem;
|
|
border-radius: 8px;
|
|
text-align: center;
|
|
}
|
|
|
|
.analytics-stat h3 {
|
|
font-size: 2rem;
|
|
margin: 0 0 0.5rem 0;
|
|
color: #3498db;
|
|
}
|
|
|
|
.modal-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0,0,0,0.7);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.modal-content {
|
|
background: white;
|
|
padding: 2rem;
|
|
border-radius: 8px;
|
|
max-width: 600px;
|
|
width: 90%;
|
|
max-height: 80vh;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.modal-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 1rem;
|
|
padding-bottom: 1rem;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.modal-close {
|
|
background: none;
|
|
border: none;
|
|
font-size: 1.5rem;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Enhanced Form Styling */
|
|
.form-group label {
|
|
display: block;
|
|
font-weight: 600;
|
|
color: #2c3e50;
|
|
margin-bottom: 0.5rem;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.form-group input,
|
|
.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;
|
|
background: #f8f9fa;
|
|
}
|
|
|
|
.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);
|
|
background: white;
|
|
}
|
|
|
|
/* Enhanced Status Select */
|
|
.status-select {
|
|
position: relative;
|
|
}
|
|
|
|
.status-select select {
|
|
appearance: none;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
font-weight: 600;
|
|
padding: 1rem 3rem 1rem 1rem;
|
|
font-size: 1rem;
|
|
border: none;
|
|
cursor: pointer;
|
|
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
|
}
|
|
|
|
.status-select select option {
|
|
background: white;
|
|
color: #2c3e50;
|
|
font-weight: 500;
|
|
padding: 0.75rem;
|
|
text-shadow: none;
|
|
}
|
|
|
|
.status-select select option:hover,
|
|
.status-select select option:checked {
|
|
background: #3498db;
|
|
color: white;
|
|
}
|
|
|
|
.status-select::after {
|
|
content: '▼';
|
|
position: absolute;
|
|
right: 1rem;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
color: white;
|
|
pointer-events: none;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
.status-select select:focus {
|
|
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
|
|
}
|
|
|
|
/* Enhanced Checkbox Styling */
|
|
.checkbox-group {
|
|
background: #f8f9fa;
|
|
padding: 1.5rem;
|
|
border-radius: 12px;
|
|
border: 2px solid #e9ecef;
|
|
margin-top: 0.5rem;
|
|
}
|
|
|
|
.checkbox-item {
|
|
background: white;
|
|
padding: 1rem;
|
|
border-radius: 8px;
|
|
border: 2px solid #e9ecef;
|
|
margin-bottom: 0.75rem;
|
|
transition: all 0.3s;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.checkbox-item:hover {
|
|
border-color: #3498db;
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
|
|
}
|
|
|
|
.checkbox-item input[type="checkbox"] {
|
|
width: auto;
|
|
margin-right: 0.75rem;
|
|
transform: scale(1.2);
|
|
accent-color: #3498db;
|
|
}
|
|
|
|
.checkbox-item label {
|
|
margin: 0;
|
|
font-weight: 500;
|
|
color: #495057;
|
|
cursor: pointer;
|
|
flex: 1;
|
|
}
|
|
|
|
.checkbox-item:has(input:checked) {
|
|
background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
|
|
border-color: #3498db;
|
|
}
|
|
|
|
.checkbox-item:has(input:checked) label {
|
|
color: #2c3e50;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Enhanced Form Grid */
|
|
.form-grid {
|
|
background: white;
|
|
padding: 2rem;
|
|
border-radius: 12px;
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
/* Section Headers */
|
|
.section-header {
|
|
color: #2c3e50;
|
|
font-size: 1.1rem;
|
|
font-weight: 600;
|
|
margin: 2rem 0 1rem 0;
|
|
padding-bottom: 0.5rem;
|
|
border-bottom: 2px solid #e9ecef;
|
|
}
|
|
|
|
/* Enhanced Buttons */
|
|
.btn {
|
|
padding: 1rem 2rem;
|
|
border: none;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
transition: all 0.3s;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: #6c757d;
|
|
color: white;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: #5a6268;
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
/* User Management Styles */
|
|
.users-list {
|
|
display: grid;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.user-card {
|
|
border: 1px solid #ddd;
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
background: white;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.user-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.user-info h4 {
|
|
margin: 0 0 0.25rem 0;
|
|
color: #2c3e50;
|
|
}
|
|
|
|
.user-info p {
|
|
margin: 0;
|
|
color: #666;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.user-badges {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
align-items: center;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.user-badge.expired {
|
|
background: #95a5a6;
|
|
color: white;
|
|
}
|
|
|
|
.user-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
flex-wrap: wrap;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.btn-small {
|
|
padding: 0.5rem 1rem;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
/* 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) {
|
|
.admin-nav {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.form-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.campaign-actions {
|
|
justify-content: center;
|
|
}
|
|
|
|
.user-header {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.user-actions {
|
|
justify-content: center;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="admin-header">
|
|
<div class="admin-container">
|
|
<h1>Campaign Admin Panel</h1>
|
|
<p>Manage your influence campaigns</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-container">
|
|
<!-- Navigation -->
|
|
<nav class="admin-nav">
|
|
<button class="nav-btn active" data-tab="campaigns">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">Response Moderation</button>
|
|
<button class="nav-btn" data-tab="users">User Management</button>
|
|
</nav>
|
|
|
|
<!-- Success/Error Messages -->
|
|
<div id="message-container" class="hidden"></div>
|
|
|
|
<!-- Campaigns Tab -->
|
|
<div id="campaigns-tab" class="tab-content active">
|
|
<div class="form-row" style="align-items: center; margin-bottom: 2rem;">
|
|
<h2 style="margin: 0;">Active Campaigns</h2>
|
|
</div>
|
|
|
|
<div id="campaigns-loading" class="loading hidden">
|
|
<div class="spinner"></div>
|
|
<p>Loading 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="form-group">
|
|
<label for="create-cover-photo">🖼️ Cover Photo</label>
|
|
<input type="file" id="create-cover-photo" name="cover_photo" accept="image/jpeg,image/jpg,image/png,image/gif,image/webp">
|
|
<small style="color: #666; font-size: 0.9em;">Upload a cover image for your campaign (max 5MB, jpeg/jpg/png/gif/webp)</small>
|
|
</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="form-group">
|
|
<label for="edit-cover-photo">🖼️ Cover Photo</label>
|
|
<div id="current-cover-photo" style="margin-bottom: 0.5rem;"></div>
|
|
<input type="file" id="edit-cover-photo" name="cover_photo" accept="image/jpeg,image/jpg,image/png,image/gif,image/webp">
|
|
<small style="color: #666; font-size: 0.9em;">Upload a new cover image (max 5MB, jpeg/jpg/png/gif/webp) or leave empty to keep current</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label>Campaign Settings</label>
|
|
<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="form-group">
|
|
<label>Target Government Levels</label>
|
|
<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>
|
|
|
|
<!-- Response Moderation Tab -->
|
|
<div id="responses-tab" class="tab-content">
|
|
<h2>Response Moderation</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="admin-campaign-filter">Filter by Campaign:</label>
|
|
<select id="admin-campaign-filter" style="width: 100%; padding: 0.75rem; border: 2px solid #e0e6ed; border-radius: 8px;">
|
|
<option value="">All Campaigns</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="campaign-selector" style="flex: 1; min-width: 200px; margin: 0;">
|
|
<label for="admin-response-status">Filter by Status:</label>
|
|
<select id="admin-response-status" 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="admin-responses-container">
|
|
<!-- Responses will be loaded here -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- User Management Tab -->
|
|
<div id="users-tab" class="tab-content">
|
|
<div class="form-row" style="align-items: center; margin-bottom: 2rem;">
|
|
<h2 style="margin: 0;">User Management</h2>
|
|
<button class="btn btn-primary" data-action="create-user">Add New User</button>
|
|
</div>
|
|
|
|
<div id="users-loading" class="loading hidden">
|
|
<div class="spinner"></div>
|
|
<p>Loading users...</p>
|
|
</div>
|
|
|
|
<div id="users-list" class="users-list">
|
|
<!-- Users will be loaded here -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- User Modal -->
|
|
<div id="user-modal" class="modal-overlay hidden">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3 id="user-modal-title">Add New User</h3>
|
|
<button class="modal-close" data-action="close-user-modal">×</button>
|
|
</div>
|
|
<form id="user-form">
|
|
<div class="form-group">
|
|
<label for="user-email">Email Address *</label>
|
|
<input type="email" id="user-email" name="email" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="user-password">Password *</label>
|
|
<input type="password" id="user-password" name="password" required autocomplete="new-password">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="user-name">Full Name</label>
|
|
<input type="text" id="user-name" name="name">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="user-phone">Phone Number</label>
|
|
<input type="tel" id="user-phone" name="phone">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="user-type">User Type</label>
|
|
<select id="user-type" name="userType">
|
|
<option value="user">Standard User</option>
|
|
<option value="admin">Administrator</option>
|
|
<option value="temp">Temporary User</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group" id="temp-user-options" style="display: none;">
|
|
<label for="user-expire-days">Expiration (Days)</label>
|
|
<input type="number" id="user-expire-days" name="expireDays" min="1" max="365" value="30">
|
|
</div>
|
|
<div class="checkbox-item">
|
|
<input type="checkbox" id="user-admin" name="isAdmin">
|
|
<label for="user-admin">Grant Administrator Access</label>
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="submit" class="btn btn-primary">Create User</button>
|
|
<button type="button" class="btn btn-secondary" data-action="close-user-modal">Cancel</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Email Broadcast Modal -->
|
|
<div id="email-modal" class="modal-overlay hidden">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3>Send Email to All Users</h3>
|
|
<button class="modal-close" data-action="close-email-modal">×</button>
|
|
</div>
|
|
<form id="email-form">
|
|
<div class="form-group">
|
|
<label for="email-subject">Subject *</label>
|
|
<input type="text" id="email-subject" name="subject" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email-content">Message *</label>
|
|
<textarea id="email-content" name="content" rows="8" required
|
|
placeholder="Your message to all users..."></textarea>
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="submit" class="btn btn-primary">Send Email</button>
|
|
<button type="button" class="btn btn-secondary" data-action="close-email-modal">Cancel</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="js/api-client.js"></script>
|
|
<script src="js/auth.js"></script>
|
|
<script src="js/admin.js"></script>
|
|
|
|
</body>
|
|
</html> |