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