51 lines
2.2 KiB
HTML
51 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Workflows & requests — MartinhalApprovalFlow{% endblock %}
|
|
{% block content %}
|
|
<h1>Workflows & requests</h1>
|
|
<p class="sub">Create workflows, watch every request, and open any of them for the full audit trail.</p>
|
|
|
|
<div class="stats">
|
|
<div class="stat"><b>{{ stats.get('pending', 0) }}</b><span>Pending</span></div>
|
|
<div class="stat"><b>{{ stats.get('approved', 0) }}</b><span>Approved</span></div>
|
|
<div class="stat"><b>{{ stats.get('denied', 0) }}</b><span>Denied</span></div>
|
|
</div>
|
|
|
|
<h2>Workflows</h2>
|
|
<div class="card">
|
|
<table>
|
|
<tr><th>Name</th><th>Approval chain</th><th>Knowledge chain</th><th>Status</th><th></th></tr>
|
|
{% for w in workflows %}
|
|
<tr>
|
|
<td><b>{{ w.name }}</b>{% if w.description %}<br><span class="muted">{{ w.description }}</span>{% endif %}</td>
|
|
<td class="mono">{% for a in w.approvers | fromjson %}{{ loop.index }}. {{ a }}{% if not loop.last %}<br>{% endif %}{% endfor %}</td>
|
|
<td class="mono">{% for a in w.knowledge | fromjson %}{{ a }}{% if not loop.last %}<br>{% endif %}{% else %}<span class="muted">—</span>{% endfor %}</td>
|
|
<td>{% if w.active %}<span class="chip">active</span>{% else %}<span class="chip">paused</span>{% endif %}</td>
|
|
<td><a class="btn ghost small" href="{{ url_for('workflow_edit', wid=w.id) }}">Edit</a></td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="5" class="muted">No workflows yet — create the first one.</td></tr>
|
|
{% endfor %}
|
|
</table>
|
|
<a class="btn" href="{{ url_for('workflow_edit') }}">New workflow</a>
|
|
</div>
|
|
|
|
<h2>Requests</h2>
|
|
<div class="card">
|
|
<table>
|
|
<tr><th>#</th><th>Workflow</th><th>From</th><th>Subject</th><th>Status</th><th>Received</th></tr>
|
|
{% for r in rows %}
|
|
<tr>
|
|
<td class="mono"><a href="{{ url_for('admin_request', rid=r.id) }}">{{ r.id }}</a></td>
|
|
<td>{{ r.wf_name }}</td>
|
|
<td class="mono">{{ r.requester }}</td>
|
|
<td><a href="{{ url_for('admin_request', rid=r.id) }}">{{ r.subject }}</a></td>
|
|
<td><span class="stamp {{ r.status }}">{{ r.status }}</span></td>
|
|
<td class="mono muted">{{ r.created_at }}</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="6" class="muted">No requests yet.</td></tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endblock %}
|