feat: Enhance governance module with activity tracking and DB refactor

- Refactor database interaction for proposals and activities.
- Add activity tracking for proposal creation and voting.
- Improve logging for better debugging and monitoring.
- Update governance views to display recent activities.
- Add strum and strum_macros crates for enum handling.
- Update Cargo.lock file with new dependencies.
This commit is contained in:
Mahmoud-Emad
2025-05-27 20:45:30 +03:00
parent 70ca9f1605
commit 11d7ae37b6
9 changed files with 193 additions and 335 deletions

View File

@@ -92,17 +92,17 @@
<div class="mt-auto">
<h5><i class="bi bi-calendar-event me-2"></i>Voting Period</h5>
<div class="d-flex justify-content-between align-items-center p-3 bg-light rounded">
{% if proposal.voting_starts_at and proposal.voting_ends_at %}
{% if proposal.vote_start_date and proposal.vote_end_date %}
<div>
<div class="text-muted mb-1">Start Date</div>
<div class="fw-bold">{{ proposal.voting_starts_at | date(format="%Y-%m-%d") }}</div>
<div class="fw-bold">{{ proposal.vote_start_date | date(format="%Y-%m-%d") }}</div>
</div>
<div class="text-center">
<i class="bi bi-arrow-right fs-4 text-muted"></i>
</div>
<div>
<div class="text-muted mb-1">End Date</div>
<div class="fw-bold">{{ proposal.voting_ends_at | date(format="%Y-%m-%d") }}</div>
<div class="fw-bold">{{ proposal.vote_end_date | date(format="%Y-%m-%d") }}</div>
</div>
{% else %}
<div class="text-center w-100">Not set</div>

View File

@@ -106,9 +106,9 @@
</td>
<td>{{ proposal.created_at | date(format="%Y-%m-%d") }}</td>
<td>
{% if proposal.voting_starts_at and proposal.voting_ends_at %}
{{ proposal.voting_starts_at | date(format="%Y-%m-%d") }} to {{
proposal.voting_ends_at | date(format="%Y-%m-%d") }}
{% if proposal.vote_start_date and proposal.vote_end_date %}
{{ proposal.vote_start_date | date(format="%Y-%m-%d") }} to {{
proposal.vote_end_date | date(format="%Y-%m-%d") }}
{% else %}
Not set
{% endif %}