diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb index abfecdd7f..8cc5d712c 100644 --- a/app/controllers/admin/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -21,6 +21,15 @@ class Admin::StatsController < Admin::BaseController @user_ids_who_voted_proposals = ActsAsVotable::Vote.where(votable_type: 'Proposal').distinct.count(:voter_id) @user_ids_who_didnt_vote_proposals = @verified_users - @user_ids_who_voted_proposals @spending_proposals = SpendingProposal.count + end + def proposal_notifications + @proposal_notifications = ProposalNotification.all + @proposals_with_notifications = @proposal_notifications.pluck(:proposal_id).uniq + end + + def direct_messages + @direct_messages = DirectMessage.all + @users_who_have_sent_message = DirectMessage.pluck(:sender_id).uniq end end diff --git a/app/views/admin/stats/direct_messages.html.erb b/app/views/admin/stats/direct_messages.html.erb new file mode 100644 index 000000000..33c6ff517 --- /dev/null +++ b/app/views/admin/stats/direct_messages.html.erb @@ -0,0 +1,27 @@ +<%= render 'shared/back_link' %> + +

<%= t("admin.stats.direct_messages.title")%>

+ +
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+
\ No newline at end of file diff --git a/app/views/admin/stats/proposal_notifications.html.erb b/app/views/admin/stats/proposal_notifications.html.erb new file mode 100644 index 000000000..106be14cf --- /dev/null +++ b/app/views/admin/stats/proposal_notifications.html.erb @@ -0,0 +1,35 @@ +<%= render 'shared/back_link' %> + +

<%= t("admin.stats.proposal_notifications.title")%>

+ +
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+ <% @proposal_notifications.each do |notification| %> +

<%= link_to notification.proposal.title, proposal_path(notification.proposal) %>

+

<%= notification.title %>

+

<%= notification.body %>

+ <% end %> +
diff --git a/app/views/admin/stats/show.html.erb b/app/views/admin/stats/show.html.erb index 9a9ecbfa8..66d4cbf6c 100644 --- a/app/views/admin/stats/show.html.erb +++ b/app/views/admin/stats/show.html.erb @@ -6,6 +6,17 @@

<%= t "admin.stats.show.stats_title" %>

+
+
+ <%= link_to t("admin.stats.show.direct_messages"), + direct_messages_admin_stats_path %> +
+
+ <%= link_to t("admin.stats.show.proposal_notifications"), + proposal_notifications_admin_stats_path %> +
+
+