BathHacked/energy-sparks

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

Summary

Maintainability
Test Coverage
<% if show_data_enabled_features %>
  <% if school.school_group && can?(:compare, school.school_group) %>
    <%= link_to t('schools.schools.compare_schools'),
                "#{compare_index_path(school_group_ids: [school.school_group.id])}#groups", class: 'btn btn-outline-dark rounded-pill' %>
  <% end %>
  <% if school.configuration %>
    <%= link_to public ? t('pupils.analysis.review_energy_analysis') : t('schools.schools.review_energy_analysis'),
                school_advice_path(school), class: 'btn btn-outline-dark rounded-pill' %>
  <% end %>
<% end %>
<% if show_admin_page_switch?(school) %>
  <% if params[:no_data] %>
    <%= link_to 'Admin view', school_path(school), class: 'btn btn-outline-dark bg-warning rounded-pill' %>
  <% else %>
    <%= link_to 'User view', school_path(school, no_data: true), class: 'btn btn-outline-dark bg-warning rounded-pill' %>
  <% end %>
<% end %>