dont show if no photos
This commit is contained in:
parent
53bcc62a45
commit
c93ac2ad2c
|
@ -38,7 +38,6 @@ class PhotosController < ApplicationController
|
|||
previous_rs = Photo.previous( @photo.id, @photo.album )
|
||||
@previous = previous_rs.first if !previous_rs.empty?
|
||||
next_rs = Photo.next( @photo.id, @photo.album )
|
||||
puts next_rs.inspect
|
||||
@next = next_rs.first if !next_rs.empty?
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
|
@ -77,13 +77,13 @@ class Album < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def create_folders
|
||||
Dir.mkdir( APP_CONFIG[:photos_path] + self.path ) if !Dir.exists?( APP_CONFIG[:photos_path] + self.path )
|
||||
Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path ) if !Dir.exists?( APP_CONFIG[:photos_path] + self.path )
|
||||
Dir.mkdir( APP_CONFIG[:photos_path] + self.path ) if !File.exists?( APP_CONFIG[:photos_path] + self.path )
|
||||
Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path ) if !File.exists?( APP_CONFIG[:photos_path] + self.path )
|
||||
end
|
||||
|
||||
def destroy_folders
|
||||
#puts "DELETE DIRECTORY " + APP_CONFIG[:photos_path] + self.path
|
||||
Dir.delete( APP_CONFIG[:thumbs_path] + self.path ) if Dir.exists?( APP_CONFIG[:thumbs_path] + self.path )
|
||||
Dir.delete( APP_CONFIG[:photos_path] + self.path ) if Dir.exists?( APP_CONFIG[:photos_path] + self.path )
|
||||
Dir.delete( APP_CONFIG[:thumbs_path] + self.path ) if File.exists?( APP_CONFIG[:thumbs_path] + self.path )
|
||||
Dir.delete( APP_CONFIG[:photos_path] + self.path ) if File.exists?( APP_CONFIG[:photos_path] + self.path )
|
||||
end
|
||||
end
|
||||
|
|
|
@ -115,9 +115,6 @@ class Photo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def exif_read
|
||||
puts "exif read"
|
||||
puts self.path
|
||||
puts self.path_original
|
||||
photo = MiniExiftool.new(self.path_original)
|
||||
self.longitude = photo.GPSLongitude if self.longitude.nil?
|
||||
self.latitude = photo.GPSLatitude if self.latitude.nil?
|
||||
|
|
|
@ -1 +1 @@
|
|||
<p><%= render :partial => "photos/thumb", :locals => {:photo => album.photos.find(:first) } %></p>
|
||||
<p><%= render :partial => "photos/thumb", :locals => { :photo => album.photos.find(:first) } unless album.photos.empty? %></p>
|
Loading…
Reference in a new issue