houdini/app/views/campaigns/_campaigns_table.html.erb

37 lines
1.6 KiB
Text
Raw Normal View History

2020-06-12 20:03:43 +00:00
<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE -%>
<table class='table--striped u-marginBottom--0'>
<% campaigns.each do |campaign|%>
<% metric = QueryCampaignMetrics.on_donations(campaign.id) %>
<tr>
<td class='u-padding--0 u-width--200 u-hideIf--400'>
<% if campaign.main_image.attached?%>
<%= image_tag campaign.main_image_by_size(:normal) %>
<% end %>
</td>
<td class='u-padding--10'>
<% if campaign.end_datetime %>
<p class='u-marginBottom--0'>
<small><strong><%= t('campaigns.until_end_datetime', end_datetime: Format::Date.full(campaign.end_datetime, campaign.nonprofit.timezone)) %></strong></small>
</p>
<% end %>
<h6 class='u-marginTop--0 u-marginBottom--5'>
<a if-branded='color, darker' href='<%= campaign.url %>'><%= campaign.name %></a>
</h6>
<p class='u-marginBottom--15'>
<small><%= campaign.summary ? strip_tags(campaign.summary) : strip_tags(campaign.tagline) %></small>
</p>
<% if campaign.show_total_count %>
<span class='pastelBox--white u-padding--3'><%= t('campaigns.total_count_of_supporters', supporters_count: metric['supporters_count'] ) %></span>
<% end %>
<% if campaign.show_total_raised %>
<span class='pastelBox--white u-padding--3'>
<%= t('campaigns.total_amount_raised_html', total_raised: print_currency(metric['total_raised'], campaign.nonprofit.currency_symbol))%>
</span>
<% end %>
</td>
</tr>
<% end %>
</table>