Newer
Older
dmpopidor / config / application.rb
require File.expand_path('../boot', __FILE__)

require 'rails/all'
#require 'devise'
require 'recaptcha/rails'
require 'csv'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
#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
#Bundler.require(:default, Rails.env)
#Changed when migrated to rails 4.0.0
Bundler.require(*Rails.groups)

module DMPRoadmap
  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.
	
	#commented 15.03.2016
	#config.autoload_paths << Rails.root.join('lib')

    # 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.i18n.default_locale = :de
	
	# Configure the default encoding used in templates for Ruby 1.9.
    config.encoding = "utf-8"

    # Configure sensitive parameters which will be filtered from the log file.
    config.filter_parameters += [:password]

    # Enable escaping HTML in JSON.
    config.active_support.escape_html_entities_in_json = true

    # Use SQL instead of Active Record's schema dumper when creating the database.
    # This is necessary if your schema can't be completely dumped by the schema dumper,
    # like if you have constraints or database-specific column types
    # config.active_record.schema_format = :sql

    # Enforce whitelist mode for mass assignment.
    # This will create an empty whitelist of attributes available for mass-assignment for all models
    # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
    # parameters by using an attr_accessible or attr_protected declaration.
    #config.active_record.whitelist_attributes = true	
	
	# 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'

    # Even though the Rails docs state that it looks in lib/assets/images, the
    # site errors out with messages saying '[image].[extension] not precompiled'
    # This forces Rails to add the lib/assets/images dir to precompilation
    config.assets.paths << Rails.root.join("lib", "assets", "images")
    config.assets.paths << Rails.root.join("lib", "assets", "videos")
    config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif *ico)
    config.assets.precompile += %w(*mp4 *webm *ogg *ogv *swf)
#    config.assets.precompile += %w(jquery.placeholder.js)
#    config.assets.precompile += %w(jquery.tablesorter.js)
#    config.assets.precompile += %w(dmproadmap/export_configure.js)
    config.assets.precompile += %w(admin.js)
    config.assets.precompile += %w(plans.js)
     
    # Vendor resources
    config.assets.precompile += %w(vendor/jquery-ui.min.css
                                   vendor/jquery-ui.min.js
                                   vendor/jquery-ui.structure.min.css
                                   vendor/jquery-ui.theme.min.css
                                   vendor/jquery-accessible-autocomplet-list-aria.js
                                   vendor/jquery.placeholder.js
                                   vendor/jquery.tablesorter.min.js
                                   jquery.timeago.js)

    config.assets.precompile += %w(admin.css)
    config.assets.precompile += %w(admin.js)
    config.assets.precompile += %w(dmproadmap.js)
                                   
    config.assets.precompile += %w(views/answers/status.js
                                   views/contacts/new_contact.js
                                   views/devise/passwords/new.js
                                   views/devise/registrations/edit.js
                                   views/contacts/new_contact.js
                                   views/guidances/admin_edit.js
                                   views/home/index.js
                                   views/notes/index.js
                                   views/orgs/admin_edit.js
                                   views/orgs/shibboleth_ds.js
                                   views/plans/export_configure.js
                                   views/plans/index.js 
                                   views/plans/new.js 
                                   views/plans/share.js
                                   views/plans/show.js 
                                   views/shared/login_form.js
                                   views/shared/register_form.js
                                   views/static_pages/utils.js)

    config.autoload_paths += %W(#{config.root}/lib)
    config.action_controller.include_all_helpers = true

    # Set the default host for mailer URLs
    config.action_mailer.default_url_options = { :host => "#{Socket.gethostname}" }

    # Enable shibboleth as an alternative authentication method
    # Requires server configuration and omniauth shibboleth provider configuration
    # See config/initializers/devise.rb
    config.shibboleth_enabled = false

    # Relative path to Shibboleth SSO Logout
    config.shibboleth_login = '/Shibboleth.sso/Login'
    config.shibboleth_logout_url = '/Shibboleth.sso/Logout?return='

    # If this value is set to true your users will be presented with a list of orgs that have a
    # shibboleth identifier in the orgs_identifiers table. If it is set to false (default), the user
    # will be driven out to your federation's discovery service
    #
    # A super admin will also be able to associate orgs with their shibboleth entityIds if this is set to true
    config.shibboleth_use_filtered_discovery_service = false

    # Active Record will no longer suppress errors raised in after_rollback or after_commit
    # in the next version. Devise appears to be using those callbacks.
    # To accept the new behaviour use 'true' otherwise use 'false'
    config.active_record.raise_in_transactional_callbacks = true
    
    # Load Branded terminology (e.g. organization name, application name, etc.)
    config.branding = config_for(:branding).deep_symbolize_keys
    
    # The default visibility setting for new plans
    #   organisationally_visible  - Any member of the user's org can view, export and duplicate the plan
    #   publicly_visibile         - (NOT advisable because plans will show up in Public DMPs page by default)
    #   is_test                   - (NOT advisable because test plans are excluded from statistics)
    #   privately_visible         - Only the owner and people they invite can access the plan
    config.default_plan_visibility = 'privately_visible'
  end
end