read.markets/app/templates/public_base.html
Giorgio Gilestro 47dce1a1a4 compliance: flag-gate AI portfolio + cloud sync + Stripe; de-risk prompts; harden reviewer
Implements docs/read-markets-compliance-changes.md as flag-gated changes
(no deletions) so paused features stay in the tree for future re-enable.
All four flags default False so a fresh deploy is compliance-safe.

- New env flags: PORTFOLIO_AI_ENABLED, PORTFOLIO_SYNC_ENABLED,
  TICKER_UNIVERSE_AGGREGATE_ENABLED, SUBSCRIPTIONS_ENABLED.
- Gates: /api/analyze, /api/portfolio/sync*, /api/stripe/*, /pricing,
  ticker_universe writes, portfolio_analysis.analyse(). is_paid_active()
  returns True for any auth'd user when subscriptions are paused.
- Prompts (PROMPT_VERSION 10): universal _COMPLIANCE_RIDER prepended to
  every system prompt; watch list removed; price-target / close-above-below
  / trigger / forward-state-as-description rules added; SPECULATIVE
  pivoted to regime-only scenarios; daily + weekly digests tightened.
- Reviewer: deterministic regex/lexicon pre-check fail-closed under the
  Haiku call; portfolio rider gated by PORTFOLIO_AI_ENABLED; base prompt
  sharpened for forward-state and MAR forward-opinion patterns;
  ReviewerVerdict audit table; generate_with_review retry helper.
- Migration 0026: purge portfolio_sync + ticker_universe; create
  reviewer_verdicts.
- Copy: MAR cite fixed to Art 3(1)(35) + Art 20 + Del Reg 2016/958;
  portfolio reframed as browser-only viewer in disclaimer / privacy /
  terms / about / pricing / landing (en + it). TODO(legal) marker for
  lawyer sign-off on disclaimer.
- Tests: 13 lexicon + 6 reviewer compliance regressions; conftest enables
  all flags so existing 402 tests still cover their code paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 19:57:12 +02:00

88 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html lang="{{ lang|default('en') }}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{% block title %}{{ BRAND_NAME }}{% endblock %}</title>
<meta name="description" content="{{ (t.meta.description if t is defined and t else None) or TAGLINE }}">
{# Hreflang signals for search engines: tells crawlers that the
same page exists in another language at a different URL. Only
rendered when the route explicitly opts in via lang_switch=true. #}
{% if lang_switch %}
<link rel="alternate" hreflang="en" href="/en/">
<link rel="alternate" hreflang="it" href="/it/">
<link rel="alternate" hreflang="x-default" href="/">
{% endif %}
{# Same flash-prevention theme bootstrap as the app shell. #}
<script>
(function() {
try {
var t = localStorage.getItem('cassandra.theme') || 'light';
document.documentElement.dataset.theme = t;
} catch (e) { document.documentElement.dataset.theme = 'light'; }
})();
</script>
<link rel="stylesheet" href="{{ url_for('static', path='/css/tokens.css') }}?v={{ ASSET_VERSION }}" />
<link rel="stylesheet" href="{{ url_for('static', path='/css/layout.css') }}?v={{ ASSET_VERSION }}" />
<link rel="stylesheet" href="{{ url_for('static', path='/css/panels.css') }}?v={{ ASSET_VERSION }}" />
<link rel="stylesheet" href="{{ url_for('static', path='/css/auth.css') }}?v={{ ASSET_VERSION }}" />
<link rel="stylesheet" href="{{ url_for('static', path='/css/settings.css') }}?v={{ ASSET_VERSION }}" />
<link rel="stylesheet" href="{{ url_for('static', path='/css/public.css') }}?v={{ ASSET_VERSION }}" />
</head>
<body class="public-page">
<div class="public-shell">
<header class="public-header">
<a class="public-header__brand" href="/" aria-label="{{ BRAND_NAME }} home">
{{ BRAND_NAME }}
</a>
<nav class="public-header__nav">
{% if SUBSCRIPTIONS_ENABLED %}
<a href="/pricing" class="{% if request.url.path == '/pricing' %}active{% endif %}">Pricing</a>
{% endif %}
<a href="/about" class="{% if request.url.path == '/about' %}active{% endif %}">About</a>
{# Lang switch — currently only the landing page opts in
(lang_switch=true). When other public pages get translated
this widget will surface there too automatically. #}
{% if lang_switch %}
<span class="public-header__lang-switch" role="group" aria-label="Language">
<a href="/en/" class="public-header__lang {% if lang == 'en' %}active{% endif %}">EN</a>
<a href="/it/" class="public-header__lang {% if lang == 'it' %}active{% endif %}">IT</a>
</span>
{% endif %}
{% if cu and (cu.user or cu.is_admin) %}
<a href="/" class="public-header__cta">Dashboard</a>
{% else %}
<a href="/login" class="public-header__cta">Sign in / sign up</a>
{% endif %}
</nav>
</header>
<main class="public-main">
{% block main %}{% endblock %}
</main>
<footer class="public-footer">
<div class="public-footer__inner">
<div class="public-footer__brand">
<strong>{{ BRAND_NAME }}</strong>
<span class="public-footer__tagline">{{ TAGLINE }}</span>
</div>
<nav class="public-footer__links">
{% if SUBSCRIPTIONS_ENABLED %}<a href="/pricing">Pricing</a>{% endif %}
<a href="/about">About</a>
<a href="/terms">Terms</a>
<a href="/privacy">Privacy</a>
<a href="/disclaimer">Disclaimer</a>
</nav>
<div class="public-footer__meta">
&copy; 2026 {{ LEGAL_OPERATOR }} &middot;
Not investment advice &middot;
{{ OPERATOR_JURISDICTION }} &middot;
ICO ZC098928 &middot;
Last reviewed 2026-05-24
</div>
</div>
</footer>
</div>
</body>
</html>