Merge master into producer-emails.

This commit is contained in:
Paul Mackay
2015-03-04 19:09:43 +00:00
468 changed files with 11434 additions and 3239 deletions

View File

@@ -39,6 +39,7 @@ module Openfoodnetwork
# Register Spree payment methods
initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app|
app.config.spree.payment_methods << Spree::Gateway::Migs
app.config.spree.payment_methods << Spree::Gateway::Pin
end
# Settings in config/environments/* take precedence over those specified here.
@@ -60,11 +61,11 @@ module Openfoodnetwork
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = 'Melbourne'
config.time_zone = ENV["TIMEZONE"]
# 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 = 'en'
config.i18n.default_locale = ENV["LOCALE"]
# Setting this to true causes a performance regression in Rails 3.2.17
# When we're on a version with the fix below, we can set it to true
@@ -95,6 +96,7 @@ module Openfoodnetwork
config.assets.precompile += ['store/all.css', 'store/all.js', 'store/shop_front.js', 'iehack.js']
config.assets.precompile += ['admin/all.css', 'admin/restore_spree_from_cms.css', 'admin/*.js', 'admin/**/*.js']
config.assets.precompile += ['darkswarm/all.css', 'darkswarm/all.js']
config.assets.precompile += ['mail/all.css']
config.assets.precompile += ['comfortable_mexican_sofa/*']
config.assets.precompile += ['search/all.css', 'search/*.js']
config.assets.precompile += ['shared/*']

View File

@@ -0,0 +1,13 @@
# Add application configuration variables here, as shown below.
#
# Change this, it has serious security implications.
# Minimum 30 but usually 128 characters. To obtain run 'rake secret', or faster, 'openssl rand -hex 128'
SECRET_TOKEN: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TIMEZONE: "Melbourne"
# Default country for dropdowns etc.
DEFAULT_COUNTRY: "Australia"
# Locale for translation.
I18N_LOCALE: "en"
# Spree zone.
CHECKOUT_ZONE: "Australia"

View File

@@ -3,5 +3,9 @@
# 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.
Openfoodnetwork::Application.config.secret_token = '6d784d49173d0ec820f20cfce151717bd12570e9d261460e9d3c295b90c1fd81e3843eb1bec79d9e6d4a7f04d0fd76170ca0c326ffb0f2da5b7a0b50c7442a4c'
# no regular words or you'll be exposed to dictionary attacks.
Openfoodnetwork::Application.config.secret_token = if Rails.env.development? or Rails.env.test?
('x' * 30) # Meets basic minimum of 30 chars.
else
ENV["SECRET_TOKEN"]
end

View File

@@ -11,11 +11,11 @@ require 'spree/product_filters'
Spree.config do |config|
config.shipping_instructions = true
config.checkout_zone = 'Australia'
config.checkout_zone = ENV["CHECKOUT_ZONE"]
config.address_requires_state = true
# 12 should be Australia. Hardcoded for CI (Jenkins), where countries are not pre-loaded.
config.default_country_id = 12
country = Spree::Country.find_by_name(ENV["DEFAULT_COUNTRY"])
config.default_country_id = country.id if country.present?
# -- spree_paypal_express
# Auto-capture payments. Without this option, payments must be manually captured in the paypal interface.

23
config/locales/en-GB.yml Normal file
View File

@@ -0,0 +1,23 @@
# Localization file for British English. Add more files in this directory for other locales.
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en-GB:
activerecord:
errors:
models:
spree/user:
attributes:
password:
confirmation: you have successfully registered
too_short: pick a longer name
devise:
failure:
invalid: |
Invalid email or password.
Were you a guest last time? Perhaps you need to create an account or reset your password.
home: "OFN"
welcome_to: 'Welcome to '
search_by_name: Search by name...
producers: UK Producers
producers_join: UK producers are now welcome to join Open Food Network UK.

View File

@@ -7,4 +7,14 @@ en:
invalid: |
Invalid email or password.
Were you a guest last time? Perhaps you need to create an account or reset your password.
enterprise_confirmations:
enterprise:
confirmed: Thankyou, your email address has been confirmed.
not_confirmed: Your email address could not be confirmed. Perhaps you have already completed this step?
confirmation_sent: "Confirmation email sent!"
confirmation_not_sent: "Could not send a confirmation email."
home: "OFN"
welcome_to: 'Welcome to '
search_by_name: Search by name or suburb...
producers: Aussie Producers
producers_join: Australian producers are now welcome to join the Open Food Network.

View File

@@ -26,6 +26,7 @@ Openfoodnetwork::Application.routes.draw do
get :suppliers
get :distributors
post :search
get :check_permalink
end
member do
@@ -33,8 +34,9 @@ Openfoodnetwork::Application.routes.draw do
get :shop # old world
end
end
get '/:id/shop', to: 'enterprises#shop', as: 'enterprise_shop'
devise_for :enterprise
devise_for :enterprise, controllers: { confirmations: 'enterprise_confirmations' }
namespace :admin do
resources :order_cycles do
@@ -50,6 +52,10 @@ Openfoodnetwork::Application.routes.draw do
post :bulk_update, as: :bulk_update
end
member do
put :set_sells
end
resources :producer_properties do
post :update_positions, on: :collection
end
@@ -66,6 +72,10 @@ Openfoodnetwork::Application.routes.draw do
get :move_up
get :move_down
end
resources :variant_overrides do
post :bulk_update, on: :collection
end
end
namespace :api do
@@ -110,10 +120,12 @@ end
Spree::Core::Engine.routes.prepend do
match '/admin/reports/orders_and_distributors' => 'admin/reports#orders_and_distributors', :as => "orders_and_distributors_admin_reports", :via => [:get, :post]
match '/admin/reports/order_cycle_management' => 'admin/reports#order_cycle_management', :as => "order_cycle_management_admin_reports", :via => [:get, :post]
match '/admin/reports/group_buys' => 'admin/reports#group_buys', :as => "group_buys_admin_reports", :via => [:get, :post]
match '/admin/reports/bulk_coop' => 'admin/reports#bulk_coop', :as => "bulk_coop_admin_reports", :via => [:get, :post]
match '/admin/reports/payments' => 'admin/reports#payments', :as => "payments_admin_reports", :via => [:get, :post]
match '/admin/reports/orders_and_fulfillment' => 'admin/reports#orders_and_fulfillment', :as => "orders_and_fulfillment_admin_reports", :via => [:get, :post]
match '/admin/reports/users_and_enterprises' => 'admin/reports#users_and_enterprises', :as => "users_and_enterprises_admin_reports", :via => [:get, :post]
match '/admin/products/bulk_edit' => 'admin/products#bulk_edit', :as => "bulk_edit_admin_products"
match '/admin/orders/bulk_management' => 'admin/orders#bulk_management', :as => "admin_bulk_order_management"
match '/admin/reports/products_and_inventory' => 'admin/reports#products_and_inventory', :as => "products_and_inventory_admin_reports", :via => [:get, :post]
@@ -128,8 +140,12 @@ Spree::Core::Engine.routes.prepend do
end
resources :products do
get :managed, on: :collection
get :bulk_products, on: :collection
collection do
get :managed
get :bulk_products
get :distributable
get :overridable
end
delete :soft_delete
resources :variants do
@@ -143,6 +159,8 @@ Spree::Core::Engine.routes.prepend do
end
namespace :admin do
get '/search/known_users' => "search#known_users", :as => :search_known_users
resources :products do
get :product_distributions, on: :member
@@ -151,8 +169,6 @@ Spree::Core::Engine.routes.prepend do
end
resources :orders do
get :select_distributor, :on => :member
get :deselect_distributor, :on => :collection
get :clear, :on => :collection
get :order_cycle_expired, :on => :collection
end