razum2um/lurker

View on GitHub
lib/lurker/templates/layouts/_sidemenu.html.erb

Summary

Maintainability
Test Coverage
<% @service_presenter.endpoints_by_prefix.each do |prefix, endpoints| %>
  <li class="endpoint-group <%= (@endpoint_presenter.nil? && 'opened') || (endpoints.map(&:url).include?(@endpoint_presenter.url) && 'active') %>">
      <a href="#"><%= prefix %></a>
      <ul class="nav">
          <% endpoints.each do |endpoint| %>
            <li class="<%= (@endpoint_presenter.nil? && 'opened') || (endpoint.url == @endpoint_presenter.url && 'active') %>">
                <a href="<%= endpoint.url %>">
                  <span><%= endpoint.title %></span>
                  <br>
                  <span class="btn btn-<%= endpoint.verb_colorname %> btn-xs"><%= endpoint.verb %>&nbsp;<%= endpoint.named_path %></span>
                </a>
            </li>
          <% end %>
      </ul>
  </li>
<% end %>