Spaces:
Runtime error
Runtime error
File size: 19,874 Bytes
4088a7c 47b08cd 4088a7c d933a8b 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 36a5576 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c 47b08cd 4088a7c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PRISM Marketing Intelligence</title>
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/logo.png') }}">
<link href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist/index.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/components.css') }}">
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
{% block head %}{% endblock %}
</head>
<body>
<div class="app-container">
<!-- Sidebar -->
<nav class="sidebar" id="sidebar">
<div class="sidebar-brand">
<span>PRISM Marketing Intelligence</span>
</div>
<div class="sidebar-nav">
<div class="sidebar-section-title">Data & Setup</div>
{% for item in nav_items[:1] %}
<a href="{{ item.url }}" class="nav-item {{ 'active' if page_id == item.id else '' }} {{ 'disabled' if item.get('disabled') else '' }}">
<svg class="nav-icon"><use href="#icon-{{ item.icon }}"></use></svg>
<span class="nav-label">{{ item.name }}</span>
</a>
{% endfor %}
<div class="sidebar-section-title">Descriptive</div>
{% for item in nav_items[1:6] %}
<a href="{{ item.url }}" class="nav-item {{ 'active' if page_id == item.id else '' }} {{ 'disabled' if item.get('disabled') else '' }}">
<svg class="nav-icon"><use href="#icon-{{ item.icon }}"></use></svg>
<span class="nav-label">{{ item.name }}</span>
</a>
{% endfor %}
<div class="sidebar-section-title">Diagnostics</div>
{% for item in nav_items[6:10] %}
<a href="{{ item.url }}" class="nav-item {{ 'active' if page_id == item.id else '' }} {{ 'disabled' if item.get('disabled') else '' }}">
<svg class="nav-icon"><use href="#icon-{{ item.icon }}"></use></svg>
<span class="nav-label">{{ item.name }}</span>
</a>
{% endfor %}
<div class="sidebar-section-title">Strategy</div>
{% for item in nav_items[10:13] %}
<a href="{{ item.url }}" class="nav-item {{ 'active' if page_id == item.id else '' }} {{ 'disabled' if item.get('disabled') else '' }}">
<svg class="nav-icon"><use href="#icon-{{ item.icon }}"></use></svg>
<span class="nav-label">{{ item.name }}</span>
</a>
{% endfor %}
<div class="sidebar-section-title">Monitoring</div>
{% for item in nav_items[13:14] %}
<a href="{{ item.url }}" class="nav-item {{ 'active' if page_id == item.id else '' }} {{ 'disabled' if item.get('disabled') else '' }}">
<svg class="nav-icon"><use href="#icon-{{ item.icon }}"></use></svg>
<span class="nav-label">{{ item.name }}</span>
</a>
{% endfor %}
<div class="sidebar-section-title">Admin</div>
{% for item in nav_items[14:] %}
<a href="{{ item.url }}" class="nav-item {{ 'active' if page_id == item.id else '' }} {{ 'disabled' if item.get('disabled') else '' }}">
<svg class="nav-icon"><use href="#icon-{{ item.icon }}"></use></svg>
<span class="nav-label">{{ item.name }}</span>
</a>
{% endfor %}
</div>
<div class="sidebar-toggle">
<button onclick="toggleSidebar()" title="Toggle sidebar">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M11 19l-7-7 7-7M18 19l-7-7 7-7"/></svg>
</button>
</div>
</nav>
<!-- Main Content -->
<div class="main-content">
<header class="topbar">
<div class="topbar-left">
<h1>{% block page_title %}Dashboard{% endblock %}</h1>
</div>
<div class="topbar-right">
<button class="topbar-btn alert-bell-btn" onclick="window.location.href='/alerts'" title="Alerts & Simulation">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 01-3.46 0"/></svg>
<span class="alert-bell-count" id="alertBellCount">0</span>
</button>
<button class="topbar-btn" onclick="toggleNOVA()" id="novaTopBtn" title="Ask NOVA">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>
NOVA
</button>
<button class="topbar-btn" onclick="toggleTheme()" id="themeToggleBtn" title="Toggle light/dark theme">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" id="themeIcon">
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/>
</svg>
<span id="themeLabel">Light</span>
</button>
<button class="topbar-btn" onclick="exportPage()">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>
Export
</button>
<div class="topbar-user" title="Signed in as {{ current_user }}">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>{{ current_user }}</span>
</div>
<a href="/logout" class="topbar-btn topbar-logout" title="Sign out">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9"/></svg>
Sign Out
</a>
</div>
</header>
{% block filter_bar %}
<div class="filter-bar" id="globalFilterBar">
<div class="filter-group">
<label>Date From</label>
<input type="date" id="filterDateStart" value="{{ filter_options.date_min if filter_options is defined else '' }}">
</div>
<div class="filter-group">
<label>Date To</label>
<input type="date" id="filterDateEnd" value="{{ filter_options.date_max if filter_options is defined else '' }}">
</div>
<div class="filter-group">
<label>Granularity</label>
<select id="filterGranularity">
<option value="monthly" selected>Monthly</option>
<option value="weekly">Weekly</option>
<option value="quarterly">Quarterly</option>
<option value="yearly">Yearly</option>
</select>
</div>
<div class="filter-group">
<label>Brand</label>
<select id="filterBrand" multiple>
{% if filter_options is defined %}
{% for b in filter_options.brands %}
<option value="{{ b }}">{{ b }}</option>
{% endfor %}
{% endif %}
</select>
</div>
<div class="filter-group">
<label>Region</label>
<select id="filterRegion" multiple>
{% if filter_options is defined %}
{% for r in filter_options.regions %}
<option value="{{ r }}">{{ r }}</option>
{% endfor %}
{% endif %}
</select>
</div>
<div class="filter-actions">
<button class="btn-apply" onclick="applyFilters()">Apply</button>
<button class="btn-reset" onclick="resetFilters()">Reset</button>
</div>
</div>
{% endblock %}
<main class="page-content">
{% block content %}{% endblock %}
</main>
<footer class="footer">
<span>PRISM Marketing Intelligence | Powered by NOVA — Next-gen Optimization & Value Advisor</span>
<span id="lastRefresh">Last updated: -</span>
</footer>
</div>
</div>
<!-- Fullscreen Modal -->
<div class="chart-fullscreen-overlay" id="fullscreenOverlay" onclick="closeFullscreen(event)">
<div class="chart-fullscreen-content">
<button class="fullscreen-close" onclick="closeFullscreen(event, true)">✕</button>
<div id="fullscreenChart" style="width:100%;height:100%"></div>
</div>
</div>
<!-- NOVA Chat Drawer -->
<div class="nova-overlay" id="novaOverlay" onclick="if(event.target===this)toggleNOVA()"></div>
<div class="nova-drawer" id="novaDrawer">
<div class="nova-header">
<div class="nova-brand">
<div class="nova-logo">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>
</div>
<div>
<div class="nova-title">NOVA</div>
<div class="nova-subtitle">Next-gen Optimization & Value Advisor</div>
</div>
</div>
<button class="nova-close" onclick="toggleNOVA()">✕</button>
</div>
<div class="nova-messages" id="novaMessages">
<div class="nova-msg nova-msg-bot">
<div class="nova-msg-content">
Hello! I'm <strong>NOVA</strong>, your AI-powered marketing analytics advisor. I can help you:
<ul>
<li>Analyze channel performance and trends</li>
<li>Explain anomalies and KPI changes</li>
<li>Recommend budget optimizations</li>
<li>Simulate what-if scenarios</li>
</ul>
What would you like to explore?
</div>
</div>
</div>
<div class="nova-suggestions" id="novaSuggestions">
<button class="nova-suggestion-btn" onclick="sendNOVA('Summarize current marketing performance')">Summarize performance</button>
<button class="nova-suggestion-btn" onclick="sendNOVA('Which channels are underperforming?')">Underperforming channels</button>
<button class="nova-suggestion-btn" onclick="sendNOVA('What are the top opportunities?')">Top opportunities</button>
</div>
<div class="nova-input-area">
<input type="text" class="nova-input" id="novaInput" placeholder="Ask NOVA anything about your marketing data..." onkeydown="if(event.key==='Enter')sendNOVAFromInput()">
<button class="nova-send-btn" onclick="sendNOVAFromInput()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
</button>
</div>
</div>
<!-- NOVA Floating Button -->
<button class="nova-fab" id="novaFab" onclick="toggleNOVA()" title="Ask NOVA">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg>
<span class="nova-fab-label">NOVA</span>
</button>
<!-- SVG Icon Definitions -->
<svg style="display:none" xmlns="http://www.w3.org/2000/svg">
<symbol id="icon-home" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></symbol>
<symbol id="icon-bar-chart-2" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></symbol>
<symbol id="icon-target" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></symbol>
<symbol id="icon-tag" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></symbol>
<symbol id="icon-truck" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="3" width="15" height="13"/><polygon points="16 8 20 8 23 11 23 16 16 16 16 8"/><circle cx="5.5" cy="18.5" r="2.5"/><circle cx="18.5" cy="18.5" r="2.5"/></symbol>
<symbol id="icon-activity" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></symbol>
<symbol id="icon-trending-up" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"/><polyline points="17 6 23 6 23 12"/></symbol>
<symbol id="icon-git-branch" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="3" x2="6" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 01-9 9"/></symbol>
<symbol id="icon-sliders" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/></symbol>
<symbol id="icon-cpu" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2" ry="2"/><rect x="9" y="9" width="6" height="6"/><line x1="9" y1="1" x2="9" y2="4"/><line x1="15" y1="1" x2="15" y2="4"/><line x1="9" y1="20" x2="9" y2="23"/><line x1="15" y1="20" x2="15" y2="23"/><line x1="20" y1="9" x2="23" y2="9"/><line x1="20" y1="14" x2="23" y2="14"/><line x1="1" y1="9" x2="4" y2="9"/><line x1="1" y1="14" x2="4" y2="14"/></symbol>
<symbol id="icon-database" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/></symbol>
<symbol id="icon-file-text" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></symbol>
<symbol id="icon-bell" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 01-3.46 0"/></symbol>
<symbol id="icon-dollar-sign" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"/></symbol>
<symbol id="icon-credit-card" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"/><line x1="1" y1="10" x2="23" y2="10"/></symbol>
<symbol id="icon-percent" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="5" x2="5" y2="19"/><circle cx="6.5" cy="6.5" r="2.5"/><circle cx="17.5" cy="17.5" r="2.5"/></symbol>
<symbol id="icon-pie-chart" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.21 15.89A10 10 0 118 2.83"/><path d="M22 12A10 10 0 0012 2v10z"/></symbol>
<symbol id="icon-users" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></symbol>
<symbol id="icon-eye" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></symbol>
<symbol id="icon-mouse-pointer" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/><path d="M13 13l6 6"/></symbol>
<symbol id="icon-check-circle" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 11-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></symbol>
<symbol id="icon-layers" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></symbol>
<symbol id="icon-link" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/></symbol>
<symbol id="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></symbol>
</svg>
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
<script src="{{ url_for('static', filename='js/charts.js') }}"></script>
<script src="{{ url_for('static', filename='js/multiselect.js') }}"></script>
<script src="{{ url_for('static', filename='js/filters.js') }}"></script>
<script src="{{ url_for('static', filename='js/nova.js') }}"></script>
{% block scripts %}{% endblock %}
</body>
</html>
|