feat: Add total vote counts to governance views

- Add functionality to calculate total yes, no, and abstain votes
  across all proposals. This provides a summary of community
  voting patterns on the governance page.
- Improve the user experience by displaying total vote counts
  prominently on the "My Votes" page. This gives users a quick
  overview of the overall voting results.
- Enhance the "Create Proposal" page with informative guidelines
  and a helpful alert to guide users through the proposal creation
  process.  This improves clarity and ensures proposals are well-
  structured.
This commit is contained in:
Mahmoud-Emad
2025-05-22 16:08:12 +03:00
parent 4659697ae2
commit fad288f67d
3 changed files with 106 additions and 71 deletions

View File

@@ -4,13 +4,6 @@
{% block content %}
<div class="container-fluid">
<div class="row mb-4">
<div class="col-12">
<h1 class="display-5 mb-4">Create Governance Proposal</h1>
<p class="lead">Submit a new proposal for the community to vote on.</p>
</div>
</div>
<!-- Navigation Tabs -->
<div class="row mb-4">
<div class="col-12">
@@ -30,11 +23,26 @@
</ul>
</div>
</div>
<!-- Proposal Form -->
<!-- Info Alert -->
<div class="row">
<div class="col-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 Creating Proposals</h5>
<p>Creating a proposal is an important step in our community governance process. Well-crafted proposals clearly state the problem, solution, and implementation details. The community will review and vote on your proposal, so be thorough and thoughtful in your submission.</p>
<div class="mt-2">
<a href="/governance/proposal-templates" class="btn btn-sm btn-outline-primary"><i class="bi bi-file-earmark-text"></i> Proposal Templates</a>
</div>
</div>
</div>
</div>
<!-- Proposal Form and Guidelines in Flex Layout -->
<div class="row mb-4">
<div class="col-md-8 mx-auto">
<div class="card">
<!-- Proposal Form Column -->
<div class="col-lg-8">
<div class="card h-100">
<div class="card-header">
<h5 class="mb-0">New Proposal</h5>
</div>
@@ -49,7 +57,7 @@
<div class="mb-3">
<label for="description" class="form-label">Description</label>
<textarea class="form-control" id="description" name="description" rows="6" required
<textarea class="form-control" id="description" name="description" rows="8" required
placeholder="Provide a detailed description of your proposal..."></textarea>
<div class="form-text">Explain the purpose, benefits, and implementation details</div>
</div>
@@ -84,12 +92,10 @@
</div>
</div>
</div>
</div>
<!-- Guidelines Card -->
<div class="row mb-4">
<div class="col-md-8 mx-auto">
<div class="card bg-light">
<!-- Guidelines Column -->
<div class="col-lg-4">
<div class="card bg-light h-100">
<div class="card-header">
<h5 class="mb-0">Proposal Guidelines</h5>
</div>