diff --git a/README b/README index a3afc17..8af046b 100644 --- a/README +++ b/README @@ -43,23 +43,17 @@ Ruby Gems == Installation -1. git clone git://gitorious.org/gallery-without-a-name/gallery-without-a-name.git +1. Clone the project from GitHub or Gitorious: + GitHub: git clone git://github.com/espen/balder.git + Gitorious: git clone git://gitorious.org/gallery-without-a-name/gallery-without-a-name.git 2. install required software listed above -3. create folders for photos outside rails project: - photos/originals - photos/thumbs -4. Web-server must have write access to the photos folders -5. Link up the photo folders - in the public folder: - ln -s /path/to/photos/originals files - ln -s /path/to/photos/thumbs thumbs -6. Copy settings file: +3. Copy settings file: cp gallery/config/database.example.yml gallery/config/database.yml cp gallery/config/settings.example.yml gallery/config/settings.yml -7. Create databsae user and edit settings files. -8. rake db:create -9. rake db:migrate -10. Start up the project with your preferred web-server +4. Create databsae user and edit settings files. +5. rake db:create +6. rake db:migrate +7. Start up the project with your preferred web-server === Optional: add photos directly to disk @@ -73,9 +67,6 @@ Put photos in containing folders(albums) in the specified gallery folder. This f ./trip to iran/mosque in yazd.jpg ./trip to iran/powder snow in dizin.jpg -Every time you manually add photos to disk you must run the following in script/console: - - require "scan" - ScanFiles.FullScan +Every time you manually add photos to disk you must scan by visiting /photos/scan In future releases the scan will be automated. \ No newline at end of file diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index fce4674..4cfc78d 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -50,6 +50,12 @@ class PhotosController < ApplicationController format.xml { render :xml => @photo } end end + + def scan + require "scan" + ScanFiles.FullScan + redirect_to(root_path) + end def new @photo = Photo.new diff --git a/config/routes.rb b/config/routes.rb index a3f4d06..ee68f98 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ ActionController::Routing::Routes.draw do |map| map.authenticate "authenticate", :controller => "user_sessions", :action => "create" map.logout "logout", :controller => "user_sessions", :action => "destroy" - map.resources :photos, :collection => { :untouched => :get, :edit_multiple => :post, :update_multiple => :put, :upload => :get } + map.resources :photos, :collection => { :untouched => :get, :edit_multiple => :post, :update_multiple => :put, :upload => :get, :scan => :get } map.resources :albums, :collection => { :untouched => :get, } do |album| album.resources :tags do |tag| tag.resources :photos, :collection => { :untouched => :get, :upload => :get, :edit_multiple => :get } diff --git a/config/settings.example.yml b/config/settings.example.yml index e87127c..3e5ca4c 100644 --- a/config/settings.example.yml +++ b/config/settings.example.yml @@ -1,18 +1,18 @@ development: site_name: Photos - photos_path: '/photos/originals/' - thumbs_path: '/photos/thumbs/' + photos_path: 'photos' + thumbs_path: 'public/thumbs/' photos_path_public: '/files/' thumbs_path_public: '/thumbs/' production: site_name: Photos - photos_path: '/photos/originals/' - thumbs_path: '/photos/thumbs/' + photos_path: 'photos' + thumbs_path: 'public/thumbs/' photos_path_public: '/files/' thumbs_path_public: '/thumbs/' test: site_name: Photos - photos_path: '/photos/originals/' - thumbs_path: '/photos/thumbs/' + photos_path: 'photos' + thumbs_path: 'public/thumbs/' photos_path_public: '/files/' thumbs_path_public: '/thumbs/' \ No newline at end of file