mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
28 lines
880 B
Plaintext
28 lines
880 B
Plaintext
<h1>
|
|
Notification open rates
|
|
</h1>
|
|
|
|
<div>
|
|
<%= number_with_delimiter @clicked_notifications.count %> clicked
|
|
/
|
|
<%= number_with_delimiter @notifications.count %> total
|
|
(<%= @clicked_notifications.count / @notifications.count.to_f * 100 %>%)
|
|
</div>
|
|
|
|
<% @codes.each do |code| %>
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">Reference code: <%= code.inspect %></div>
|
|
<%
|
|
clicked_notifs = Notification.where(reference_code: code).where.not(viewed_at: nil).count
|
|
total_notifs = Notification.where(reference_code: code).count
|
|
%>
|
|
|
|
<ul class="browser-default">
|
|
<li><%= number_with_delimiter clicked_notifs %> clicked</li>
|
|
<li><%= number_with_delimiter total_notifs %> total</li>
|
|
<li><%= clicked_notifs / total_notifs.to_f * 100 %>% clicked</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<% end %> |