208 lines
11 KiB
HTML
208 lines
11 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Flows Dashboard{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row mb-4">
|
|
<div class="col-md-8">
|
|
<h1 class="display-5 mb-4">Flows Dashboard</h1>
|
|
<p class="lead">Track and manage workflow processes across the organization.</p>
|
|
</div>
|
|
<div class="col-md-4 text-md-end">
|
|
<a href="/flows/create" class="btn btn-primary">
|
|
<i class="bi bi-plus-circle me-1"></i> Create New Workflow
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Statistics Cards -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-3 mb-3">
|
|
<div class="card text-white bg-primary h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Total Flows</h5>
|
|
<p class="display-4">{{ stats.total_flows }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3 mb-3">
|
|
<div class="card text-white bg-success h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">In Progress</h5>
|
|
<p class="display-4">{{ stats.in_progress_flows }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3 mb-3">
|
|
<div class="card text-white bg-danger h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Stuck</h5>
|
|
<p class="display-4">{{ stats.stuck_flows }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3 mb-3">
|
|
<div class="card text-white bg-info h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Completed</h5>
|
|
<p class="display-4">{{ stats.completed_flows }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filter Controls -->
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Filter Workflows</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<form class="row g-3" action="/flows" method="get">
|
|
<div class="col-md-3">
|
|
<label for="status" class="form-label">Status</label>
|
|
<select class="form-select" id="status" name="status">
|
|
<option value="all" selected>All</option>
|
|
<option value="in_progress">In Progress</option>
|
|
<option value="completed">Completed</option>
|
|
<option value="stuck">Stuck</option>
|
|
<option value="cancelled">Cancelled</option>
|
|
</select>
|
|
</div>
|
|
<!-- Freezone filter - for UI demonstration only -->
|
|
<div class="col-md-3">
|
|
<label for="freezone" class="form-label">Freezone</label>
|
|
<select class="form-select" id="freezone" name="freezone" disabled>
|
|
<option value="all" selected>All Freezones</option>
|
|
<option value="dubai_multi_commodities_centre">DMCC</option>
|
|
<option value="dubai_international_financial_centre">DIFC</option>
|
|
<option value="jebel_ali_free_zone">JAFZA</option>
|
|
<option value="dubai_silicon_oasis">DSO</option>
|
|
<option value="dubai_internet_city">DIC</option>
|
|
<option value="dubai_media_city">DMC</option>
|
|
<option value="abu_dhabi_global_market">ADGM</option>
|
|
</select>
|
|
<div class="form-text">Coming soon</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="type" class="form-label">Workflow Type</label>
|
|
<select class="form-select" id="type" name="type">
|
|
<option value="all" selected>All</option>
|
|
<option value="company_registration">Company Incorporation</option>
|
|
<option value="user_onboarding">KYC Verification</option>
|
|
<option value="service_activation">License Activation</option>
|
|
<option value="payment_processing">Payment Processing</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="search" class="form-label">Search</label>
|
|
<input type="text" class="form-control" id="search" name="search" placeholder="Search workflows...">
|
|
</div>
|
|
<div class="col-12 text-end">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="bi bi-filter me-1"></i> Apply Filters
|
|
</button>
|
|
<a href="/flows" class="btn btn-outline-secondary">
|
|
<i class="bi bi-x-circle me-1"></i> Clear Filters
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Flows Table -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">All Workflows</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if flows|length > 0 %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>Workflow Name</th>
|
|
<th>Type</th>
|
|
<th>Status</th>
|
|
<th>Assignee</th>
|
|
<th>Progress</th>
|
|
<th>Initiated</th>
|
|
<th>Last Updated</th>
|
|
<th>Current Stage</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for flow in flows %}
|
|
<tr>
|
|
<td>
|
|
<a href="/flows/{{ flow.id }}">{{ flow.name }}</a>
|
|
</td>
|
|
<td>{{ flow.flow_type }}</td>
|
|
<td>
|
|
<span
|
|
class="badge {% if flow.status == 'In Progress' %}bg-primary{% elif flow.status == 'Completed' %}bg-success{% elif flow.status == 'Stuck' %}bg-danger{% else %}bg-secondary{% endif %}">
|
|
{{ flow.status }}
|
|
</span>
|
|
</td>
|
|
<td>{{ flow.owner_name }}</td>
|
|
<td>
|
|
<div class="progress mb-2" style="height: 20px;">
|
|
<div class="progress-bar {% if flow.status == 'Completed' %}bg-success{% elif flow.status == 'Stuck' %}bg-danger{% else %}bg-primary{% endif %}"
|
|
role="progressbar" style="width: {{ flow.progress_percentage }}%;"
|
|
aria-valuenow="{{ flow.progress_percentage }}" aria-valuemin="0"
|
|
aria-valuemax="100">{{ flow.progress_percentage }}%</div>
|
|
</div>
|
|
</td>
|
|
<td>{{ flow.created_at | date(format="%Y-%m-%d") }}</td>
|
|
<td>{{ flow.updated_at | date(format="%Y-%m-%d") }}</td>
|
|
<td>
|
|
{% set current = flow.current_step %}
|
|
{% if current %}
|
|
{{ current.name }}
|
|
{% else %}
|
|
{% if flow.status == 'Completed' %}
|
|
<span class="text-success">All stages completed</span>
|
|
{% elif flow.status == 'Cancelled' %}
|
|
<span class="text-secondary">Workflow cancelled</span>
|
|
{% else %}
|
|
<span class="text-muted">No active stage</span>
|
|
{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<div class="btn-group">
|
|
<a href="/flows/{{ flow.id }}" class="btn btn-sm btn-primary" title="View Details">
|
|
<i class="bi bi-eye"></i>
|
|
</a>
|
|
{% if flow.status == 'In Progress' %}
|
|
<a href="/flows/{{ flow.id }}#advance" class="btn btn-sm btn-success" title="Advance to Next Stage">
|
|
<i class="bi bi-arrow-right"></i>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="text-center py-4">
|
|
<i class="bi bi-search display-1 text-muted"></i>
|
|
<p class="lead mt-3">No workflows found matching your criteria.</p>
|
|
<p class="text-muted">Try adjusting your filters or create a new workflow.</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|