This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Timmy-time-dashboard/src/dashboard/templates/partials/approvals_list.html
Alexander Payne d7aaae74d5 feat: Hands Dashboard Routes and UI (Phase 3.6)
Add dashboard for managing autonomous Hands:

Routes (src/dashboard/routes/hands.py):
- GET /api/hands - List all Hands with status
- GET /api/hands/{name} - Get Hand details
- POST /api/hands/{name}/trigger - Manual trigger
- POST /api/hands/{name}/pause - Pause scheduled Hand
- POST /api/hands/{name}/resume - Resume paused Hand
- GET /api/approvals - List pending approvals
- POST /api/approvals/{id}/approve - Approve request
- POST /api/approvals/{id}/reject - Reject request
- GET /api/executions - List execution history

Templates:
- hands.html - Main dashboard page
- partials/hands_list.html - Active Hands list
- partials/approvals_list.html - Pending approvals
- partials/hand_executions.html - Execution history

Integration:
- Wired up in app.py
- Navigation links in base.html
2026-02-26 12:46:48 -05:00

45 lines
1.7 KiB
HTML

{# Approvals list partial #}
{% if approvals %}
<div class="list-group list-group-flush" id="approval-list">
{% for approval in approvals %}
<div class="list-group-item p-3" id="approval-{{ approval.id }}">
<div class="d-flex justify-content-between align-items-start mb-2">
<div>
<h6 class="mb-0">{{ approval.hand_name }}</h6>
<small class="text-muted">{{ approval.action }}</small>
</div>
<span class="badge bg-warning text-dark">PENDING</span>
</div>
<p class="small mb-2">{{ approval.description }}</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ approval.created_at.strftime('%H:%M') if approval.created_at else 'Unknown' }}
</small>
<div class="btn-group btn-group-sm">
<button class="btn btn-success"
hx-post="/hands/api/approvals/{{ approval.id }}/approve"
hx-target="#approvals-container"
hx-swap="outerHTML">
✓ Approve
</button>
<button class="btn btn-danger"
hx-post="/hands/api/approvals/{{ approval.id }}/reject"
hx-target="#approvals-container"
hx-swap="outerHTML">
✗ Reject
</button>
</div>
</div>
</div>
{% endfor %}
</div>
<script>document.getElementById('approval-count').textContent = '{{ approvals|length }}';</script>
{% else %}
<div class="text-center py-4 text-muted">
<p class="mb-0 small">No pending approvals.</p>
</div>
<script>document.getElementById('approval-count').textContent = '0';</script>
{% endif %}