From a279ba29f90a63ce81b20d93b6426b94129d31a3 Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Mon, 6 Jul 2009 23:38:20 +0200 Subject: [PATCH] untouched album listing. --- app/controllers/albums_controller.rb | 1 - app/controllers/photos_controller.rb | 4 ++-- app/views/albums/show.html.erb | 3 +++ app/views/albums/untouched.html.erb | 15 +++++++++++---- app/views/photos/show.html.erb | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index cb7381c..1aefd62 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -19,7 +19,6 @@ class AlbumsController < ApplicationController def untouched @albums = Album.untouched() - @albums.ea respond_to do |format| format.html format.json { render :json => @albums } diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 33945e7..20ef4d7 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -38,9 +38,9 @@ class PhotosController < ApplicationController def show @photo = Photo.find( params[:id] ) previous_rs = Photo.previous( @photo.id, @photo.album ) - @previous = previous_rs.first if !previous_rs.empty? + @previous = previous_rs.first unless previous_rs.empty? next_rs = Photo.next( @photo.id, @photo.album ) - @next = next_rs.first if !next_rs.empty? + @next = next_rs.first unless next_rs.empty? respond_to do |format| format.html format.json { render :json => @photo } diff --git a/app/views/albums/show.html.erb b/app/views/albums/show.html.erb index 121f4de..e0734b1 100644 --- a/app/views/albums/show.html.erb +++ b/app/views/albums/show.html.erb @@ -13,11 +13,14 @@

<%= @album.description %>

+ +<% unless @album.photo_tags.empty? %>

Tagged with: <% for tag in @album.photo_tags.map{|tag|tag.title}.sort %> <%= link_to tag, album_tag_photos_path(@album, tag )%> <% end %>

+<% end %> <% if has_role?("admin") %>

<%= @album.address %>

diff --git a/app/views/albums/untouched.html.erb b/app/views/albums/untouched.html.erb index 0784daf..83a99d8 100644 --- a/app/views/albums/untouched.html.erb +++ b/app/views/albums/untouched.html.erb @@ -1,4 +1,11 @@ -

Albums

-<%= render :partial => @albums %> - -
<%= link_to "All albums", albums_path %> \ No newline at end of file +<% for album in @albums %> +
+
+ <%= render :partial => "photos/thumb", :locals => {:photo => album.photos.first } unless album.photos.empty? %> +

<%= link_to album.title, album %>

+
+
+ <%= render :partial => "photos/thumb", :collection => album.photos.find(:all, :limit => 5, :offset => 1), :as => :photo %> +
+
+<% end %> \ No newline at end of file diff --git a/app/views/photos/show.html.erb b/app/views/photos/show.html.erb index 74ce445..c0aa3cb 100644 --- a/app/views/photos/show.html.erb +++ b/app/views/photos/show.html.erb @@ -3,7 +3,7 @@