-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3499 from consul/backport-admin_stats
Add admin budget stats
- Loading branch information
Showing
20 changed files
with
450 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<%= back_link_to %> | ||
|
||
<div id="graph" class="small-12 column"> | ||
<h2><%= t "admin.stats.graph.#{name || event}" %> (<%= count %>)</h2> | ||
<%= chart_tag id: name, event: event %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<%= back_link_to budgets_admin_stats_path %> | ||
|
||
<h2><%= @budget.name %> - <%= t("admin.stats.budget_balloting.title") %></h2> | ||
|
||
<div class="stats"> | ||
<div class="row stats-numbers"> | ||
<div class="small-12 medium-3 column"> | ||
<p class="featured"> | ||
<%= t("admin.stats.budget_balloting.vote_count") %> | ||
<br> | ||
<span id="total_votes_count" class="number"> | ||
<%= @vote_count %> | ||
</span> | ||
</p> | ||
</div> | ||
|
||
<div class="small-12 medium-6 column end"> | ||
<p> | ||
<%= t("admin.stats.budget_balloting.participant_count") %> | ||
<br> | ||
<span id="total_participants_count" class="number"> | ||
<%= @user_count %> | ||
</span> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<table class="investment-projects-summary"> | ||
<th colspan="2"><%= t("admin.stats.budget_balloting.votes_per_heading") %></th> | ||
|
||
<% @vote_count_by_heading.each do |heading_name, count| %> | ||
<tr id="vote_count_<%= heading_name.parameterize %>"> | ||
<td class="name"> | ||
<%= heading_name %> | ||
</td> | ||
<td class="name"> | ||
<%= number_with_delimiter count %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
|
||
<table class="investment-projects-summary"> | ||
<th colspan="2"><%= t("admin.stats.budget_balloting.participants_per_district") %></th> | ||
|
||
<% @user_count_by_district.each do |heading_name, count| %> | ||
<tr id="user_count_<%= heading_name.parameterize %>"> | ||
<td class="name"> | ||
<%= heading_name %> | ||
</td> | ||
<td class="name"> | ||
<%= number_with_delimiter count %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<% content_for :head do %> | ||
<%= javascript_include_tag "stat_graphs", "data-turbolinks-track" => true %> | ||
<% end %> | ||
<%= back_link_to budgets_admin_stats_path %> | ||
|
||
<h2><%= @budget.name %> - <%= t("admin.stats.budget_supporting.title") %></h2> | ||
|
||
<div class="stats"> | ||
<div class="row stats-numbers"> | ||
<div class="small-12 medium-3 column"> | ||
<p class="featured"> | ||
<%= t("admin.stats.budget_supporting.vote_count") %> | ||
<br> | ||
<span id="total_votes_count" class="number"> | ||
<%= @vote_count %> | ||
</span> | ||
</p> | ||
</div> | ||
|
||
<div class="small-12 medium-6 column end"> | ||
<p> | ||
<%= t("admin.stats.budget_supporting.participant_count") %> | ||
<br> | ||
<span id="total_participants_count" class="number"> | ||
<%= @user_count %> | ||
</span> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= render "graph", name: "user_supported_budgets", event: "", count: @user_count %> | ||
|
||
<table class="investment-projects-summary"> | ||
<th><%= t("admin.stats.budget_supporting.headings") %></th> | ||
<th><%= t("admin.stats.budget_supporting.users") %></th> | ||
|
||
<% @voters_in_heading.each do |heading, count| %> | ||
<tr id="<%= dom_id(heading) %>"> | ||
<td class="name"> | ||
<%= heading.name %> | ||
</td> | ||
<td class="name"> | ||
<%= number_with_delimiter count %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<%= back_link_to admin_stats_path %> | ||
|
||
<h2><%= t("admin.stats.budgets.title") %></h2> | ||
|
||
<% @budgets.each do |budget| %> | ||
<table> | ||
<tr id="<%= dom_id(budget) %>"> | ||
<td> | ||
<strong><%= budget.name %></strong> | ||
</td> | ||
<td> | ||
<%= link_to t("admin.stats.budgets.supporting_phase"), budget_supporting_admin_stats_path(budget_id: budget.id), class: "button hollow" %> | ||
<%= link_to t("admin.stats.budgets.balloting_phase"), budget_balloting_admin_stats_path(budget_id: budget.id), class: "button hollow" %> | ||
</td> | ||
</tr> | ||
</table> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% content_for :head do %> | ||
<%= javascript_include_tag "stat_graphs", 'data-turbolinks-track' => true %> | ||
<% end %> | ||
<%= render 'graph', name: @name, event: @event, count: @count %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,8 @@ def track_event(name, properties, options) | |
event.ip = request.ip | ||
end | ||
end | ||
|
||
def exclude? | ||
false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.