gitcoinco/code_fund_ads

View on GitHub
app/views/async_property_card_footers/show.html.erb

Summary

Maintainability
Test Coverage
<%= render Card::FooterItemComponent.new(bordered: true) do %>
  <p class="mb-0">Total</p>
  <p class="mb-2 text-wrap">Impressions</p>
  <h6 class="text-body"><%= number_with_delimiter @property.impressions_count(@start_date, @end_date) %></h6>
<% end %>

<%= render Card::FooterItemComponent.new(bordered: true) do %>
  <p class="mb-0">Avg.</p>
  <p class="mb-2 text-wrap">Click Rate</p>
  <h6 class="text-body"><%= number_to_percentage @property.click_rate(@start_date, @end_date), precision: 2 %></h6>
<% end %>

<%= render Card::FooterItemComponent.new(bordered: true) do %>
  <p class="mb-0">Est.</p>
  <p class="mb-2 text-wrap">Earnings</p>
  <h6 class="text-body"><%= @property.property_revenue(@start_date, @end_date).format %></h6>
<% end %>