05/31 Fix template
This commit is contained in:
@@ -138,7 +138,12 @@ def map_accounts(enrollment_id):
|
|||||||
@login_required
|
@login_required
|
||||||
def index():
|
def index():
|
||||||
enrollments = TellerEnrollment.query.filter_by(is_active=True).all()
|
enrollments = TellerEnrollment.query.filter_by(is_active=True).all()
|
||||||
return render_template('teller/index.html', enrollments=enrollments)
|
return render_template('teller/index.html',
|
||||||
|
enrollments=enrollments,
|
||||||
|
teller_app_id=current_app.config.get('TELLER_APP_ID', ''),
|
||||||
|
teller_env=current_app.config.get('TELLER_ENV', 'development'),
|
||||||
|
teller_cert_path=current_app.config.get('TELLER_CERT_PATH', ''),
|
||||||
|
teller_key_path=current_app.config.get('TELLER_KEY_PATH', ''))
|
||||||
|
|
||||||
|
|
||||||
# ── Sync: preview then confirm ────────────────────────────────────────────────
|
# ── Sync: preview then confirm ────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
{% block page_title %}Bank Connections{% endblock %}
|
{% block page_title %}Bank Connections{% endblock %}
|
||||||
|
|
||||||
{% block topbar_actions %}
|
{% block topbar_actions %}
|
||||||
<button id="tellerConnectBtn" class="btn btn-sm btn-primary" style="font-size:12px;">
|
<button id="tellerConnectBtn" class="btn btn-sm btn-primary" style="font-size:12px;"
|
||||||
|
{% if not teller_app_id %}title="TELLER_APP_ID not set in .env" style="opacity:.6;"{% endif %}>
|
||||||
<i class="bi bi-bank me-1"></i>Connect a Bank
|
<i class="bi bi-bank me-1"></i>Connect a Bank
|
||||||
</button>
|
</button>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -96,14 +97,26 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Setup instructions -->
|
<!-- Setup status -->
|
||||||
<div class="pcard mt-2" style="background:#f8fafc;">
|
<div class="pcard mt-2" style="background:#f8fafc;">
|
||||||
<div class="pcard-title mb-2">Setup Requirements</div>
|
<div class="pcard-title mb-2">Setup Status</div>
|
||||||
<div style="font-size:13px;color:var(--muted);line-height:1.8;">
|
<div style="font-size:13px;line-height:1.9;">
|
||||||
<div><i class="bi bi-check-circle-fill text-success me-2"></i>Teller App ID set in <code>.env</code></div>
|
<div>
|
||||||
<div><i class="bi bi-check-circle-fill text-success me-2"></i>Client certificate at <code>{{ config.TELLER_CERT_PATH }}</code></div>
|
<i class="bi bi-{% if teller_app_id %}check-circle-fill text-success{% else %}x-circle-fill text-danger{% endif %} me-2"></i>
|
||||||
<div><i class="bi bi-check-circle-fill text-success me-2"></i>Private key at <code>{{ config.TELLER_KEY_PATH }}</code></div>
|
Teller App ID: {% if teller_app_id %}<code>{{ teller_app_id[:8] }}…</code>{% else %}<span class="text-danger">Not set — add TELLER_APP_ID to .env</span>{% endif %}
|
||||||
<div><i class="bi bi-info-circle text-muted me-2"></i>Environment: <strong>{{ config.TELLER_ENV }}</strong></div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<i class="bi bi-{% if teller_cert_path %}check-circle-fill text-success{% else %}x-circle-fill text-danger{% endif %} me-2"></i>
|
||||||
|
Certificate: <code>{{ teller_cert_path or 'Not set' }}</code>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<i class="bi bi-{% if teller_key_path %}check-circle-fill text-success{% else %}x-circle-fill text-danger{% endif %} me-2"></i>
|
||||||
|
Private Key: <code>{{ teller_key_path or 'Not set' }}</code>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<i class="bi bi-info-circle text-muted me-2"></i>
|
||||||
|
Environment: <strong>{{ teller_env }}</strong>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -116,9 +129,14 @@ const CSRF = '{{ csrf_token() }}';
|
|||||||
function initTellerConnect(btn) {
|
function initTellerConnect(btn) {
|
||||||
if (!btn) return;
|
if (!btn) return;
|
||||||
btn.addEventListener('click', function() {
|
btn.addEventListener('click', function() {
|
||||||
|
const appId = '{{ teller_app_id }}';
|
||||||
|
if (!appId) {
|
||||||
|
alert('TELLER_APP_ID is not set in .env\nAdd it and restart the app.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const teller = TellerConnect.setup({
|
const teller = TellerConnect.setup({
|
||||||
applicationId: '{{ config.TELLER_APP_ID }}',
|
applicationId: '{{ teller_app_id }}',
|
||||||
environment: '{{ config.TELLER_ENV }}',
|
environment: '{{ teller_env }}',
|
||||||
products: ['transactions'],
|
products: ['transactions'],
|
||||||
onSuccess: function(enrollment) {
|
onSuccess: function(enrollment) {
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user