Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put the thumbnails view logic into a partial.
- Loading branch information
1 parent
c2d5a8d
commit b2b9472
Showing
2 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<label><em>(click image to view original size)</em></label> | ||
|
||
<div class="row"> | ||
<% album_pictures.order('date_taken').each do |picture| %> | ||
<div class="col-xs-6 col-md-4"> | ||
<div class="thumbnail"> | ||
<% if ((can? :edit, picture) && (picture.user_id == current_user.id || current_user.role?(:admin) )) %> | ||
<%= link_to(edit_picture_path(picture, :album_id => album.id, :imageable_id => album.id, :imageable_type => 'Album'), | ||
class: "button-sm") do %> | ||
<i class="icon-edit"></i> | ||
<% end %> | ||
<% end %> | ||
<% if ((can? :destroy, picture) && (album.user_id == current_user.id || current_user.role?(:admin) )) %> | ||
<%= link_to(picture, class: "button-sm-danger", | ||
:data => { :confirm => "Are you sure you want to delete #{picture.name}?" }, :method => :delete) do %> | ||
<i class="icon-delete"></i> | ||
<% end %> | ||
<% end %> | ||
<%= link_to(picture_path(picture)) do %> | ||
<img | ||
src="<%= url_for(:action => 'thumbnail', :id => picture.id, :controller => 'pictures', :height => 200, :width => 300) %>" | ||
alt="<%= picture.name %>" | ||
title="<%= picture.name %>" | ||
/> | ||
<% end %> | ||
<div class="caption"> | ||
<h4><%= picture.description %></h4> | ||
<h5><%= picture.date_taken %></h5> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters