feat: Finish the proposal dashboard

This commit is contained in:
Mahmoud-Emad 2025-05-21 15:56:47 +03:00
parent 8f1438dc01
commit b606923102

View File

@ -29,9 +29,12 @@
<div class="alert alert-info alert-dismissible fade show">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<h5><i class="bi bi-info-circle"></i> About Governance</h5>
<p>The governance system allows token holders to participate in decision-making processes by voting on proposals that affect the platform's future. Create proposals, cast votes, and help shape the direction of our decentralized ecosystem.</p>
<p>The governance system allows token holders to participate in decision-making processes by voting on
proposals that affect the platform's future. Create proposals, cast votes, and help shape the direction
of our decentralized ecosystem.</p>
<div class="mt-2">
<a href="/governance/documentation" class="btn btn-sm btn-outline-primary"><i class="bi bi-book"></i> Read Documentation</a>
<a href="/governance/documentation" class="btn btn-sm btn-outline-primary"><i class="bi bi-book"></i>
Read Documentation</a>
</div>
</div>
</div>
@ -46,8 +49,10 @@
<div class="card-header d-flex justify-content-between align-items-center">
<h5 class="mb-0">Urgent: Voting Closes Soon</h5>
<div>
<span class="badge bg-warning text-dark me-2">Ends: {{ nearest_proposal.voting_ends_at | date(format="%Y-%m-%d") }}</span>
<a href="/governance/proposals/{{ nearest_proposal.id }}" class="btn btn-sm btn-outline-primary">View Full Proposal</a>
<span class="badge bg-warning text-dark me-2">Ends: {{ nearest_proposal.vote_end_date |
date(format="%Y-%m-%d") }}</span>
<a href="/governance/proposals/{{ nearest_proposal.base_data.id }}"
class="btn btn-sm btn-outline-primary">View Full Proposal</a>
</div>
</div>
<div class="card-body">
@ -59,8 +64,10 @@
</div>
<div class="progress mb-3" style="height: 25px;">
<div class="progress-bar bg-success" role="progressbar" style="width: 65%" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100">65% Yes</div>
<div class="progress-bar bg-danger" role="progressbar" style="width: 35%" aria-valuenow="35" aria-valuemin="0" aria-valuemax="100">35% No</div>
<div class="progress-bar bg-success" role="progressbar" style="width: 65%" aria-valuenow="65"
aria-valuemin="0" aria-valuemax="100">65% Yes</div>
<div class="progress-bar bg-danger" role="progressbar" style="width: 35%" aria-valuenow="35"
aria-valuemin="0" aria-valuemax="100">35% No</div>
</div>
<div class="d-flex justify-content-between text-muted small mb-4">
@ -72,7 +79,8 @@
<h5 class="mb-3">Cast Your Vote</h5>
<form>
<div class="mb-3">
<input type="text" class="form-control" placeholder="Optional comment on your vote" aria-label="Vote comment">
<input type="text" class="form-control" placeholder="Optional comment on your vote"
aria-label="Vote comment">
</div>
<div class="d-flex justify-content-between">
<button type="submit" name="vote" value="yes" class="btn btn-success">Vote Yes</button>
@ -114,7 +122,9 @@
<strong>{{ activity.user }}</strong>
<small class="text-muted">{{ activity.timestamp | date(format="%H:%M") }}</small>
</div>
<p class="mb-1">{{ activity.action }} on <a href="/governance/proposals/{{ activity.proposal_id }}">{{ activity.proposal_title }}</a></p>
<p class="mb-1">{{ activity.action }} on <a
href="/governance/proposals/{{ activity.proposal_id }}">{{
activity.proposal_title }}</a></p>
{% if activity.type == "comment" and activity.comment is defined %}
<p class="mb-0 small text-muted">"{{ activity.comment }}"</p>
{% endif %}
@ -142,22 +152,23 @@
<div class="row">
{% set count = 0 %}
{% for proposal in proposals %}
{% if count < 3 %}
<div class="col-md-4 mb-3">
{% if count < 3 %} <div class="col-md-4 mb-3">
<div class="card h-100">
<div class="card-body">
<h5 class="card-title">{{ proposal.title }}</h5>
<h6 class="card-subtitle mb-2 text-muted">By {{ proposal.creator_name }}</h6>
<p class="card-text">{{ proposal.description | truncate(length=100) }}</p>
<div class="d-flex justify-content-between align-items-center">
<span class="badge {% if proposal.status == 'Active' %}bg-success{% elif proposal.status == 'Approved' %}bg-primary{% elif proposal.status == 'Rejected' %}bg-danger{% else %}bg-secondary{% endif %}">
<span
class="badge {% if proposal.status == 'Active' %}bg-success{% elif proposal.status == 'Approved' %}bg-primary{% elif proposal.status == 'Rejected' %}bg-danger{% else %}bg-secondary{% endif %}">
{{ proposal.status }}
</span>
<a href="/governance/proposals/{{ proposal.id }}" class="btn btn-sm btn-outline-primary">View Details</a>
<a href="/governance/proposals/{{ proposal.base_data.id }}"
class="btn btn-sm btn-outline-primary">View Details</a>
</div>
</div>
<div class="card-footer text-muted text-center">
<span>Voting ends: {{ proposal.voting_ends_at | date(format="%Y-%m-%d") }}</span>
<span>Voting ends: {{ proposal.vote_end_date | date(format="%Y-%m-%d") }}</span>
</div>
</div>
</div>