Live-update the account page status block after sync
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>
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
<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">
|
||||
<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>
|
||||
@@ -17,19 +18,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<dl class="info-grid">
|
||||
<dt>Status</dt>
|
||||
<dd><span class="badge badge-{{ user.health_state.value }}">{{ user.health_state.value.replace("_", " ") }}</span></dd>
|
||||
|
||||
<dt>MyWhoosh state</dt>
|
||||
<dd>{{ user.mywhoosh_state }}</dd>
|
||||
|
||||
<dt>Garmin state</dt>
|
||||
<dd>{{ user.garmin_state }}</dd>
|
||||
|
||||
<dt>Action reason</dt>
|
||||
<dd>{{ user.action_reason or "-" }}</dd>
|
||||
</dl>
|
||||
{% include "fragments/account_status.html" %}
|
||||
</div>
|
||||
|
||||
{% if user.action_reason == "mywhoosh_device_conflict" %}
|
||||
|
||||
Reference in New Issue
Block a user