06/03 Optimize codes, fix Schwab Account
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
<div class="row g-3">
|
||||
{% for acct in accounts %}
|
||||
{% set ta = teller_map.get(acct.id) %}
|
||||
{% set sa = schwab_map.get(acct.id) %}
|
||||
<div class="col-12 col-md-6 col-xl-4">
|
||||
<div class="pcard" style="border-left: 4px solid {{ acct.color }};">
|
||||
|
||||
@@ -41,6 +42,9 @@
|
||||
{% if ta %}
|
||||
<span style="font-size:10px;background:#dbeafe;color:#1e40af;border-radius:4px;padding:1px 5px;margin-left:4px;vertical-align:middle;">Teller</span>
|
||||
{% endif %}
|
||||
{% if sa %}
|
||||
<span style="font-size:10px;background:#d1fae5;color:#065f46;border-radius:4px;padding:1px 5px;margin-left:4px;vertical-align:middle;">Schwab</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div style="font-size:11px;color:var(--muted);">{{ acct.account_type | replace('_',' ') | title }}</div>
|
||||
</div>
|
||||
@@ -119,7 +123,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Teller action buttons (only for accounts linked to Teller) -->
|
||||
<!-- Teller action buttons -->
|
||||
{% if ta %}
|
||||
<div class="d-flex gap-2 mt-2 pt-2" style="border-top:1px solid var(--border);">
|
||||
<button id="refbtn-{{ acct.id }}"
|
||||
@@ -150,6 +154,30 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Schwab action buttons -->
|
||||
{% if sa %}
|
||||
<div class="d-flex gap-2 mt-2 pt-2" style="border-top:1px solid var(--border);">
|
||||
<form method="POST" action="{{ url_for('schwab.sync_snapshot', schwab_account_id=sa.id) }}" style="flex:1;">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<input type="hidden" name="next" value="{{ url_for('accounts.index', tab=tab) }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-success w-100" style="font-size:11px;"
|
||||
title="Pull live balance and investment positions from Schwab">
|
||||
<i class="bi bi-arrow-clockwise me-1"></i>Balance & Positions
|
||||
</button>
|
||||
</form>
|
||||
<a href="{{ url_for('schwab.sync_preview_view', schwab_account_id=sa.id) }}"
|
||||
class="btn btn-sm btn-outline-primary flex-fill" style="font-size:11px;"
|
||||
title="Import new transactions from Schwab">
|
||||
<i class="bi bi-cloud-download me-1"></i>Transactions
|
||||
</a>
|
||||
</div>
|
||||
{% if sa.last_sync_date %}
|
||||
<div style="font-size:10px;color:var(--muted);margin-top:4px;text-align:right;">
|
||||
Last synced {{ sa.last_sync_date.strftime('%b %d') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
@@ -57,7 +57,14 @@
|
||||
<i class="bi bi-graph-up-arrow text-muted" style="font-size:3rem;"></i>
|
||||
<h5 class="mt-3 mb-1">No investments yet</h5>
|
||||
<p class="text-muted small mb-3">Track stocks, ETFs, crypto, real estate, and more.</p>
|
||||
<a href="{{ url_for('investments.new') }}" class="btn btn-primary btn-sm">Add First Holding</a>
|
||||
<div class="d-flex gap-2 justify-content-center flex-wrap">
|
||||
<a href="{{ url_for('investments.new') }}" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-plus-lg me-1"></i>Add Holding
|
||||
</a>
|
||||
<a href="{{ url_for('schwab.index') }}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-bank2 me-1"></i>Sync from Schwab
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user