Compare commits
32 commits
Author | SHA1 | Date | |
---|---|---|---|
4382b21d70 | |||
972dfbe25e | |||
666750a72a | |||
9f401e3817 | |||
481a91c7f3 | |||
0928d3e582 | |||
ff148424cc | |||
1ef291c5d3 | |||
bb23bfc205 | |||
5c4f5043ed | |||
b059720499 | |||
dc163a9838 | |||
e4d3979c51 | |||
7d93e75784 | |||
be83bbd0fd | |||
709da5fb35 | |||
d0dbc1e2af | |||
dbd4e1482a | |||
c6946167af | |||
88c0c1b628 | |||
94de99c668 | |||
5bdbd2558c | |||
e3ad068f40 | |||
4d0bd95d4a | |||
670c7dad5e | |||
c049033193 | |||
e3ccbeb03b | |||
5920d3005d | |||
fd64c725eb | |||
b3b8baf8b5 | |||
c854b3d2e9 | |||
5cf109280b |
5
.gems
5
.gems
|
@ -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
1
.gitignore
vendored
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
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'] = ''
|
||||||
#ENV['S3_BUCKET'] = ''
|
#ENV['S3_BUCKET'] = ''
|
|
@ -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 )
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CarrierWave.configure do |config|
|
CarrierWave.configure do |config|
|
||||||
config.s3_access_key_id = ENV['S3_KEY']
|
config.s3_access_key_id = ENV['S3_KEY']
|
||||||
config.s3_secret_access_key = ENV['S3_SECRET']
|
config.s3_secret_access_key = ENV['S3_SECRET']
|
||||||
config.s3_bucket = ENV['S3_BUCKET']
|
config.s3_bucket = ENV['S3_BUCKET']
|
||||||
end
|
end
|
|
@ -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"
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue