scan
This commit is contained in:
parent
3511cc0fa1
commit
eb641647b9
27
README
27
README
|
@ -43,23 +43,17 @@ Ruby Gems
|
||||||
|
|
||||||
== Installation
|
== 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
|
2. install required software listed above
|
||||||
3. create folders for photos outside rails project:
|
3. Copy settings file:
|
||||||
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:
|
|
||||||
cp gallery/config/database.example.yml gallery/config/database.yml
|
cp gallery/config/database.example.yml gallery/config/database.yml
|
||||||
cp gallery/config/settings.example.yml gallery/config/settings.yml
|
cp gallery/config/settings.example.yml gallery/config/settings.yml
|
||||||
7. Create databsae user and edit settings files.
|
4. Create databsae user and edit settings files.
|
||||||
8. rake db:create
|
5. rake db:create
|
||||||
9. rake db:migrate
|
6. rake db:migrate
|
||||||
10. Start up the project with your preferred web-server
|
7. Start up the project with your preferred web-server
|
||||||
|
|
||||||
=== Optional: add photos directly to disk
|
=== 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/mosque in yazd.jpg
|
||||||
./trip to iran/powder snow in dizin.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:
|
Every time you manually add photos to disk you must scan by visiting /photos/scan
|
||||||
|
|
||||||
require "scan"
|
|
||||||
ScanFiles.FullScan
|
|
||||||
|
|
||||||
In future releases the scan will be automated.
|
In future releases the scan will be automated.
|
|
@ -51,6 +51,12 @@ class PhotosController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def scan
|
||||||
|
require "scan"
|
||||||
|
ScanFiles.FullScan
|
||||||
|
redirect_to(root_path)
|
||||||
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@photo = Photo.new
|
@photo = Photo.new
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ ActionController::Routing::Routes.draw do |map|
|
||||||
map.authenticate "authenticate", :controller => "user_sessions", :action => "create"
|
map.authenticate "authenticate", :controller => "user_sessions", :action => "create"
|
||||||
map.logout "logout", :controller => "user_sessions", :action => "destroy"
|
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|
|
map.resources :albums, :collection => { :untouched => :get, } do |album|
|
||||||
album.resources :tags do |tag|
|
album.resources :tags do |tag|
|
||||||
tag.resources :photos, :collection => { :untouched => :get, :upload => :get, :edit_multiple => :get }
|
tag.resources :photos, :collection => { :untouched => :get, :upload => :get, :edit_multiple => :get }
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
development:
|
development:
|
||||||
site_name: Photos
|
site_name: Photos
|
||||||
photos_path: '/photos/originals/'
|
photos_path: 'photos'
|
||||||
thumbs_path: '/photos/thumbs/'
|
thumbs_path: 'public/thumbs/'
|
||||||
photos_path_public: '/files/'
|
photos_path_public: '/files/'
|
||||||
thumbs_path_public: '/thumbs/'
|
thumbs_path_public: '/thumbs/'
|
||||||
production:
|
production:
|
||||||
site_name: Photos
|
site_name: Photos
|
||||||
photos_path: '/photos/originals/'
|
photos_path: 'photos'
|
||||||
thumbs_path: '/photos/thumbs/'
|
thumbs_path: 'public/thumbs/'
|
||||||
photos_path_public: '/files/'
|
photos_path_public: '/files/'
|
||||||
thumbs_path_public: '/thumbs/'
|
thumbs_path_public: '/thumbs/'
|
||||||
test:
|
test:
|
||||||
site_name: Photos
|
site_name: Photos
|
||||||
photos_path: '/photos/originals/'
|
photos_path: 'photos'
|
||||||
thumbs_path: '/photos/thumbs/'
|
thumbs_path: 'public/thumbs/'
|
||||||
photos_path_public: '/files/'
|
photos_path_public: '/files/'
|
||||||
thumbs_path_public: '/thumbs/'
|
thumbs_path_public: '/thumbs/'
|
Loading…
Reference in a new issue