diff --git a/config.ru b/config.ru
index 69cf39b..230e0be 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
-run Photos::Application
+run DanBarberPhoto::Application
diff --git a/config/application.rb b/config/application.rb
index 7eb867c..6475e16 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -2,11 +2,14 @@ require File.expand_path('../boot', __FILE__)
require 'rails/all'
-# If you have a Gemfile, require the gems listed there, including any gems
-# you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env) if defined?(Bundler)
+if defined?(Bundler)
+ # If you precompile assets before deploying to production, use this line
+ Bundler.require *Rails.groups(:assets => %w(development test))
+ # If you want your assets lazily compiled in production, use this line
+ # Bundler.require(:default, :assets, Rails.env)
+end
-module Photos
+module DanBarberPhoto
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
@@ -27,11 +30,8 @@ module Photos
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
-
- # JavaScript files you want as :defaults (application.js is always included).
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
+ config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ config.i18n.default_locale = :en
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
@@ -39,6 +39,15 @@ module Photos
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
+ # Enable the asset pipeline
+ config.assets.enabled = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+
+ # Prefer SASS syntax for stylesheets
+ config.sass.preferred_syntax = :sass
+
# Rack Middleware
config.middleware.use ::ExceptionNotifier, :email_prefix => "[DanBarberPhoto] ",
:sender_address => %{"Exception Notification" },
@@ -46,5 +55,3 @@ module Photos
end
end
-
-ActionMailer::Base.delivery_method = :sendmail
diff --git a/config/boot.rb b/config/boot.rb
index ab6cb37..4489e58 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,13 +1,6 @@
require 'rubygems'
# Set up gems listed in the Gemfile.
-gemfile = File.expand_path('../../Gemfile', __FILE__)
-begin
- ENV['BUNDLE_GEMFILE'] = gemfile
- require 'bundler'
- Bundler.setup
-rescue Bundler::GemNotFound => e
- STDERR.puts e.message
- STDERR.puts "Try running `bundle install`."
- exit!
-end if File.exist?(gemfile)
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/environment.rb b/config/environment.rb
index 6c12e33..9087dc3 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)
# Initialize the rails application
-Photos::Application.initialize!
+DanBarberPhoto::Application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 8cdd743..c85b54c 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,9 +1,9 @@
-Photos::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+DanBarberPhoto::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
- # since you don't have to restart the webserver when you make code changes.
+ # since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
@@ -11,7 +11,6 @@ Photos::Application.configure do
# Show full error reports and disable caching
config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
@@ -22,5 +21,24 @@ Photos::Application.configure do
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
-end
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
+
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.smtp_settings = {
+ :address => "smtp.gmail.com",
+ :port => 587,
+ :domain => 'danbee.co.uk',
+ :user_name => 'webapps@danbee.co.uk',
+ :password => 'fy-qua-paqu-rhuh-quok-py',
+ :authentication => 'plain',
+ :enable_starttls_auto => true
+ }
+
+ config.action_mailer.default_url_options = { :host => "danbarberphoto.dev" }
+
+end
\ No newline at end of file
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 66a1a1a..978091c 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,7 +1,6 @@
-Photos::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+DanBarberPhoto::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
- # The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
@@ -9,14 +8,27 @@ Photos::Application.configure do
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
+ # Disable Rails's static asset server (Apache or nginx will already do this)
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
+
# Specifies the header that your server uses for sending files
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
- # For nginx:
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
-
- # If you have no front-end server that supports something like X-Sendfile,
- # just comment this out and Rails will serve the files
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
@@ -27,13 +39,12 @@ Photos::Application.configure do
# Use a different cache store in production
# config.cache_store = :mem_cache_store
- # Disable Rails's static asset server
- # In production, Apache or nginx will already do this
- config.serve_static_assets = false
-
- # Enable serving of images, stylesheets, and javascripts from an asset server
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ config.assets.precompile += %w( admin.js admin.css )
+
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
@@ -46,4 +57,18 @@ Photos::Application.configure do
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
+
+ # Heroku Sendgrid settings.
+ ActionMailer::Base.smtp_settings = {
+ :address => 'smtp.sendgrid.net',
+ :port => '587',
+ :authentication => :plain,
+ :user_name => ENV['SENDGRID_USERNAME'],
+ :password => ENV['SENDGRID_PASSWORD'],
+ :domain => 'heroku.com'
+ }
+ ActionMailer::Base.delivery_method = :smtp
+
+ config.action_mailer.default_url_options = { :host => "danbarberphoto.com" }
+
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 33e40e5..b1a0a1d 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,4 +1,4 @@
-Photos::Application.configure do
+DanBarberPhoto::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
diff --git a/config/initializers/cookie_verification_secret.rb b/config/initializers/cookie_verification_secret.rb
deleted file mode 100644
index f74da38..0000000
--- a/config/initializers/cookie_verification_secret.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Your secret key for verifying the integrity of signed cookies.
-# If you change this key, all old signed cookies will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-ActionController::Base.cookie_verifier_secret = 'b1d6b935fa81c698e8da3f2452f0aabc70c70c06903b6a9f281caf8cdb64ed4f4eaeb02c19077c642dee2dcb40191780fbe028fb7c6274f8a47550ec6b2c7663';
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index a4a0489..cb1ab71 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Photos::Application.config.secret_token = 'd1211d350d798302a7221c5278ead687c890f694207a9f6b5224a26bac2f00e853f9ecc780554d2e3f1f36606a583c7c6f1f371ce945082f7a3154132762e1b7'
+DanBarberPhoto::Application.config.secret_token = '61b03777f23e7feb0610d1a7ef5f89c7cf884b73502ab4ef88517d578308a8adeddbf5b362776b1d48957a0b4f3d2227208b62ba057666b90eec6cd804a71a03'
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index c0e57cd..2eaad7f 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.
-Photos::Application.config.session_store :cookie_store, :key => '_photos_session'
+DanBarberPhoto::Application.config.session_store :cookie_store, key: '_danbarberphoto_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
-# (create the session table with "rake db:sessions:create")
-# Photos::Application.config.session_store :active_record_store
+# (create the session table with "rails generate session_migration")
+# DanBarberPhoto::Application.config.session_store :active_record_store
diff --git a/config/initializers/typus.rb b/config/initializers/typus.rb
deleted file mode 100644
index 0ff0036..0000000
--- a/config/initializers/typus.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-Typus.setup do |config|
-
- # Application name.
- config.admin_title = "danbarberphoto"
- # config.admin_sub_title = ""
-
- # When mailer_sender is set, password recover is enabled. This email
- # address will be used in Admin::Mailer.
- # config.mailer_sender = "admin@example.com"
-
- # Define paperclip attachment styles.
- # config.file_preview = :medium
- # config.file_thumbnail = :thumb
- config.file_preview = :preview
- config.file_thumbnail = :size2
-
- # Authentication: +:none+, +:http_basic+
- # Run `rails g typus:migration` if you need an advanced authentication system.
- # config.authentication = :none
-
- # Define username and password for +:http_basic+ authentication
- # config.username = "admin"
- # config.password = "columbia"
-
- # Pagination options:
- # These options are passed to `will_paginate`. You can see the available
- # options in the plugin source. (https://github.com/mislav/will_paginate/blob/rails3/lib/will_paginate/view_helpers.rb)
- # config.pagination = { :previous_label => "← " + Typus::I18n.t("Previous"),
- # :next_label => Typus::I18n.t("Next") + " →" }
-
-end
diff --git a/config/initializers/typus_authentication.rb b/config/initializers/typus_authentication.rb
deleted file mode 100644
index 9329423..0000000
--- a/config/initializers/typus_authentication.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-Typus.setup do |config|
-
- # Define authentication: +:none+, +:http_basic+, +:session+
- config.authentication = :session
-
- # Define master_role.
- # config.master_role = "admin"
-
- # Define relationship.
- # config.relationship = "typus_users"
-
- # Define user_class_name.
- config.user_class_name = "AdminUser"
-
- # Define user_fk.
- config.user_fk = "admin_user_id"
-
-end
diff --git a/config/initializers/typus_resources.rb b/config/initializers/typus_resources.rb
deleted file mode 100644
index a728122..0000000
--- a/config/initializers/typus_resources.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-Typus::Resources.setup do |config|
-
- # Defines default_action_on_item.
- # config.default_action_on_item = "edit"
-
- # Defines end_year.
- # config.end_year = nil
-
- # Defines form_rows.
- # config.form_rows = 15
-
- # Defines action_after_save.
- # config.action_after_save = "edit"
-
- # Defines minute_step.
- # config.minute_step = 5
-
- # Defines only_user_items.
- # config.only_user_items = false
-
- # Defines per_page.
- # config.per_page = 15
-
- # Defines start_year.
- # config.start_year = nil
-
-end
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
new file mode 100644
index 0000000..999df20
--- /dev/null
+++ b/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
+end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a747bfa..179c14c 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,5 +1,5 @@
# Sample localization file for English. Add more files in this directory for other locales.
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"
diff --git a/config/routes.rb b/config/routes.rb
index 72decb7..b058a68 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,4 @@
-Photos::Application.routes.draw do
+DanBarberPhoto::Application.routes.draw do
resources :contacts
# The priority is based upon order of creation:
diff --git a/lib/assets/.gitkeep b/lib/assets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/log/.gitkeep b/log/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/public/images/.DS_Store b/public/images/.DS_Store
deleted file mode 100644
index 6a4b2e3..0000000
Binary files a/public/images/.DS_Store and /dev/null differ
diff --git a/public/images/admin/fancybox/fancy_close.png b/public/images/admin/fancybox/fancy_close.png
deleted file mode 100644
index 0703530..0000000
Binary files a/public/images/admin/fancybox/fancy_close.png and /dev/null differ
diff --git a/public/images/admin/ui-icons.png b/public/images/admin/ui-icons.png
deleted file mode 100644
index 8ede620..0000000
Binary files a/public/images/admin/ui-icons.png and /dev/null differ
diff --git a/public/images/fancybox/blank.gif b/public/images/fancybox/blank.gif
deleted file mode 100644
index 35d42e8..0000000
Binary files a/public/images/fancybox/blank.gif and /dev/null differ
diff --git a/public/images/fancybox/fancy_close.png b/public/images/fancybox/fancy_close.png
deleted file mode 100644
index 0703530..0000000
Binary files a/public/images/fancybox/fancy_close.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_loading.png b/public/images/fancybox/fancy_loading.png
deleted file mode 100644
index 2503017..0000000
Binary files a/public/images/fancybox/fancy_loading.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_nav_left.png b/public/images/fancybox/fancy_nav_left.png
deleted file mode 100644
index ebaa6a4..0000000
Binary files a/public/images/fancybox/fancy_nav_left.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_nav_right.png b/public/images/fancybox/fancy_nav_right.png
deleted file mode 100644
index 873294e..0000000
Binary files a/public/images/fancybox/fancy_nav_right.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_e.png b/public/images/fancybox/fancy_shadow_e.png
deleted file mode 100644
index 2eda089..0000000
Binary files a/public/images/fancybox/fancy_shadow_e.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_n.png b/public/images/fancybox/fancy_shadow_n.png
deleted file mode 100644
index 69aa10e..0000000
Binary files a/public/images/fancybox/fancy_shadow_n.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_ne.png b/public/images/fancybox/fancy_shadow_ne.png
deleted file mode 100644
index 79f6980..0000000
Binary files a/public/images/fancybox/fancy_shadow_ne.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_nw.png b/public/images/fancybox/fancy_shadow_nw.png
deleted file mode 100644
index 7182cd9..0000000
Binary files a/public/images/fancybox/fancy_shadow_nw.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_s.png b/public/images/fancybox/fancy_shadow_s.png
deleted file mode 100644
index d8858bf..0000000
Binary files a/public/images/fancybox/fancy_shadow_s.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_se.png b/public/images/fancybox/fancy_shadow_se.png
deleted file mode 100644
index 541e3ff..0000000
Binary files a/public/images/fancybox/fancy_shadow_se.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_sw.png b/public/images/fancybox/fancy_shadow_sw.png
deleted file mode 100644
index b451689..0000000
Binary files a/public/images/fancybox/fancy_shadow_sw.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_shadow_w.png b/public/images/fancybox/fancy_shadow_w.png
deleted file mode 100644
index 8a4e4a8..0000000
Binary files a/public/images/fancybox/fancy_shadow_w.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_title_left.png b/public/images/fancybox/fancy_title_left.png
deleted file mode 100644
index 6049223..0000000
Binary files a/public/images/fancybox/fancy_title_left.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_title_main.png b/public/images/fancybox/fancy_title_main.png
deleted file mode 100644
index 8044271..0000000
Binary files a/public/images/fancybox/fancy_title_main.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_title_over.png b/public/images/fancybox/fancy_title_over.png
deleted file mode 100644
index d9f458f..0000000
Binary files a/public/images/fancybox/fancy_title_over.png and /dev/null differ
diff --git a/public/images/fancybox/fancy_title_right.png b/public/images/fancybox/fancy_title_right.png
deleted file mode 100644
index e36d9db..0000000
Binary files a/public/images/fancybox/fancy_title_right.png and /dev/null differ
diff --git a/public/index.html_ b/public/index.html_
deleted file mode 100644
index 75d5edd..0000000
--- a/public/index.html_
+++ /dev/null
@@ -1,239 +0,0 @@
-
-
-
- Ruby on Rails: Welcome aboard
-
-
-
-
-