photomix/app/views/photos/show.html.erb
2011-04-25 13:50:07 +08:00

34 lines
1,001 B
Plaintext

<h2><%= @photo.title%></h2>
<div id="fullimage">
<div id="navigation">
<p class="links">
<% unless @previous.nil? %>
<%= link_to "Previous", [ @photo.album.collections.first, @photo.album, @previous] %>
<% unless @next.nil? %>
|
<% end %>
<% end %>
<% unless @next.nil? %>
<%= link_to "Next", [ @photo.album.collections.first, @photo.album, @next] %>
<% end %>
</p>
</div>
<p><%= link_to_if @next, image_tag(@photo.file.single.url ), [ @photo.album.collections.first, @photo.album, @next] %></p>
</div>
<p><%= @photo.description %></p>
<p>Tagged with:
<% for tag in @photo.tags.map{|tag|tag.title}.sort %>
<%= link_to tag, tag_photos_path(tag) %>
<% end %>
<%= content_for :action_links do %>
<% if has_role?("admin") %>
<% if params[:collection_id] %>
<%= link_to "Edit photo", edit_collection_album_photo_path(params[:collection_id], params[:album_id], @photo) %>
<% else %>
<%= link_to "Edit photo", edit_photo_path(@photo) %>
<% end %>
<% end %>
<% end %>