2017 refactor

This commit is contained in:
Godwin
2017-04-09 11:37:16 -07:00
parent 3d00b70087
commit d1db46ffaf
302 changed files with 7100 additions and 8082 deletions
+20 -21
View File
@@ -1,9 +1,6 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
#require "#{Rails.root}/app/helpers/bike_bike_form_helper"
#require '/app/helpers/bike_bike_form_helper.rb'
#require 'dotenv'; Dotenv.load ".env.local", ".env.#{Rails.env}"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
@@ -13,24 +10,26 @@ ENV['JPEGOPTIM_BIN'] = 'jpegoptim'
ENV['OPTIPNG_BIN'] = 'optipng'
module BikeBike
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# 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 = 'Central Time (US & Canada)'
# 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 = '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.action_controller.default_url_options = { :trailing_slash => true }
config.i18n.default_locale = :en
config.i18n.enforce_available_locales = false
self.paths['config/database'] = Rails.root.join('config', 'database.yml')
config.active_record.raise_in_transactional_callbacks = true
config.action_mailer.raise_delivery_errors = true
config.exceptions_app = self.routes
I18n.config.language_threshold = 0
end
# 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.action_controller.default_url_options = { :trailing_slash => true }
config.i18n.default_locale = :en
config.i18n.enforce_available_locales = false
self.paths['config/database'] = Rails.root.join('config', 'database.yml')
config.active_record.raise_in_transactional_callbacks = true
config.action_mailer.raise_delivery_errors = true
config.exceptions_app = self.routes
I18n.config.language_threshold = 0
config.paths['db/migrate'] = BikecollectivesCore::Engine.paths['db/migrate'].existent
end
end
+43 -44
View File
@@ -3,60 +3,59 @@
#OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
BikeBike::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# 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 web server when you make code changes.
config.cache_classes = false
# 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 web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = false
config.assets.digest = false
config.assets.compile = true
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
config.assets.digest = true
config.assets.compile = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'mail.bikebike.org',
:domain => 'preview.bikebike.org',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none',
:user_name => 'info@preview.bikebike.org',
:password => 'test'
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'mail.bikebike.org',
:domain => 'preview.bikebike.org',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none',
:user_name => 'info@preview.bikebike.org',
:password => 'test'
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.serve_static_files = true
# config.action_controller.perform_caching = true
config.serve_static_files = true
# config.action_controller.perform_caching = true
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM
# to be appraised of mailing errors
config.action_mailer.raise_delivery_errors = true
# to deliver to the browser instead of email
config.action_mailer.delivery_method = :letter_opener
# to be appraised of mailing errors
config.action_mailer.raise_delivery_errors = true
# to deliver to the browser instead of email
config.action_mailer.delivery_method = :letter_opener
Paypal.sandbox!
Paypal.sandbox!
end
+46 -30
View File
@@ -1,42 +1,58 @@
require 'lingua_franca/action_mailer'
BikeBike::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# ActionMailer::DeliveryMethods.add_delivery_method(:lingua_franca, LinguaFranca::TestMailer)
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance.
#config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
# Configure static asset server for tests with Cache-Control for performance.
#config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
config.action_mailer.default_url_options = { host: 'localhost' }
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.smtp_settings = {
:address => 'mail.bikebike.org',
:domain => 'preview.bikebike.org',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none',
:user_name => 'info@preview.bikebike.org',
:password => 'test'
}
config.action_mailer.raise_delivery_errors = true
# config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :lingua_franca
config.action_mailer.default_url_options = { host: 'localhost' }
# config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM
Paypal.sandbox!
Paypal.sandbox!
end
+393 -869
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
---
fr: {}
+71 -57
View File
@@ -1,78 +1,92 @@
BikeBike::Application.routes.draw do
# Conferences
get '/conferences' => 'conferences#list', as: :conferences
scope :conferences do
root 'conferences#list', as: :conferences
get 'new' => 'administration#new', as: :new_conference
post 'save' => 'administration#save', as: :save_conference
scope ':slug' do
root 'conferences#view', as: :conference
get 'edit' => 'administration#edit', as: :edit_conference
# Administrator only
get '/conferences/new' => 'admin#new', as: :new_conference
post '/conferences/save' => 'admin#save', as: :save_conference
get '/conferences/:slug/edit' => 'admin#edit', as: :edit_conference
get '/conferences/:slug' => 'conferences#view', as: :conference
# Registration
scope :register do
root 'conferences#register', as: :register, via: :all
get ':step' => 'conferences#register', as: :register_step
get ':button/:confirmation_token' => 'conferences#register', as: :register_paypal_confirm
end
# Administration
scope :administration do
root 'conference_administration#administration', as: :administrate_conference
# Conference registration
match '/conferences/:slug/register' => 'conferences#register', as: :register, via: [:get, :post]
get '/conferences/:slug/register/:step' => 'conferences#register', as: :register_step
get '/conferences/:slug/register/:button/:confirmation_token' => 'conferences#register', as: :register_paypal_confirm
# Conference administratin
get '/conferences/:slug/administration' => 'conference_administration#administration', as: :administrate_conference
get '/conferences/:slug/administration/:step' => 'conference_administration#administration_step', as: :administration_step
post '/conferences/:slug/administration/update/:step' => 'conference_administration#admin_update', as: :administration_update
get '/conferences/:slug/administration/events/edit/:id' => 'conference_administration#edit_event', as: :edit_event
get '/conferences/:slug/administration/locations/edit/:id' => 'conference_administration#edit_location', as: :edit_location
get ':step' => 'conference_administration#administration_step', as: :administration_step
post 'update/:step' => 'conference_administration#admin_update', as: :administration_update
get 'events/edit/:id' => 'conference_administration#edit_event', as: :edit_event
get 'locations/edit/:id' => 'conference_administration#edit_location', as: :edit_location
end
# Workshops
get '/conferences/:slug/workshops' => 'workshops#workshops', as: :workshops
match '/conferences/:slug/workshops/create' => 'workshops#create_workshop', as: :create_workshop, via: [:get, :post]
post '/conferences/:slug/workshops/save' => 'workshops#save_workshop', as: :save_workshop
get '/conferences/:slug/workshops/:workshop_id' => 'workshops#view_workshop', as: :view_workshop
post '/conferences/:slug/workshops/:workshop_id/toggle-interest' => 'workshops#toggle_workshop_interest', as: :toggle_workshop_interest
match '/conferences/:slug/workshops/:workshop_id/edit' => 'workshops#edit_workshop', as: :edit_workshop, via: [:get, :post]
match '/conferences/:slug/workshops/:workshop_id/translate/:locale' => 'workshops#translate_workshop', as: :translate_workshop, via: [:get, :post]
match '/conferences/:slug/workshops/:workshop_id/delete' => 'workshops#delete_workshop', as: :delete_workshop, via: [:get, :post]
post '/conferences/:slug/workshops/:workshop_id/comment' => 'workshops#add_comment', as: :workshop_comment
get '/conferences/:slug/workshops/:workshop_id/facilitate' => 'workshops#facilitate_workshop', as: :facilitate_workshop
post '/conferences/:slug/workshops/:workshop_id/facilitate_request' => 'workshops#facilitate_request', as: :facilitate_workshop_request
get '/conferences/:slug/workshops/:workshop_id/facilitate_request/:user_id/:approve_or_deny' => 'workshops#approve_facilitate_request', as: :approve_facilitate_workshop_request
get '/conferences/:slug/workshops/:workshop_id/facilitate/sent' => 'workshops#sent_facilitate_request', as: :sent_facilitate_workshop
post '/conferences/:slug/workshops/:workshop_id/add_facilitator' => 'workshops#add_workshop_facilitator', as: :workshop_add_facilitator
# Workshops
scope :workshops do
root 'workshops#workshops', as: :workshops
# User pages
match '/user/logout' => 'application#user_logout', as: :logout, via: [:get, :post]
get '/user' => 'application#user_settings', as: :settings
post '/user/update' => 'application#update_user_settings', as: :update_settings
post '/user/find' => 'application#find_user', as: :find_user
match 'create' => 'workshops#create_workshop', as: :create_workshop, via: :all
post 'save' => 'workshops#save_workshop', as: :save_workshop
# OAuth enpoints
match '/oauth/callback' => 'oauths#callback', via: [:get, :post]
get '/oauth/update' => 'oauths#update', as: :oauth_update
post '/oauth/save' => 'oauths#save', as: :oauth_save
get '/oauth/:provider' => 'oauths#oauth', as: :auth_at_provider
scope ':workshop_id' do
root 'workshops#view_workshop', as: :view_workshop
# User confirmation pages
get '/confirm/:token' => 'application#confirm', as: :confirm
match '/doconfirm' => 'application#do_confirm', as: :do_confirm, via: [:get, :post]
match 'edit' => 'workshops#edit_workshop', as: :edit_workshop, via: :all
match 'delete' => 'workshops#delete_workshop', as: :delete_workshop, via: :all
post 'comment' => 'workshops#add_comment', as: :workshop_comment
post 'toggle-interest' => 'workshops#toggle_workshop_interest', as: :toggle_workshop_interest
match 'translate/:locale' => 'workshops#translate_workshop', as: :translate_workshop, via: :all
scope :facilitate do
root 'workshops#facilitate_workshop', as: :facilitate_workshop
get 'sent' => 'workshops#sent_facilitate_request', as: :sent_facilitate_workshop
end
post 'add_facilitator' => 'workshops#add_workshop_facilitator', as: :workshop_add_facilitator
scope :facilitate_request do
root 'workshops#facilitate_request', as: :facilitate_workshop_request, via: :post
get ':user_id/:approve_or_deny' => 'workshops#approve_facilitate_request', as: :approve_facilitate_workshop_request
end
end
end
end
end
# Contact
get '/contact' => 'application#contact', as: :contact
post '/contact/send' => 'application#contact_send', as: :contact_send
get '/contact/sent' => 'application#contact_sent', as: :contact_sent
scope :contact do
root 'application#contact', as: :contact
post 'send' => 'application#contact_send', as: :contact_send
get 'sent' => 'application#contact_sent', as: :contact_sent
end
# Static pages
get '/about' => 'application#about', as: :about
get '/policy' => 'application#policy', as: :policy
get 'about' => 'application#about', as: :about
get 'policy' => 'application#policy', as: :policy
# Site info
get '/robots.txt' => 'application#robots', as: :robots_txt
get '/humans.txt' => 'application#humans', as: :humans_txt
get 'robots.txt' => 'application#robots', as: :robots_txt
get 'humans.txt' => 'application#humans', as: :humans_txt
# Error pages
match '/js_error' => 'application#js_error', via: [:get, :post]
get '/error_403' => 'application#do_403' unless Rails.env.production?
get '/error_404' => 'application#error_404' unless Rails.env.production?
get '/error_500' => 'application#error_500' unless Rails.env.production?
match 'js_error' => 'application#js_error', via: :all
get 'error_403' => 'application#do_403' unless Rails.env.production?
get 'error_404' => 'application#error_404' unless Rails.env.production?
get 'error_500' => 'application#error_500' unless Rails.env.production?
get 'locale_not_available_error/:locale' => 'application#locale_not_available' unless Rails.env.production?
# Home page
root 'application#home', as: :home
root 'application#home', as: :home
end
+7 -11
View File
@@ -2,18 +2,14 @@ rails_env = ENV['RAILS_ENV'] || 'production'
dir = 'rails'
# The rule of thumb is to use 1 worker per processor core available,
# however since we'll be hosting many apps on this server,
# we need to take a less aggressive approach
worker_processes 2
# We deploy with capistrano, so "current" links to root dir of current release
directory = '/home/rails'
port = 8080
if ENV['RAILS_ENV'] == 'preview'
directory = '/home/preview'
port = 8081
worker_processes 1
directory = '/home/preview'
port = 8081
else
worker_processes 2
directory = '/home/rails'
port = 8080
end
working_directory directory