Compare commits

...

32 commits

Author SHA1 Message Date
Espen Antonsen 4382b21d70 merge 2011-01-12 16:48:28 +08:00
Espen Antonsen 972dfbe25e dynamic storage path for saving to other folder on S3. more heroku friendly 2010-10-10 22:30:59 +02:00
Espen Antonsen 666750a72a config vars more suited for heroku. not overwritten 2010-10-10 20:09:30 +02:00
Espen Antonsen 9f401e3817 heroku conf hide 2010-10-07 00:41:47 +02:00
Espen Antonsen 481a91c7f3 no comments in gems file 2010-10-07 00:26:59 +02:00
Espen Antonsen 0928d3e582 config.gem "rmagick", 2010-10-07 00:24:27 +02:00
Espen Antonsen ff148424cc specify exact v 2010-10-07 00:19:50 +02:00
Espen Antonsen 1ef291c5d3 3.0? 2010-10-07 00:19:19 +02:00
Espen Antonsen bb23bfc205 rails2 version of carrierwave 2010-10-07 00:18:08 +02:00
Espen Antonsen 5c4f5043ed rails 2.3.9 2010-10-07 00:13:03 +02:00
Espen Antonsen b059720499 ignore balder.rb 2010-10-07 00:08:38 +02:00
Espen Antonsen dc163a9838 Merge branch 'master' of github.com:espen/balder 2010-10-07 00:01:32 +02:00
Espen Antonsen e4d3979c51 balder config file 2010-10-07 00:00:53 +02:00
Espen Antonsen 7d93e75784 opps 2010-10-06 23:56:47 +02:00
Espen Antonsen be83bbd0fd balder.rb 2010-10-06 23:56:03 +02:00
Espen Antonsen 709da5fb35 not require mysql2 on heroku. require aws on heroku 2010-10-06 23:52:46 +02:00
Espen Antonsen d0dbc1e2af rails gem 2010-10-06 23:38:31 +02:00
Espen Antonsen dbd4e1482a empty line 2010-10-06 23:26:57 +02:00
Espen Antonsen c6946167af heroku and s3 settings 2010-10-06 23:08:53 +02:00
Espen Antonsen 88c0c1b628 empty line 2010-10-06 23:06:00 +02:00
Espen Antonsen 94de99c668 ignore balder.rb 2010-10-06 23:02:34 +02:00
Espen Antonsen 5bdbd2558c and another one.. 2010-09-27 15:20:53 +02:00
Espen Antonsen e3ad068f40 fixture user 2010-09-27 13:23:23 +02:00
Espen Antonsen 4d0bd95d4a mysql2 2010-09-17 16:00:53 +02:00
Espen Antonsen 670c7dad5e updated so tag listing works. find_by_title instead of id 2010-08-07 13:30:53 +02:00
Espen Antonsen c049033193 remove old legacy code. now using carrierwave to retrieve url 2010-07-28 00:27:47 +02:00
Espen Antonsen e3ccbeb03b can now run from Heroku...yay! 2010-07-01 12:28:45 +02:00
Espen Antonsen 5920d3005d no need to set my locale for everyone else.. 2010-07-01 12:27:10 +02:00
Espen Antonsen fd64c725eb updated readme with info about carrierwave 2010-07-01 12:26:03 +02:00
Espen Antonsen b3b8baf8b5 initial iphone/ipad support 2010-07-01 12:14:23 +02:00
Espen Antonsen c854b3d2e9 fix set title. setting for heroku 2010-04-14 01:00:48 -04:00
Espen Antonsen 5cf109280b balder ENV settings. s3 init. remove settings.yml 2010-04-13 23:56:13 -04:00
10 changed files with 30 additions and 27 deletions

5
.gems
View file

@ -1,4 +1,5 @@
rails --version '2.3.9'
authlogic authlogic
carrierwave carrierwave --version '0.4.5'
aws-s3 aws-s3
mini_exiftool rmagick

1
.gitignore vendored
View file

@ -3,6 +3,7 @@ tmp/**/*
.DS_Store .DS_Store
doc/api doc/api
doc/app doc/app
config/balder.rb
config/database.yml config/database.yml
config/settings.yml config/settings.yml
config/deploy.rb config/deploy.rb

View file

@ -46,7 +46,7 @@ class ApplicationController < ActionController::Base
end end
def check_public_access def check_public_access
require_user unless ENV['PUBLIC'] == 'true' require_user if ENV['PRIVATE'] == 'true'
end end
def current_user_session def current_user_session

View file

@ -22,7 +22,7 @@ class FileUploader < CarrierWave::Uploader::Base
# This is a sensible default for uploaders that are meant to be mounted: # This is a sensible default for uploaders that are meant to be mounted:
def store_dir def store_dir
#{}"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" #{}"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
"uploads/files/#{model.album.path}" ENV['STORAGE_PATH'] + "files/#{model.album.path}"
end end
# Provide a default URL as a default if there hasn't been a file uploaded # Provide a default URL as a default if there hasn't been a file uploaded
@ -41,25 +41,25 @@ class FileUploader < CarrierWave::Uploader::Base
version :collection do version :collection do
process :resize_to_fill => [200, 200] process :resize_to_fill => [200, 200]
def store_dir def store_dir
"uploads/thumbs/#{model.album.path}" ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
end end
end end
version :album do version :album do
process :resize_to_fill => [100, 100] process :resize_to_fill => [100, 100]
def store_dir def store_dir
"uploads/thumbs/#{model.album.path}" ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
end end
end end
version :preview do version :preview do
process :resize_to_fit => [210, 210] process :resize_to_fit => [210, 210]
def store_dir def store_dir
"uploads/thumbs/#{model.album.path}" ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
end end
end end
version :single do version :single do
process :resize_to_limit => [950, 950] process :resize_to_limit => [950, 950]
def store_dir def store_dir
"uploads/thumbs/#{model.album.path}" ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
end end
end end

View file

@ -3,7 +3,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%= ENV['TITLE'] %></title> <title><%= ENV['TITLE'] || "Photos" %></title>
<%= yield :head %> <%= yield :head %>
<%= stylesheet_link_tag 'application' %> <%= stylesheet_link_tag 'application' %>
</head> </head>

View file

@ -1,5 +1,6 @@
ENV['PUBLIC'] = 'true' ENV['STORAGE_PATH'] = "uploads" if ENV['STORAGE_PATH'].nil?
ENV['TITLE'] = 'photo' #ENV['PRIVATE'] = 'true'
#ENV['TITLE'] = 'photo'
#ENV['HEROKU'] = 'true' #ENV['HEROKU'] = 'true'
#ENV['S3_KEY'] = '' #ENV['S3_KEY'] = ''
#ENV['S3_SECRET'] = '' #ENV['S3_SECRET'] = ''

View file

@ -16,9 +16,9 @@ Rails::Initializer.run do |config|
config.gem "authlogic" config.gem "authlogic"
config.gem 'mime-types', :lib => 'mime/types' config.gem 'mime-types', :lib => 'mime/types'
config.gem "carrierwave" config.gem "carrierwave"
config.gem "mysql2" config.gem "mysql2" unless ENV['HEROKU']
config.gem "aws-s3", :lib => "aws/s3" if ENV['HEROKU']
#config.gem "mini_exiftool" #config.gem "mini_exiftool"
#config.gem "aws-s3", :lib => "aws/s3"
config.load_paths += %W( #{RAILS_ROOT}/app/middleware ) config.load_paths += %W( #{RAILS_ROOT}/app/middleware )

View file

@ -27,8 +27,8 @@ Feature: Manage Albums
Scenario: Create Valid Album Scenario: Create Valid Album
Given the following user records Given the following user records
| email | password | | email | password |
| espen@inspired.no | megmeg | | balder@balderapp.com | balder |
When I am logged in as "espen@inspired.no" with password "megmeg" When I am logged in as "balder@balderapp.com" with password "balder"
And I am on the list of albums And I am on the list of albums
And I have no albums And I have no albums
When I follow "New Album" When I follow "New Album"

View file

@ -1,12 +1,12 @@
Given /i am logged in as a user in the (.*) role/i do |role| Given /i am logged in as a user in the (.*) role/i do |role|
#@user = Factory.create(:user, :name => "Espen Antonsen", #@user = Factory.create(:user, :name => "Espen Antonsen",
# :email => "espen@inspired.no", # :email => "balder@balderapp.com",
# :password => "megmeg") # :password => "balder")
#@role = Factory.create(:role, :rolename => role) #@role = Factory.create(:role, :rolename => role)
#@user.roles << @role #@user.roles << @role
visits "/login" visits "/login"
fills_in("email", :with => "espen@inspired.no") fills_in("email", :with => "balder@balderapp.com")
fills_in("password", :with => "megmeg") fills_in("password", :with => "balder")
clicks_button("Log in") clicks_button("Log in")
end end