CHANGE: New visualisation of Gallery
This commit is contained in:
BIN
app/assets/images/no_image_128.png
Normal file
BIN
app/assets/images/no_image_128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
app/assets/images/no_image_64.png
Normal file
BIN
app/assets/images/no_image_64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -33,4 +33,16 @@
|
||||
//.fade {
|
||||
// opacity: 0;
|
||||
// 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;
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
#
|
||||
|
||||
class Gallery < ActiveRecord::Base
|
||||
WORD_COUNT = 20
|
||||
attr_accessible :datum, :desc, :name
|
||||
has_many :fotos
|
||||
end
|
||||
|
||||
@@ -1,26 +1,37 @@
|
||||
<h1><%= I18n.t('fotos.galleries')%></h1>
|
||||
<%= %>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<% @galleries.each do |gallery| %>
|
||||
<%= link_to gallery do %>
|
||||
<div class="media">
|
||||
<div class="pull-left" href="#">
|
||||
<%= image_tag gallery.fotos.first.datei.big_thumb.url %>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h1><%= gallery.datum %> - <%= gallery.name %></h1>
|
||||
<p><%= gallery.desc %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% @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"
|
||||
else
|
||||
image_tag gallery.fotos.sample.datei.big_thumb.url
|
||||
end %>
|
||||
</div>
|
||||
</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 %>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<%= link_to I18n.t('fotos.new-gallery'), new_gallery_path %>
|
||||
|
||||
5
config/locales/galleries.de.yml
Normal file
5
config/locales/galleries.de.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
de:
|
||||
fotos:
|
||||
galleries: "Bildergalerien"
|
||||
new-gallery: "neue Galerie"
|
||||
bilder: "Bilder"
|
||||
5
config/locales/galleries.en.yml
Normal file
5
config/locales/galleries.en.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
en:
|
||||
fotos:
|
||||
galleries: "Picture Gallery"
|
||||
new-gallery: "new gallery"
|
||||
bilder: "pictures"
|
||||
Reference in New Issue
Block a user