Advertisement
pastexale

Untitled

Apr 13th, 2025 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.86 KB | Source Code | 0 0
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>{{ report_title }}</title>
  7.     <style>
  8.         body { font-family: sans-serif; line-height: 1.6; margin: 20px; }
  9.         h1, h2, h3 { color: #333; }
  10.         h2 { border-bottom: 1px solid #ccc; padding-bottom: 5px; margin-top: 30px; }
  11.         h3 { margin-top: 25px; color: #555; }
  12.         .report-header p { margin: 2px 0; color: #666; font-size: 0.9em; }
  13.         /* Stile tabella da Pandas to_html (assicurati classi corrispondano) */
  14.         .table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
  15.         .table th, .table td { border: 1px solid #ddd; padding: 8px; text-align: right; }
  16.         .table th { background-color: #f2f2f2; text-align: center; }
  17.         .table-striped tbody tr:nth-of-type(odd) { background-color: #f9f9f9; }
  18.         .table-hover tbody tr:hover { background-color: #f1f1f1; }
  19.         .table-sm td, .table-sm th { padding: .3rem; }
  20.         /* Centra nome evento nell'indice tabella */
  21.         .table thead th:first-child { text-align: left; }
  22.         .table tbody th { text-align: left; }
  23.         /* Stile per i div dei grafici */
  24.         .plotly-graph-div { margin-bottom: 30px; }
  25.     </style>
  26.     <script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
  27. </head>
  28. <body>
  29.  
  30.     <h1>{{ report_title }}</h1>
  31.     <div class="report-header">
  32.         <p><strong>ETF Analizzato:</strong> {{ etf_ticker }}</p>
  33.         <p><strong>Benchmark:</strong> {{ benchmark_ticker }}</p>
  34.         <p><strong>Generato il:</strong> {{ generation_date }}</p>
  35.     </div>
  36.  
  37.     <h2>Riepilogo Metriche per Evento</h2>
  38.     <div>
  39.         {{ summary_table_html | safe }} {# Il filtro 'safe' è essenziale #}
  40.     </div>
  41.    
  42.     {# --- NUOVA SEZIONE VALUTAZIONE --- #}
  43.     {% if evaluation_html %} {# Passato da main.py nel context #}
  44.     <div class="evaluation-section">
  45.         {{ evaluation_html | safe }} {# Stampa l'HTML generato da get_evaluation_summary_html #}
  46.     </div>
  47.     {% endif %}
  48.     {# --- FINE SEZIONE VALUTAZIONE --- #}
  49.  
  50.  
  51.     <h2>Grafici Aggregati</h2>
  52.     {% if aggregate_plots %}
  53.         {% for metric_name, plot_html in aggregate_plots.items() %}
  54.             <div class="plotly-graph-div">
  55.                 {{ plot_html | safe }}
  56.             </div>
  57.         {% endfor %}
  58.     {% else %}
  59.         <p>Nessun grafico aggregato disponibile.</p>
  60.     {% endif %}
  61.  
  62.     <h2>Grafici per Evento Individuale</h2>
  63.     {% if event_plots %}
  64.          {% for event_plot_data in event_plots %}
  65.             <h3>{{ event_plot_data.name }}</h3>
  66.             <div class="plotly-graph-div">
  67.                 {{ event_plot_data.plot_html | safe }}
  68.             </div>
  69.          {% endfor %}
  70.     {% else %}
  71.         <p>Nessun grafico per evento disponibile.</p>
  72.     {% endif %}
  73.  
  74. </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement