ecom-qa / templates /base.html
rnyx's picture
Initial deploy
f48b219
Raw
History Blame Contribute Delete
2.38 kB
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{% block title %}EcomQA{% endblock %} — Product Intelligence Engine</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" />
<script>
// Apply saved theme BEFORE paint to avoid flash
(function () {
try {
const saved = localStorage.getItem("ecomqa-theme");
if (saved === "light" || saved === "dark") {
document.documentElement.setAttribute("data-theme", saved);
}
} catch (e) {}
})();
</script>
</head>
<body>
<nav class="navbar">
<a class="brand" href="{{ url_for('index') }}">
<span class="brand-icon"></span> EcomQA
</a>
<div class="nav-links">
<a href="{{ url_for('index') }}" class="nav-link {% if request.endpoint == 'index' %}active{% endif %}">Ask</a>
<a href="{{ url_for('compare_page') }}" class="nav-link {% if request.endpoint == 'compare_page' %}active{% endif %}">Compare</a>
{% if current_user.is_authenticated %}
<a href="{{ url_for('history') }}" class="nav-link {% if request.endpoint == 'history' %}active{% endif %}">History</a>
<a href="{{ url_for('logout') }}" class="nav-link">Logout ({{ current_user.username }})</a>
{% else %}
<a href="{{ url_for('login') }}" class="nav-link {% if request.endpoint == 'login' %}active{% endif %}">Login</a>
<a href="{{ url_for('register') }}" class="nav-btn">Sign up</a>
{% endif %}
<button id="themeToggle"
class="theme-toggle"
type="button"
aria-label="Toggle theme"
title="Toggle dark / light mode">
<span class="theme-icon-dark">🌙</span>
<span class="theme-icon-light"></span>
</button>
</div>
</nav>
<main class="main-content">
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, msg in messages %}
<div class="alert alert-{{ category }}">{{ msg }}</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
</main>
<footer class="footer">
<p>EcomQA · BERT + Flan-T5 + RAG · Open-source NLP pipeline</p>
</footer>
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
{% block scripts %}{% endblock %}
</body>
</html>