BathHacked/energy-sparks

View on GitHub
app/views/schools/_school_card.html.erb

Summary

Maintainability
Test Coverage
<div class="card">
  <div class="card-body">
    <h3 class="card-title">
      <%= link_to school_path(school) do %>
        <%= school.name %>
      <% end -%>
    </h3>

    <div class="card-text">
      <% if school.configuration %>
        <% if school.has_electricity? %>
          <%= fa_icon(fuel_type_icon(:electricity)) %>
        <% end %>
        <% if school.has_gas? %>
          <%= fa_icon(fuel_type_icon(:gas)) %>
        <% end %>
        <% if school.has_solar_pv? %>
          <%= fa_icon(:sun) %>
        <% end %>
        <% if school.has_storage_heaters? %>
          <%= fab_icon(:intercom) %>
        <% end %>
      <% end %>
      <%= school.address %> <%= school.postcode %>
    </div>
  </div>
</div>