This commit is contained in:
Andreas Stephanides
2013-09-10 11:27:30 +02:00
11 changed files with 70 additions and 37 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;
// 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

@@ -6,6 +6,7 @@ class GalleriesController < ApplicationController
# GET /galleries.json
def index
@galleries = Gallery.all
@toolbar_elements << {:hicon => 'icon-plus', :text => I18n.t('fotos.new-gallery'), :path => new_gallery_path }
respond_to do |format|
format.html # index.html.erb

View File

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

View File

@@ -2,5 +2,7 @@
<%= render 'form' %>
<!--
<%= link_to 'Show', @gallery %> |
<%= link_to 'Back', galleries_path %>
-->

View File

@@ -1,26 +1,35 @@
<h1><%= I18n.t('fotos.galleries')%></h1>
<%= %>
<div class="container-fluid">
<% @galleries.each_slice(2) do |row| %>
<div class="row-fluid">
<div class="span12">
<% @galleries.each do |gallery| %>
<%= link_to gallery do %>
<div class="media">
<% row.each do |gallery| %>
<div class="span6">
<%= link_to gallery, :class => 'gallery-block' do %>
<div class="media gallery-block">
<div class="pull-left" href="#">
<%= image_tag gallery.fotos.first.datei.big_thumb.url %>
<%= 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">
<h1><%= gallery.datum %> - <%= gallery.name %></h1>
<p><%= gallery.desc %>
<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 %>
<% end %> <!-- end link -->
</div> <!-- close span6 -->
<% end %> <!-- end row -->
</div>
</div>
</div
<% end %>
<br />
<%= link_to I18n.t('fotos.new-gallery'), new_gallery_path %>
<%= render :partial => 'layouts/pretty_toolbar' %>

View File

@@ -1,18 +1,17 @@
<p id="notice"><%= notice %></p>
<div>
<small> <%= @gallery.datum %> </small>
<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>
</div>
<p>
<%= @gallery.desc %>
</p>
</br>
<!-- modal-gallery is the modal dialog used for the image gallery -->
<div id="modal-gallery" class="modal hide fade modal-gallery modal-fullscreen modal-loading" tabindex="-1">
@@ -38,7 +37,7 @@
<% end %>
</div>
</br>
<%= render 'layouts/pretty_toolbar' %>
@@ -48,6 +47,5 @@
<script src="js/load-image.js"></script>
<script src="js/bootstrap-image-gallery.js"></script>
<script type="text/javascript">
//$('#modal-gallery.fade').css('top', '50%');
</script>

View File

@@ -1,7 +1,7 @@
<%= link_to themengruppe,{:class=>'themengruppe'} do %>
<div class="row-fluid">
<div class="span2">
<%= image_tag themengruppe.picture.thumb.url,{:class=>"img-circle"} %>
<%= image_tag themengruppe.picture.thumb.url,{:class=>"img-rounded"} %>
</div>
<div class="span10">
<h3><%=themengruppe.title%> </h3>

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"