Extract dashboard row and sync-all form into reusable partials
These render the initial dashboard page today and will also be rendered standalone by the sync routes in the next commits, so the same markup drives both the full page and the post-sync response. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,36 +27,12 @@
|
||||
|
||||
<div class="page-actions">
|
||||
<a class="btn secondary" href="/users/new">Add user</a>
|
||||
<form method="post" action="/sync-all" class="inline-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button type="submit">Sync all now</button>
|
||||
</form>
|
||||
{% include "fragments/sync_all_form.html" %}
|
||||
</div>
|
||||
|
||||
<ul class="user-list">
|
||||
{% for row in rows %}
|
||||
<li class="card user-card">
|
||||
<div class="user-main">
|
||||
<a class="user-name" href="/users/{{ row.id }}">{{ row.name }}</a>
|
||||
<div class="user-meta">
|
||||
<span class="badge badge-{{ row.health_state }}">{{ row.health_state.replace("_", " ") }}</span>
|
||||
<span>{{ "enabled" if row.enabled else "disabled" }}</span>
|
||||
<span>last sync: {{ row.last_sync_at or "-" }}</span>
|
||||
<span>last activity: {{ row.last_activity_name or "-" }} ({{ row.last_activity_status or "-" }})</span>
|
||||
</div>
|
||||
{% if row.action_reason == "garmin_mfa_required" %}
|
||||
<span class="action-required">Garmin MFA required — <a href="/users/{{ row.id }}">resolve</a></span>
|
||||
{% elif row.action_reason == "mywhoosh_device_conflict" %}
|
||||
<span class="action-required">MyWhoosh account logged in on another device — log out there, then <a href="/users/{{ row.id }}">retry</a></span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="user-actions">
|
||||
<form method="post" action="/users/{{ row.id }}/sync" class="inline-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button type="submit" class="secondary">Sync now</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
{% include "fragments/user_row.html" %}
|
||||
{% else %}
|
||||
<li class="card empty-state">No users yet.</li>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user