Add invitation stats
Show some stats about unused invitations and active inviters
This commit is contained in:
parent
dc7cf107c2
commit
0110f27ada
@ -119,12 +119,7 @@ main {
|
||||
}
|
||||
|
||||
section {
|
||||
padding-bottom: 3rem;
|
||||
margin-bottom: 3rem;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 1px dotted #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
|
@ -1,6 +1,8 @@
|
||||
class Admin::InvitationsController < Admin::BaseController
|
||||
def index
|
||||
@current_section = :invitations
|
||||
@invitations_unused_count = Invitation.unused.count
|
||||
@users_with_referrals_count = Invitation.used.distinct.count(:user_id)
|
||||
@invitations_used = Invitation.used.order('used_at desc')
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,14 @@
|
||||
<section>
|
||||
<h2>Invitations</h2>
|
||||
|
||||
<% if @invitations_used.any? %>
|
||||
<p>
|
||||
There are currently <strong><%= @invitations_unused_count %>
|
||||
unused invitations</strong> available to existing users.
|
||||
<strong><%= @users_with_referrals_count %> users</strong> have successfully
|
||||
invited new users.
|
||||
</p>
|
||||
</section>
|
||||
<% if @invitations_used.any? %>
|
||||
<section>
|
||||
<h3>Accepted (<%= @invitations_used.length %>)</h3>
|
||||
<table>
|
||||
<thead>
|
||||
@ -21,5 +28,5 @@
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</section>
|
||||
</section>
|
||||
<% end %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user