MiraitSystems/enju_trunk

View on GitHub
app/views/baskets/_menu.html.erb

Summary

Maintainability
Test Coverage
<div id="basket_menu">
  <%- if @basket -%>
    <%= link_to t('basket.all_manifestation'), manifestations_path %><br />
    <%= link_to t('page.batch_change'),  '', :id => 'batch_change_opener' %>    
  <%- else -%>
    <%- count = @current_basket.try(:checked_manifestations).try(:size) %>
    <%- is_list = is_list || @is_list -%>
    <%- if count > 0 -%>
      <% if is_list %><li><% end %>
      <%= link_to t('basket.show_basket', :count => count), manifestations_path(:basket_id => @current_basket) %>
      <% if is_list %></li><% else %><br /><% end %>
      <% if is_list %><li><% end %>
      <%= link_to t('basket.clear_basket'), 
        checked_manifestations_clear_all_path(:is_list => is_list), 
        :confirm => t('page.are_you_sure'), 
        :remote => true %>
      <% if is_list %></li><% else %><br /><% end %>
      <% if is_list %><li><% end %>
        <%= link_to t('page.batch_change'),  '', :id => 'batch_change_opener' %>
      <% if is_list %></li><% end %>
    <%- else -%>
      <% if is_list %><li><% end %>
      <%= t('basket.show_basket', :count => count) %>
      <% if is_list %></li><% end %>
    <%- end -%>
  <%- end -%>
  <%= render 'manifestations/index_batch_change_dialog' %>
</div>