Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="it">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>{{ report_title }}</title>
- <style>
- body { font-family: sans-serif; line-height: 1.6; margin: 20px; }
- h1, h2, h3 { color: #333; }
- h2 { border-bottom: 1px solid #ccc; padding-bottom: 5px; margin-top: 30px; }
- h3 { margin-top: 25px; color: #555; }
- .report-header p { margin: 2px 0; color: #666; font-size: 0.9em; }
- /* Stile tabella da Pandas to_html (assicurati classi corrispondano) */
- .table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
- .table th, .table td { border: 1px solid #ddd; padding: 8px; text-align: right; }
- .table th { background-color: #f2f2f2; text-align: center; }
- .table-striped tbody tr:nth-of-type(odd) { background-color: #f9f9f9; }
- .table-hover tbody tr:hover { background-color: #f1f1f1; }
- .table-sm td, .table-sm th { padding: .3rem; }
- /* Centra nome evento nell'indice tabella */
- .table thead th:first-child { text-align: left; }
- .table tbody th { text-align: left; }
- /* Stile per i div dei grafici */
- .plotly-graph-div { margin-bottom: 30px; }
- </style>
- <script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
- </head>
- <body>
- <h1>{{ report_title }}</h1>
- <div class="report-header">
- <p><strong>ETF Analizzato:</strong> {{ etf_ticker }}</p>
- <p><strong>Benchmark:</strong> {{ benchmark_ticker }}</p>
- <p><strong>Generato il:</strong> {{ generation_date }}</p>
- </div>
- <h2>Riepilogo Metriche per Evento</h2>
- <div>
- {{ summary_table_html | safe }} {# Il filtro 'safe' è essenziale #}
- </div>
- {# --- NUOVA SEZIONE VALUTAZIONE --- #}
- {% if evaluation_html %} {# Passato da main.py nel context #}
- <div class="evaluation-section">
- {{ evaluation_html | safe }} {# Stampa l'HTML generato da get_evaluation_summary_html #}
- </div>
- {% endif %}
- {# --- FINE SEZIONE VALUTAZIONE --- #}
- <h2>Grafici Aggregati</h2>
- {% if aggregate_plots %}
- {% for metric_name, plot_html in aggregate_plots.items() %}
- <div class="plotly-graph-div">
- {{ plot_html | safe }}
- </div>
- {% endfor %}
- {% else %}
- <p>Nessun grafico aggregato disponibile.</p>
- {% endif %}
- <h2>Grafici per Evento Individuale</h2>
- {% if event_plots %}
- {% for event_plot_data in event_plots %}
- <h3>{{ event_plot_data.name }}</h3>
- <div class="plotly-graph-div">
- {{ event_plot_data.plot_html | safe }}
- </div>
- {% endfor %}
- {% else %}
- <p>Nessun grafico per evento disponibile.</p>
- {% endif %}
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement