implement contracts
This commit is contained in:
134
actix_mvc_app/src/views/contracts/my_contracts.html
Normal file
134
actix_mvc_app/src/views/contracts/my_contracts.html
Normal file
@@ -0,0 +1,134 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}My Contracts{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/contracts">Contracts Dashboard</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">My Contracts</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h1 class="display-5 mb-0">My Contracts</h1>
|
||||
<div class="btn-group">
|
||||
<a href="/contracts/create" class="btn btn-primary">
|
||||
<i class="bi bi-plus-circle me-1"></i> Create New Contract
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Filters</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="/contracts/my-contracts" method="get" class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<label for="status" class="form-label">Status</label>
|
||||
<select class="form-select" id="status" name="status">
|
||||
<option value="">All Statuses</option>
|
||||
<option value="Draft">Draft</option>
|
||||
<option value="PendingSignatures">Pending Signatures</option>
|
||||
<option value="Signed">Signed</option>
|
||||
<option value="Expired">Expired</option>
|
||||
<option value="Cancelled">Cancelled</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="type" class="form-label">Contract Type</label>
|
||||
<select class="form-select" id="type" name="type">
|
||||
<option value="">All Types</option>
|
||||
<option value="Service">Service Agreement</option>
|
||||
<option value="Employment">Employment Contract</option>
|
||||
<option value="NDA">Non-Disclosure Agreement</option>
|
||||
<option value="SLA">Service Level Agreement</option>
|
||||
<option value="Other">Other</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 d-flex align-items-end">
|
||||
<button type="submit" class="btn btn-primary w-100">Apply Filters</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contract List -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">My Contracts</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if contracts and contracts | length > 0 %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Contract Title</th>
|
||||
<th>Type</th>
|
||||
<th>Status</th>
|
||||
<th>Signers</th>
|
||||
<th>Created</th>
|
||||
<th>Updated</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for contract in contracts %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/contracts/{{ contract.id }}">{{ contract.title }}</a>
|
||||
</td>
|
||||
<td>{{ contract.contract_type }}</td>
|
||||
<td>
|
||||
<span class="badge {% if contract.status == 'Signed' %}bg-success{% elif contract.status == 'PendingSignatures' %}bg-warning text-dark{% elif contract.status == 'Draft' %}bg-secondary{% elif contract.status == 'Expired' %}bg-danger{% else %}bg-dark{% endif %}">
|
||||
{{ contract.status }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ contract.signed_signers }}/{{ contract.signers|length }}</td>
|
||||
<td>{{ contract.created_at | date(format="%Y-%m-%d") }}</td>
|
||||
<td>{{ contract.updated_at | date(format="%Y-%m-%d") }}</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a href="/contracts/{{ contract.id }}" class="btn btn-sm btn-primary">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
{% if contract.status == 'Draft' %}
|
||||
<a href="/contracts/{{ contract.id }}/edit" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-file-earmark-text fs-1 text-muted"></i>
|
||||
<p class="mt-3 text-muted">You don't have any contracts yet</p>
|
||||
<a href="/contracts/create" class="btn btn-primary mt-2">
|
||||
<i class="bi bi-plus-circle me-1"></i> Create Your First Contract
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user