<h1><%= I18n.t('fotos.galleries')%></h1>
<%= render :partial => 'layouts/pretty_toolbar' %>
<% @galleries.each_slice(2) do |row| %>
<div class="row-fluid">
  <% row.each do |gallery| %>
  <div class="span6"> 
    <%= link_to gallery, :class => 'gallery-block' do %>
    <div class="media gallery-block">
      <div class="pull-left" href="#">
	<%= if(gallery.fotos.empty?)
	    image_tag "no_image_128.png", {:class => "img-rounded"}
	    else
	    image_tag gallery.fotos.sample.datei.big_thumb.url, {:class => "img-rounded"}
	    end %>
      </div>
      <div class="media-body">
	<small class="pull-left">
	  <%= gallery.fotos.size.to_s + " " + I18n.t('fotos.bilder')%> 
	</small>
	<small class="pull-right">
	  <%=I18n.l(gallery.try(:datum).try(:to_date)) unless gallery.try(:datum).try(:to_date).nil? %>
	</small>
        </br>
	<h1><%= gallery.name %></h1>
	<p>
	  <%= if gallery.desc.split.size > Gallery::WORD_COUNT
	  gallery.desc.split[0..Gallery::WORD_COUNT].join(" ") + " ..."
	  else
	  gallery.desc
	  end%>
	</p>
      </div>
    </div>
    <% end %> <!-- end link -->
  </div> <!-- close span6 -->
  <% end %> <!-- end row -->
</div>
<% end %>

<br />
