rx/presenters

View on GitHub
views/mdc/body/drawers/menu.erb

Summary

Maintainability
Test Coverage
<div style="<%= "color: #{comp.color};" if comp.color%> ">
  <%= erb :"components/button", :locals => {:comp => comp.button} %>
  <ul class="mdl-menu mdl-menu--bottom-<%= comp.side %> mdl-js-menu mdl-js-ripple-effect"
      for="<%= comp.button.id %>">
    <% items = comp.items
       items.each_with_index do |item, index|
         next if eq(item.type,:divider)
         divider = (index < items.size-1) ? eq(items[index+1].type, :divider) : false
    %>
      <li class="mdl-menu__item<%= ' mdl-menu__item--full-bleed-divider' if divider %>"
          <%= 'disabled' if item.disabled %>>
        <% unless item.disabled %>
          <a class="mdl-navigation__link"
             id="<%=item.id%>"
             href="javascript:void(0)"
             <%=  erb :"components/event", :locals => {comp: item, events: item.events, parent_id: item.event_parent_id}%>>
        <% end %>
        <%= item.text %>
        <% unless item.disabled %>
          </a>
        <% end %>
      </li>
    <% end %>
  </ul>
</div>