fotogallery

This commit is contained in:
Andreas Stephanides
2013-08-19 20:49:07 +02:00
parent 7ab34fa845
commit d96a694a73
6 changed files with 45 additions and 26 deletions

View File

@@ -1,25 +1,31 @@
<p id="notice"><%= notice %></p>
<p>
<b>Title:</b>
<%= @foto.title %>
</p>
<div class="container-fluid">
<p>
<b>Desc:</b>
<%= @foto.desc %>
</p>
<div class="row-fluid">
<div class="span12">
<%= link_to image_tag(@foto.datei.resized.url), gallery_foto_path(@foto.gallery, ((@foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil?) ? (@foto.gallery.fotos[0].try(:id).to_i) : @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) ) %>
</div>
</div>
<p>
<b>Gallery:</b>
<%= @foto.gallery_id %>
</p>
<div class="row-fluid">
<div class="span9">
<h2><%= @foto.title %></h2>
<p><%= @foto.desc %></p>
</div>
<div class="span3">
<p>
<%= link_to 'last' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)-1].try(:id).to_i) unless @foto.gallery.fotos.index(@foto)==0 %>
<%= link_to 'next' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) unless @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil? %>
<%= link_to 'Edit', edit_foto_path(@foto) %> |
<%= link_to 'Back', gallery_path(@foto.gallery) %>
</p>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<p id="notice"><%= notice %></p>
</div>
</div>
</div>
<p>
<b>Datei:</b>
<%= @foto.datei %>
</p>
<%= link_to 'Edit', edit_foto_path(@foto) %> |
<%= link_to 'Back', fotos_path %>

View File

@@ -14,7 +14,14 @@
<b>Datum:</b>
<%= @gallery.datum %>
</p>
<% @gallery.fotos.each do |f| %>
<%= link_to image_tag(f.datei.big_thumb.url,{:class=>"img-polaroid"}) , gallery_foto_path(@gallery,f) %>
<% end %>
<%= link_to 'NewFoto' , new_gallery_foto_path(@gallery) %> |
<%= link_to 'Edit', edit_gallery_path(@gallery) %> |
<%= link_to 'Back', galleries_path %>