mysociety/alaveteli

View on GitHub
app/views/alaveteli_pro/info_request_batches/_authority_list.text.erb

Summary

Maintainability
Test Coverage
<%# This template should be identical to _authority_list.html.erb, except
    that the public body names are passed through raw() so that they aren't
    escaped by our translation helpers (because this a text view so they don't
    need to be and we don't want html entities in it). raw() is similar to
    using .html_safe, but it doesn't mind if we pass it nil. %>
<% if public_bodies.size > 0 %>
<% example_body_names = public_bodies.take(2).map(&:name) %>
<%= n_('{{count}} recipient, {{first_public_body}}',
       '{{count}} recipients, including {{first_public_body}} and {{second_public_body}}',
       public_bodies.size,
       count: public_bodies.size,
       first_public_body: raw(example_body_names.first),
       second_public_body: raw(example_body_names.second)) %>
<% else %>
<%= _("No bodies selected") %>
<% end %>