diff --git a/app/assets/images/no_image_128.png b/app/assets/images/no_image_128.png new file mode 100644 index 0000000..80446e2 Binary files /dev/null and b/app/assets/images/no_image_128.png differ diff --git a/app/assets/images/no_image_64.png b/app/assets/images/no_image_64.png new file mode 100644 index 0000000..d952dae Binary files /dev/null and b/app/assets/images/no_image_64.png differ diff --git a/app/assets/stylesheets/galleries.css.scss b/app/assets/stylesheets/galleries.css.scss index 5c8f202..27e63bf 100644 --- a/app/assets/stylesheets/galleries.css.scss +++ b/app/assets/stylesheets/galleries.css.scss @@ -33,4 +33,16 @@ //.fade { // opacity: 0; // transition: opacity 0.15s linear 0s; -//} \ No newline at end of file +//} + +div.gallery-block +{ + padding: 10px; + margin-bottom: 10px; +} + +a.gallery-block:hover +{ + display: block; + box-shadow: 1px 1px 2px 2px lightgray; +} \ No newline at end of file diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 6a81078..376e3f9 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -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 diff --git a/app/models/gallery.rb b/app/models/gallery.rb index ac5e8c9..ae4afde 100644 --- a/app/models/gallery.rb +++ b/app/models/gallery.rb @@ -11,6 +11,7 @@ # class Gallery < ActiveRecord::Base + WORD_COUNT = 20 attr_accessible :datum, :desc, :name has_many :fotos end diff --git a/app/views/galleries/edit.html.erb b/app/views/galleries/edit.html.erb index 8c9cef9..fefac32 100644 --- a/app/views/galleries/edit.html.erb +++ b/app/views/galleries/edit.html.erb @@ -2,5 +2,7 @@ <%= render 'form' %> + diff --git a/app/views/galleries/index.html.erb b/app/views/galleries/index.html.erb index 657280f..68a8a8f 100644 --- a/app/views/galleries/index.html.erb +++ b/app/views/galleries/index.html.erb @@ -1,26 +1,35 @@

<%= I18n.t('fotos.galleries')%>

- <%= %> -
-
-
- <% @galleries.each do |gallery| %> - <%= link_to gallery do %> -
-
- <%= image_tag gallery.fotos.first.datei.big_thumb.url %> -
-
-

<%= gallery.datum %> - <%= gallery.name %>

-

<%= gallery.desc %> -

-
-
- <% end %> - - <% end %> -
-
-
+
+ <% row.each do |gallery| %> +
+ <%= link_to gallery, :class => 'gallery-block' do %> + + <% end %> +
+ <% end %> +
+<% end %>
-<%= link_to I18n.t('fotos.new-gallery'), new_gallery_path %> +<%= render :partial => 'layouts/pretty_toolbar' %> diff --git a/app/views/galleries/show.html.erb b/app/views/galleries/show.html.erb index f1d45b9..400798a 100644 --- a/app/views/galleries/show.html.erb +++ b/app/views/galleries/show.html.erb @@ -1,18 +1,17 @@

<%= notice %>

- <%= @gallery.datum %> + <%= @gallery.fotos.size.to_s + " " + I18n.t('fotos.bilder')%> + <%=I18n.l(@gallery.try(:datum).try(:to_date)) unless @gallery.try(:datum).try(:to_date).nil? %>

<%= @gallery.name %>

-
+

<%= @gallery.desc %>

- - - +