Mirrors the dashboard's row update: "Sync now" on the account page refreshes the status block in place and shows a toast, instead of navigating to a separate result page. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
70 lines
2.3 KiB
HTML
70 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}My Account - MyWhoosh Garmin Sync{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>{{ user.name }}</h1>
|
|
<div class="page-actions">
|
|
<a class="btn secondary" href="/account/edit">Edit</a>
|
|
<form method="post" action="/account/sync" class="inline-form"
|
|
hx-post="/account/sync" hx-target="#account-status" hx-swap="outerHTML" hx-disabled-elt="find button">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button type="submit">Sync now</button>
|
|
</form>
|
|
<form method="post" action="/account-logout" class="inline-form">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button type="submit" class="secondary">Log out</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="card">
|
|
{% include "fragments/account_status.html" %}
|
|
</div>
|
|
|
|
{% if user.action_reason == "mywhoosh_device_conflict" %}
|
|
<h2>MyWhoosh device conflict</h2>
|
|
<div class="card">
|
|
<p>MyWhoosh reports this account is already logged in on another device. Log out of MyWhoosh there (app or website), then retry the sync.</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<h2>Recent sync runs</h2>
|
|
<div class="card">
|
|
{% if recent_runs %}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Started</th>
|
|
<th>Finished</th>
|
|
<th>Status</th>
|
|
<th>Discovered</th>
|
|
<th>Imported</th>
|
|
<th>Skipped</th>
|
|
<th>Failed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for run in recent_runs %}
|
|
<tr>
|
|
<td>{{ run.started_at }}</td>
|
|
<td>{{ run.finished_at or "-" }}</td>
|
|
<td><span class="badge badge-{{ run.status.value }}">{{ run.status.value }}</span></td>
|
|
<td>{{ run.discovered_count }}</td>
|
|
<td>{{ run.imported_count }}</td>
|
|
<td>{{ run.skipped_count }}</td>
|
|
<td>{{ run.failed_count }}</td>
|
|
</tr>
|
|
{% if run.summary_error %}
|
|
<tr>
|
|
<td colspan="7" class="summary-error">{{ run.summary_error }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<p class="empty-state">No sync runs yet.</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|