CHANGE: New visualisation of Gallery

This commit is contained in:
HausdorffHimself
2013-09-10 01:55:47 +02:00
parent ba6d83937f
commit 0e12cec427
7 changed files with 55 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -34,3 +34,15 @@
// opacity: 0; // opacity: 0;
// transition: opacity 0.15s linear 0s; // transition: opacity 0.15s linear 0s;
//} //}
div.gallery-block
{
padding: 10px;
margin-bottom: 10px;
}
a.gallery-block:hover
{
display: block;
box-shadow: 1px 1px 2px 2px lightgray;
}

View File

@@ -11,6 +11,7 @@
# #
class Gallery < ActiveRecord::Base class Gallery < ActiveRecord::Base
WORD_COUNT = 20
attr_accessible :datum, :desc, :name attr_accessible :datum, :desc, :name
has_many :fotos has_many :fotos
end end

View File

@@ -1,26 +1,37 @@
<h1><%= I18n.t('fotos.galleries')%></h1> <h1><%= I18n.t('fotos.galleries')%></h1>
<%= %>
<div class="container-fluid"> <div class="container-fluid">
<% @galleries.each_slice(2) do |row| %>
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <% row.each do |gallery| %>
<% @galleries.each do |gallery| %> <div class="span6">
<%= link_to gallery do %> <%= link_to gallery, :class => 'gallery-block' do %>
<div class="media"> <div class="media gallery-block">
<div class="pull-left" href="#"> <div class="pull-left" href="#">
<%= image_tag gallery.fotos.first.datei.big_thumb.url %> <%= if(gallery.fotos.empty?)
image_tag "no_image_128.png"
else
image_tag gallery.fotos.sample.datei.big_thumb.url
end %>
</div> </div>
<div class="media-body"> <div class="media-body">
<h1><%= gallery.datum %> - <%= gallery.name %></h1> <small class="pull-left"><%= gallery.fotos.size.to_s + " " + I18n.t('fotos.bilder')%> </small>
<p><%= gallery.desc %> <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> </p>
</div> </div>
</div> </div>
<% end %> <% end %> <!-- end link -->
</div> <!-- close span6 -->
<% end %> <% end %> <!-- end row -->
</div> </div>
</div> <% end %>
</div </div>
<br /> <br />
<%= link_to I18n.t('fotos.new-gallery'), new_gallery_path %> <%= link_to I18n.t('fotos.new-gallery'), new_gallery_path %>

View File

@@ -0,0 +1,5 @@
de:
fotos:
galleries: "Bildergalerien"
new-gallery: "neue Galerie"
bilder: "Bilder"

View File

@@ -0,0 +1,5 @@
en:
fotos:
galleries: "Picture Gallery"
new-gallery: "new gallery"
bilder: "pictures"