JordanHatch/maslow-redux

View on GitHub
app/views/needs/_navigation.html.erb

Summary

Maintainability
Test Coverage
<% content_for(:header) do %>
  <header>
    <p class="back-link">
      <%= link_to needs_path do %>
      <span class="icon" aria-hidden="true"></span> All needs
      <% end %>
    </p>

    <h1>
      <span class="subtitle">#<%= need.need_id %></span>
      <%= format_need_goal(need.goal) %>

      <% if need.closed? %>
        <span class="need-closed-label">Closed</span>
      <% end %>
    </h1>
  </header>
<% end %>

<ul class="navigation-list">
  <%= nav_link_to 'Overview', need_path(need), icon: 'tent' %>
  <%= nav_link_to 'Activity', activity_need_path(need), icon: 'inbox' %>
  <%= nav_link_to 'Justification and evidence', need_evidence_path(need), icon: 'th-list', match_prefix: true %>
  <%= nav_link_to 'Meeting the need', need_responses_path(need), icon: 'globe', match_prefix: true %>

  <% if NeedPerformancePoint.any? %>
    <%= nav_link_to 'Performance', need_performance_path(need), icon: 'stats' %>
  <% end %>
</ul>