Sha256: eb6a1032038b315b9832ae5e3762e42833ae4d2a90edd57d27434cc89931a51b

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

<%# выдать текстовый список предложений, сгруппированный по категориям %>
<div class="offer_list_grouped">

  <ul>
    <% list.each do |obj| %> <%# obj: {cat,offers} %>

        <% if obj[:cat_title].present? %>
            <li>
                <h5><%= obj[:cat_title] %></h5>
                <ul>
                  <% obj[:offers].each do |offer| %>
                      <li>
                        <%= link_to offer.title, my_url_for_offer(offer), title: offer.title %>
                        <div class="offer_price"><%= offer.price %></div>
                      </li>
                  <% end %>
                </ul>
            </li>
        <% else %>
          <% obj[:offers].each_with_index do |offer, index| %>
              <% k = index % 2 == 0 ? 'odd':'even' %>
              <li class="<%=k%>">
                <%= link_to offer.title, my_url_for_offer(offer), title: offer.title %>
                <div class="offer_price"><%= offer.price %></div>
              </li>
          <% end %>
        <% end %>
    <% end %>
  </ul>

</div>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
c80_catoffers-0.1.0.8 app/views/c80_catoffers/_offers_list_grouped.html.erb
c80_catoffers-0.1.0.7 app/views/c80_catoffers/_offers_list_grouped.html.erb
c80_catoffers-0.1.0.6 app/views/c80_catoffers/_offers_list_grouped.html.erb
c80_catoffers-0.1.0.5 app/views/c80_catoffers/_offers_list_grouped.html.erb
c80_catoffers-0.1.0.4 app/views/c80_catoffers/_offers_list_grouped.html.erb