diff --git a/app/views/albums/show.html.erb b/app/views/albums/show.html.erb index e0734b1..592e165 100644 --- a/app/views/albums/show.html.erb +++ b/app/views/albums/show.html.erb @@ -17,11 +17,20 @@ <% 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 )%> +<%= link_to tag, album_tag_photos_path(@album, tag) %> <% end %>
<% end %> +<% unless @album.collections.empty? %> +Part of: +<% for collection in @album.collections.find(:all, :order => 'title') %> +<%= link_to collection.title, collection_path(collection) %> +<% end %> +
+<% end %> + + <% if has_role?("admin") %><%= @album.address %>
<% end %> @@ -29,6 +38,8 @@<%= @album.note %>
<% end %> + + <% content_for :action_links do %> <% if has_role?("admin") %> <%= link_to "PDF", album_path(@album, :format => 'pdf') %> | diff --git a/lib/scan.rb b/lib/scan.rb index e635912..4604a92 100644 --- a/lib/scan.rb +++ b/lib/scan.rb @@ -22,14 +22,19 @@ module ScanFiles relpathparam += d.parameterize + "/" } relpathparam = relpathparam.slice(0..relpathparam.length-2) + album = Album.find_by_path( relpath ) if relpath != relpathparam puts APP_CONFIG[:photos_path] + relpath + " will now be moved to " + APP_CONFIG[:photos_path] + relpathparam FileUtils.mv APP_CONFIG[:photos_path] + relpath, APP_CONFIG[:photos_path] + relpathparam puts "reload!" + unless album.nil? + album.path = relpathparam + album.save! + end self.FullScan return end - album = Album.find_by_path( relpath ) + if prevalbum != relpath puts relpath prevalbum = relpath @@ -86,19 +91,4 @@ module ScanFiles #image.write(mainsite_file) end - def self.FullScanOld - self.ScanDirectory(APP_CONFIG[:photo_directory]) - end - - def self.ScanDirectory(dir) - puts "now scanning: " + dir - Dir.entries( dir ).select { |f| (f != "." && f != "..") }.each { |f| - if ( File.directory?( dir + f)) - puts "found directory scan more.. " + dir + f + "/" - self.ScanDirectory( dir + f ) - elsif ( supported_files.include?( File.extname(dir + f) ) ) - puts "insert file in database: " + f - end - } - end end \ No newline at end of file