Skip to content

Commit 0da4715

Browse files
committed
feat: add Finterion auth login embedding to backtest report
1 parent 35cf936 commit 0da4715

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

investing_algorithm_framework/app/reporting/templates/dashboard.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ body { font-family:'Inter',-apple-system,sans-serif; background:var(--bg); color
262262
.fin-hero-sub { font-size:0.88rem; color:var(--text-secondary); line-height:1.7; max-width:560px; margin:0 auto; }
263263
.finterion-cta { display:inline-block; margin-top:1.25rem; padding:0.65rem 1.75rem; background:var(--accent); color:#000; font-weight:600; font-size:0.82rem; border-radius:8px; text-decoration:none; transition:opacity 0.15s; }
264264
.finterion-cta:hover { opacity:0.85; }
265+
.finterion-connect-btn { display:inline-block; margin-top:0.5rem; padding:0.55rem 1.5rem; background:transparent; color:var(--accent); font-weight:600; font-size:0.82rem; border-radius:8px; border:2px solid var(--accent); cursor:pointer; transition:all 0.15s; font-family:'Inter',sans-serif; }
266+
.finterion-connect-btn:hover { background:var(--accent); color:#000; }
267+
.fin-user-info { display:inline-flex; align-items:center; gap:0.5rem; margin-top:1rem; padding:0.5rem 1rem; background:var(--surface2); border:1px solid var(--border); border-radius:8px; font-size:0.8rem; color:var(--text-secondary); }
268+
.fin-user-dot { width:8px; height:8px; border-radius:50%; background:#22c55e; flex-shrink:0; }
265269

266270
/* feature cards */
267271
.fin-features { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem; margin-bottom:0.5rem; }

investing_algorithm_framework/app/reporting/templates/dashboard_template.html.j2

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<style>
88
{{ css }}
99
</style>
10+
<script src="https://finterion.com/sdk/finterion-auth.js"></script>
1011
</head>
1112
<body>
1213

@@ -479,6 +480,13 @@
479480
</p>
480481
<a class="finterion-cta" href="https://finterion.com" target="_blank"
481482
rel="noopener noreferrer">Get Started &rarr;</a>
483+
<div style="margin-top:1.25rem">
484+
<button id="connect-btn" class="finterion-connect-btn">Connect to Finterion</button>
485+
</div>
486+
<div id="finterion-user-info" class="fin-user-info" style="display:none">
487+
<span class="fin-user-dot"></span>
488+
Connected as <strong id="finterion-username"></strong>
489+
</div>
482490
</div>
483491

484492
{# Features #}
@@ -559,6 +567,29 @@ const RUN_LABELS = {{ run_labels | tojson }};
559567
const BENCHMARKS = {{ benchmarks | tojson }};
560568
// ===== STATIC JS =====
561569
{{ js }}
570+
571+
// ===== FINTERION AUTH =====
572+
(function() {
573+
if (typeof FinterionAuth === 'undefined') return;
574+
var auth = new FinterionAuth();
575+
var btn = document.getElementById('connect-btn');
576+
if (!btn) return;
577+
btn.addEventListener('click', function() {
578+
auth.login()
579+
.then(function(user) {
580+
var info = document.getElementById('finterion-user-info');
581+
var name = document.getElementById('finterion-username');
582+
if (info && name) {
583+
name.textContent = user.username;
584+
info.style.display = 'inline-flex';
585+
}
586+
btn.style.display = 'none';
587+
})
588+
.catch(function(err) {
589+
console.log('Auth flow cancelled');
590+
});
591+
});
592+
})();
562593
</script>
563594

564595
<button class="compare-btn" id="compare-btn"

0 commit comments

Comments
 (0)