1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00
danbarberphoto/app/views/photos/index.html.erb
Dan Barber e2c4ebf0e9 Use Kaminari instead of WillPaginate
This is to avoid any conflict with Kaminari in Administrate. We also add
some specs for pagination in the front end.
2015-10-26 14:26:32 +00:00

38 lines
1.0 KiB
Plaintext

<%= render 'shared/photo_styles', photos: @photos, size: 5 %>
<% content_for :navigation do %>
<div class="sg-5 page-links">
<% if !@photos.first_page? -%>
<%= link_to content_tag(:div, e(:larr)), { page: @photos.prev_page }, class: 'prev-link' %>
<% end %>
</div>
<div class="sg-5 page-links">
<% if !@photos.last_page? -%>
<%= link_to content_tag(:div, e(:rarr)), { page: @photos.next_page }, class: 'next-link' %>
<% end %>
</div>
<% end %>
<% if @category %>
<div class="sg-5 category" style="background: <%= @category.base_colour %>">
<%= link_to categories_path do %>
<h3><%= h(@category.name.downcase) %></h3><div class="arrow">&uarr;</div>
<% end %>
</div>
<% else %>
<div class="sg-5 category" style="background: #333;">
<h3>all photos</h3>
</div>
<% end %>
<% @photos.each do |photo| %>
<div class="sg-5 photo" id="<%= photo.name.parameterize %>">
<%= link_to_photo photo %>
</div>
<% end %>
<% @num_blank.times do %>
<div class="sg-5 photo blank-photo">
</div>
<% end %>