[refactor]Move constants to configuration file
This commit is contained in:
parent
346f324bef
commit
b7fbba162b
4 changed files with 18 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
EVENTS_PER_PAGE = 3
|
EVENTS_PER_PAGE = Rails.configuration.conference[:events_per_page]
|
||||||
|
|
||||||
class ConferencesController < ApplicationController
|
class ConferencesController < ApplicationController
|
||||||
include ConferenceHelper
|
include ConferenceHelper
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
DEFAULT_LOGO = 'snapcon_logo.png'
|
DEFAULT_LOGO = Rails.configuration.conference[:default_logo]
|
||||||
DEFAULT_COLOR = '#0B3559'
|
DEFAULT_COLOR = Rails.configuration.conference[:default_color]
|
||||||
|
|
||||||
module ConferenceHelper
|
module ConferenceHelper
|
||||||
# Return true if only call_for_papers or call_for_tracks or call_for_booths is open
|
# Return true if only call_for_papers or call_for_tracks or call_for_booths is open
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
SNAPCON_BCC_ADDRESS = 'messages@snap.berkeley.edu'
|
SNAPCON_BCC_ADDRESS = Rails.configuration.mailbot[:bcc_address]
|
||||||
EMAIL_TEMPLATE = 'email_template'
|
EMAIL_TEMPLATE = Rails.configuration.mailbot[:email_template]
|
||||||
YTLF_TICKET_ID = 50
|
YTLF_TICKET_ID = Rails.configuration.mailbot[:ytlf_ticket_id]
|
||||||
|
|
||||||
class Mailbot < ActionMailer::Base
|
class Mailbot < ActionMailer::Base
|
||||||
helper ConferenceHelper
|
helper ConferenceHelper
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,18 @@ module Osem
|
||||||
|
|
||||||
config.active_job.queue_adapter = :delayed_job
|
config.active_job.queue_adapter = :delayed_job
|
||||||
|
|
||||||
|
config.conference = {
|
||||||
|
events_per_page: 3,
|
||||||
|
default_logo: 'snapcon_logo.png',
|
||||||
|
default_color: '#0B3559'
|
||||||
|
}
|
||||||
|
|
||||||
|
config.mailbot = {
|
||||||
|
bcc_address: 'messages@snap.berkeley.edu',
|
||||||
|
email_template: 'email_template',
|
||||||
|
ytlf_ticket_id: 50
|
||||||
|
}
|
||||||
|
|
||||||
config.before_configuration do
|
config.before_configuration do
|
||||||
env_file = File.join(Rails.root, 'config', 'local_env.yml')
|
env_file = File.join(Rails.root, 'config', 'local_env.yml')
|
||||||
if File.exist?(env_file)
|
if File.exist?(env_file)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue