diff --git a/actix_mvc_app/src/controllers/governance.rs b/actix_mvc_app/src/controllers/governance.rs index aa51af5..f0795e9 100644 --- a/actix_mvc_app/src/controllers/governance.rs +++ b/actix_mvc_app/src/controllers/governance.rs @@ -340,6 +340,11 @@ impl GovernanceController { } }; ctx.insert("proposals", &proposals); + + // Add the required context variables for the proposals template + ctx.insert("active_tab", "proposals"); + ctx.insert("status_filter", &None::); + ctx.insert("search_filter", &None::); render_template(&tmpl, "governance/proposals.html", &ctx) } diff --git a/actix_mvc_app/src/views/governance/create_proposal.html b/actix_mvc_app/src/views/governance/create_proposal.html index c81435d..6636e92 100644 --- a/actix_mvc_app/src/views/governance/create_proposal.html +++ b/actix_mvc_app/src/views/governance/create_proposal.html @@ -23,21 +23,24 @@ - +
About Creating Proposals
-

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.

+

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.

- +
@@ -47,34 +50,42 @@
New Proposal
-
+
- + +
Please provide a title (5-100 characters).
Make it descriptive and specific
- +
+ minlength="50" maxlength="5000" + placeholder="Provide a detailed description of your proposal..."> +
Please provide a detailed description (at least 50 + characters).
Explain the purpose, benefits, and implementation details
- +
+
Please select a valid start date. +
When should voting begin?
+
End date must be after start date. +
When should voting end?
- +
@@ -83,7 +94,7 @@
- +
Cancel @@ -92,7 +103,7 @@
- +
@@ -122,4 +133,111 @@
+ +{% block scripts %} + {% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/actix_mvc_app/src/views/governance/proposal_detail.html b/actix_mvc_app/src/views/governance/proposal_detail.html index a4fba74..f7c3303 100644 --- a/actix_mvc_app/src/views/governance/proposal_detail.html +++ b/actix_mvc_app/src/views/governance/proposal_detail.html @@ -2,6 +2,37 @@ {% block title %}{{ proposal.title }} - Governance Proposal{% endblock %} +{% block styles %} + +{% endblock %} + {% block content %}
@@ -30,44 +61,62 @@
-
-
-
+
+
+

{{ proposal.title }}

-
-
+
+
+ {{ proposal.status }} - Created by {{ proposal.creator_name }} - + Created by {{ proposal.creator_name + }}
-
Description
-

{{ proposal.description }}

+
+
Description
+
{{ proposal.description }}
+
-
Voting Period
-

- {% if proposal.voting_starts_at and proposal.voting_ends_at %} - Start: {{ proposal.voting_starts_at | date(format="%Y-%m-%d") }}
- End: {{ proposal.voting_ends_at | date(format="%Y-%m-%d") }} - {% else %} - Not set - {% endif %} -

+
+
Voting Period
+
+ {% if proposal.voting_starts_at and proposal.voting_ends_at %} +
+
Start Date
+
{{ proposal.voting_starts_at | date(format="%Y-%m-%d") }}
+
+
+ +
+
+
End Date
+
{{ proposal.voting_ends_at | date(format="%Y-%m-%d") }}
+
+ {% else %} +
Not set
+ {% endif %} +
+
-
-
-
-
Voting Results
+
+
+
+
Voting Dashboard
-
-
+
+ +
+
Results
+ {% set yes_percent = 0 %} {% set no_percent = 0 %} {% set abstain_percent = 0 %} @@ -78,131 +127,269 @@ {% set abstain_percent = (results.abstain_count * 100 / results.total_votes) | int %} {% endif %} -

Yes: {{ results.yes_count }} ({{ yes_percent }}%)

-
-
-
+ +
+ Yes + {{ results.yes_count }} +
+
+
-

No: {{ results.no_count }} ({{ no_percent }}%)

-
-
-
+ +
+ No + {{ results.no_count }} +
+
+
-

Abstain: {{ results.abstain_count }} ({{ abstain_percent }}%)

-
+ +
+ + Abstain + {{ results.abstain_count }} +
+
+ style="width: {{ abstain_percent }}%" aria-valuenow="{{ abstain_percent }}" + aria-valuemin="0" aria-valuemax="100" title="{{ abstain_percent }}% of votes">
-

Total Votes: {{ results.total_votes }}

-
-
- - {% if proposal.status == "Active" and user and user.id %} -
-
-
Cast Your Vote
-
-
- -
- -
- - +
+
+
+

{{ results.total_votes }}

+ Total Votes
-
- - -
-
- - -
-
-
- - -
- - -
-
- {% elif not user or not user.id %} -
-
-

You must be logged in to vote.

- Login to Vote -
-
- {% elif proposal.status != "Active" %} -
-
-
- - Note: Voting is only available for proposals with an Active status. - This proposal's current status is {{ proposal.status }}. -
-
-
- {% endif %} -
-
- -
-
-
-
-
Votes ({{ votes | length }})
-
-
- {% if votes | length > 0 %} -
- - - - - - - - - - - {% for vote in votes %} - - - - - - - {% endfor %} - -
VoterVoteCommentDate
{{ vote.voter_name }} - - {{ vote.vote_type }} - - {% if vote.comment %}{{ vote.comment }}{% else %}No comment{% endif %}{{ vote.created_at | date(format="%Y-%m-%d %H:%M") }}
+ {% if proposal.status == "Active" %} +
+
+ + + + + +
+ {{ yes_percent }}%
+
+ Approval Rate +
+ {% endif %} +
+
+ + + {% if proposal.status == "Active" and user and user.id %} +
+
Cast Your Vote
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+
+ {% elif proposal.status != "Active" %} +
+ +

Voting is {{ proposal.status | lower }} for this proposal

+
+ {% elif not user or not user.id %} +
+ +

You must be logged in to vote

+ Login to Vote
- {% else %} -

No votes have been cast yet.

{% endif %}
+ + +
+
+
+
+
Votes
+
+
+ + + + +
+
+ + + + +
+
+
+
+
+ + + + + + + + + + + {% if votes | length == 0 %} + + + + {% else %} + {% for vote in votes %} + + + + + + + {% endfor %} + {% endif %} + +
VoterVoteCommentDate
+
+ +

No votes have been cast yet

+
+
+
+
+ U +
+ {{ vote.voter_name }} +
+
+ + {% if vote.vote_type == 'Yes' %} + + {% elif vote.vote_type == 'No' %} + + {% else %} + + {% endif %} + {{ vote.vote_type }} + + + {% if vote.comment %} +
{{ vote.comment }}
+ {% else %} + No comment provided + {% endif %} +
+
+ {{ vote.created_at | date(format="%Y-%m-%d") }} + {{ vote.created_at | date(format="%H:%M") + }} +
+
+
+
+
+
+
-
-{% endblock %} \ No newline at end of file + + {% block scripts %} + + {% endblock scripts %} + + {% endblock content %} \ No newline at end of file