trusty-cms 2.0.2.pre.beta → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +2 -0
- data/CONTRIBUTORS.md +3 -1
- data/Gemfile +6 -1
- data/Gemfile.lock +100 -80
- data/INSTALL.md +7 -6
- data/README.md +3 -1
- data/Rakefile +24 -4
- data/app/assets/javascripts/admin/jquery-ui.js +3787 -2339
- data/app/assets/javascripts/admin/page-edit.js +3 -3
- data/app/assets/javascripts/admin/tabcontrol.js.erb +16 -16
- data/app/assets/javascripts/admin/treetable.js +4 -2
- data/app/assets/stylesheets/admin/_base.scss +4 -4
- data/app/assets/stylesheets/admin/modules/_links.scss +1 -1
- data/app/assets/stylesheets/admin/partials/_content.scss +9 -2
- data/app/assets/stylesheets/admin/partials/_forms.scss +97 -29
- data/app/assets/stylesheets/admin/partials/_header.scss +2 -3
- data/app/assets/stylesheets/admin/partials/_index.scss +9 -6
- data/app/assets/stylesheets/admin/partials/_layout.scss +1 -2
- data/app/assets/stylesheets/admin/partials/_popup.scss +0 -11
- data/app/assets/stylesheets/admin/partials/_tabcontrol.scss +4 -4
- data/app/assets/stylesheets/admin/partials/_typography.scss +4 -0
- data/app/controllers/admin/pages_controller.rb +9 -1
- data/app/controllers/admin/references_controller.rb +8 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/controllers/admin/welcome_controller.rb +3 -3
- data/app/controllers/site_controller.rb +1 -1
- data/app/helpers/admin/node_helper.rb +4 -4
- data/app/models/trusty_cms/config.rb +2 -1
- data/app/views/admin/configuration/edit.html.haml +2 -2
- data/app/views/admin/configuration/show.html.haml +1 -1
- data/app/views/admin/layouts/_form.html.haml +1 -1
- data/app/views/admin/layouts/remove.html.haml +1 -1
- data/app/views/admin/pages/_fields.html.haml +1 -1
- data/app/views/admin/pages/_node.html.haml +2 -2
- data/app/views/admin/pages/edit.html.haml +1 -1
- data/app/views/admin/pages/remove.html.haml +2 -2
- data/app/views/admin/preferences/edit.html.haml +36 -36
- data/app/views/admin/users/_form.html.haml +1 -1
- data/app/views/admin/users/_password_fields.html.haml +1 -1
- data/app/views/admin/users/remove.html.haml +1 -1
- data/app/views/admin/welcome/login.html.haml +1 -1
- data/app/views/layouts/application.html.haml +18 -16
- data/config/application.rb +2 -1
- data/config/boot.rb +0 -1
- data/config/database.mysql.yml +3 -3
- data/config/environments/development.rb +1 -0
- data/config/environments/test.rb +2 -4
- data/config/initializers/trusty_cms_config.rb +1 -0
- data/config/routes.rb +1 -0
- data/db/migrate/001_create_radiant_tables.rb +2 -1
- data/db/migrate/20100805155020_convert_page_metas.rb +0 -13
- data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +0 -4
- data/db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb +0 -1
- data/lib/generators/instance/templates/databases/mysql.yml +3 -3
- data/lib/generators/instance/templates/instance_gemfile +2 -2
- data/lib/generators/trusty_cms/templates/database.yml.erb +4 -4
- data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -1
- data/lib/login_system.rb +1 -1
- data/lib/tasks/database.rake +1 -3
- data/lib/tasks/framework.rake +1 -1
- data/lib/trusty_cms.rb +1 -1
- data/lib/trusty_cms/admin_ui.rb +2 -0
- data/lib/trusty_cms/extension_migrator.rb +1 -2
- data/lib/trusty_cms/initializer.rb +1 -1
- data/lib/trusty_cms/setup.rb +1 -1
- data/spec/ci/database.mysql.yml +1 -1
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +5 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +152 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/database.yml +28 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +49 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/trusty_cms_config.rb +20 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +0 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/schema.rb +122 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/features/pages_spec.rb +2 -2
- data/spec/rails_helper.rb +3 -4
- data/spec/spec_helper.rb +13 -77
- data/spec/support/custom_actions.rb +1 -0
- data/trusty_cms.gemspec +4 -2
- metadata +171 -182
- data/db/migrate/003_rename_behavior_column.rb +0 -9
- data/db/migrate/010_merge_behaviors_and_pages.rb +0 -57
- data/db/migrate/011_rename_type_column_on_page_to_class_name.rb +0 -9
- data/db/migrate/019_add_salt_to_users.rb +0 -11
- data/spec/helpers/regions_helper_spec.rb +0 -16
data/config/boot.rb
CHANGED
data/config/database.mysql.yml
CHANGED
@@ -4,19 +4,19 @@
|
|
4
4
|
#
|
5
5
|
|
6
6
|
development:
|
7
|
-
adapter:
|
7
|
+
adapter: mysql2
|
8
8
|
database: trusty_cms_dev
|
9
9
|
username: root
|
10
10
|
password:
|
11
11
|
|
12
12
|
test: &TEST
|
13
|
-
adapter:
|
13
|
+
adapter: mysql2
|
14
14
|
database: trusty_cms_test
|
15
15
|
username: root
|
16
16
|
password:
|
17
17
|
|
18
18
|
production:
|
19
|
-
adapter:
|
19
|
+
adapter: mysql2
|
20
20
|
database: trusty_cms_live
|
21
21
|
username: root
|
22
22
|
password:
|
@@ -5,6 +5,7 @@ TrustyCms::Application.configure do
|
|
5
5
|
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the webserver when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
|
+
config.eager_load = false
|
8
9
|
|
9
10
|
# Log error messages when you accidentally call methods on nil.
|
10
11
|
config.whiny_nils = true
|
data/config/environments/test.rb
CHANGED
@@ -6,6 +6,7 @@ TrustyCms::Application.configure do
|
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
|
+
config.eager_load = false
|
9
10
|
|
10
11
|
# ensure test extensions are loaded
|
11
12
|
# test_extension_dir = File.join(File.expand_path(TRUSTY_CMS_ROOT), 'test', 'fixtures', 'extensions')
|
@@ -23,9 +24,6 @@ TrustyCms::Application.configure do
|
|
23
24
|
config.consider_all_requests_local = true
|
24
25
|
config.action_controller.perform_caching = false
|
25
26
|
|
26
|
-
# Quiet rack cache logging in test mode
|
27
|
-
Rails.application.middleware.delete Rack::Cache
|
28
|
-
Rails.application.middleware.insert 0, Rack::Cache, { verbose: false }
|
29
27
|
|
30
28
|
# Raise an ActiveModel::MassAssignmentSecurity::Error any time
|
31
29
|
# something is mass-assigned that shouldn't be for ease in debugging.
|
@@ -40,7 +38,7 @@ TrustyCms::Application.configure do
|
|
40
38
|
config.action_mailer.delivery_method = :test
|
41
39
|
|
42
40
|
# Configure static asset server for tests with Cache-Control for performance
|
43
|
-
config.
|
41
|
+
config.serve_static_files = true
|
44
42
|
config.static_cache_control = "public, max-age=3600"
|
45
43
|
|
46
44
|
# Raise exceptions instead of rendering exception templates
|
@@ -13,4 +13,5 @@ TrustyCms.config do |config|
|
|
13
13
|
config.define 'site.title', :default => "Your site title", :allow_blank => false
|
14
14
|
config.define 'site.host', :default => "www.example.com", :allow_blank => false
|
15
15
|
config.define 'user.allow_password_reset?', :default => true
|
16
|
+
config.define 'session_timeout', :default => 2.weeks
|
16
17
|
end
|
data/config/routes.rb
CHANGED
@@ -10,7 +10,7 @@ class CreateRadiantTables < ActiveRecord::Migration
|
|
10
10
|
t.column "title", :string
|
11
11
|
t.column "slug", :string, :limit => 100
|
12
12
|
t.column "breadcrumb", :string, :limit => 160
|
13
|
-
t.column "
|
13
|
+
t.column "class_name", :string, :limit => 25
|
14
14
|
t.column "status_id", :integer, :default => 1, :null => false
|
15
15
|
t.column "parent_id", :integer
|
16
16
|
t.column "layout_id", :integer
|
@@ -59,6 +59,7 @@ class CreateRadiantTables < ActiveRecord::Migration
|
|
59
59
|
t.column "updated_at", :datetime
|
60
60
|
t.column "created_by", :integer
|
61
61
|
t.column "updated_by", :integer
|
62
|
+
t.column "salt", :string
|
62
63
|
end
|
63
64
|
add_index "users", ["login"], :name => "login", :unique => true
|
64
65
|
|
@@ -1,24 +1,11 @@
|
|
1
1
|
class ConvertPageMetas < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
# following add and remove column enables running this migration
|
4
|
-
# when upgrading radiant with allowed_children_cache added to Page model
|
5
|
-
add_column :pages, :allowed_children_cache, :text
|
6
|
-
Page.all.each do |page|
|
7
|
-
page.fields.create(:name => 'Keywords', :content => page.keywords)
|
8
|
-
page.fields.create(:name => 'Description', :content => page.description)
|
9
|
-
end
|
10
3
|
remove_column :pages, :keywords
|
11
4
|
remove_column :pages, :description
|
12
|
-
remove_column :pages, :allowed_children_cache
|
13
5
|
end
|
14
6
|
|
15
7
|
def self.down
|
16
8
|
add_column :pages, :description, :string
|
17
9
|
add_column :pages, :keywords, :string
|
18
|
-
Page.all.each do |page|
|
19
|
-
page.description = page.field('description').content
|
20
|
-
page.keywords = page.field('keywords').content
|
21
|
-
page.save
|
22
|
-
end
|
23
10
|
end
|
24
11
|
end
|
@@ -1,10 +1,6 @@
|
|
1
1
|
class AddAllowedChildrenCacheToPages < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
add_column :pages, :allowed_children_cache, :text
|
4
|
-
Page.reset_column_information
|
5
|
-
Page.find_each do |page|
|
6
|
-
page.save # update the allowed_children_cache
|
7
|
-
end
|
8
4
|
end
|
9
5
|
|
10
6
|
def self.down
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# And be sure to use new-style password hashing:
|
12
12
|
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
13
13
|
development:
|
14
|
-
adapter:
|
14
|
+
adapter: mysql2
|
15
15
|
database: <%= app_name %>_development
|
16
16
|
username: root
|
17
17
|
password:
|
@@ -25,7 +25,7 @@ development:
|
|
25
25
|
# re-generated from your development database when you run 'rake'.
|
26
26
|
# Do not set this db to the same as development or production.
|
27
27
|
test:
|
28
|
-
adapter:
|
28
|
+
adapter: mysql2
|
29
29
|
database: <%= app_name %>_test
|
30
30
|
username: root
|
31
31
|
password:
|
@@ -36,7 +36,7 @@ test:
|
|
36
36
|
<% end -%>
|
37
37
|
|
38
38
|
production:
|
39
|
-
adapter:
|
39
|
+
adapter: mysql2
|
40
40
|
database: <%= app_name %>_production
|
41
41
|
username: root
|
42
42
|
password:
|
@@ -20,8 +20,8 @@ gem "compass-rails", "~> 1.0.3"
|
|
20
20
|
# SQLite is the default database connection but only suitable for local use
|
21
21
|
<%= '# ' unless db == 'sqlite3' %>gem "sqlite3", "~> 1.3.5"
|
22
22
|
|
23
|
-
# To use
|
24
|
-
<%= '# ' unless db == '
|
23
|
+
# To use MySQL2
|
24
|
+
<%= '# ' unless db == 'mysql2' %>"mysql2", "~> 0.4.2"
|
25
25
|
|
26
26
|
# Postgres
|
27
27
|
<%= '# ' unless db == 'postgresql' %>gem "pg", "~> 0.11.0"
|
@@ -4,25 +4,25 @@
|
|
4
4
|
#
|
5
5
|
|
6
6
|
development:
|
7
|
-
adapter:
|
7
|
+
adapter: mysql2
|
8
8
|
database: <%= project_name%>_blank_dev
|
9
9
|
username:
|
10
10
|
password:
|
11
11
|
host: localhost
|
12
12
|
|
13
13
|
test: &TEST
|
14
|
-
adapter:
|
14
|
+
adapter: mysql2
|
15
15
|
database: <%= project_name%>_blank_test
|
16
16
|
username:
|
17
17
|
password:
|
18
18
|
host:
|
19
19
|
|
20
20
|
production:
|
21
|
-
adapter:
|
21
|
+
adapter: mysql2
|
22
22
|
database: <%= project_name%>_blank_live
|
23
23
|
username:
|
24
24
|
password:
|
25
25
|
socket: /tmp/mysql.sock
|
26
26
|
|
27
27
|
cucumber:
|
28
|
-
<<: *TEST
|
28
|
+
<<: *TEST
|
@@ -1 +0,0 @@
|
|
1
|
-
load File.join(TRUSTY_CMS_ROOT, "config", "routes.rb")
|
data/lib/login_system.rb
CHANGED
@@ -81,7 +81,7 @@ module LoginSystem
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def set_session_cookie(user = current_user)
|
84
|
-
cookies[:session_token] = { :value => user.session_token , :expires => TrustyCms::Config['session_timeout'].to_i.
|
84
|
+
cookies[:session_token] = { :value => user.session_token , :expires => (Time.now + ((TrustyCms::Config['session_timeout'].to_i)/86400).days).utc }
|
85
85
|
end
|
86
86
|
|
87
87
|
module ClassMethods
|
data/lib/tasks/database.rake
CHANGED
@@ -63,9 +63,7 @@ To add more extensions just add them to your Gemfile and run `bundle install`.
|
|
63
63
|
end
|
64
64
|
|
65
65
|
desc "Migrate the database through all available migration scripts (looks for db/migrate/* in trusty-cms, in extensions and in your site) and update db/schema.rb by invoking db:schema:dump. Turn off output with VERBOSE=false."
|
66
|
-
task :migrate => :environment do
|
67
|
-
Rake::Task['db:migrate:trusty_cms'].invoke
|
68
|
-
Rake::Task['db:migrate:extensions'].invoke
|
66
|
+
task :migrate => [:environment, 'db:migrate:trusty_cms', 'db:migrate:extensions'] do
|
69
67
|
ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
|
70
68
|
ActiveRecord::Migrator.migrate("db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
|
71
69
|
Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
|
data/lib/tasks/framework.rake
CHANGED
data/lib/trusty_cms.rb
CHANGED
data/lib/trusty_cms/admin_ui.rb
CHANGED
@@ -198,6 +198,7 @@ module TrustyCms
|
|
198
198
|
index.bottom.concat %w{new_button}
|
199
199
|
end
|
200
200
|
user.new = user.edit
|
201
|
+
user.remove = user.edit
|
201
202
|
end
|
202
203
|
end
|
203
204
|
|
@@ -215,6 +216,7 @@ module TrustyCms
|
|
215
216
|
index.bottom.concat %w{new_button}
|
216
217
|
end
|
217
218
|
layout.new = layout.edit
|
219
|
+
layout.remove = layout.edit
|
218
220
|
end
|
219
221
|
end
|
220
222
|
|
@@ -84,13 +84,12 @@ module TrustyCms
|
|
84
84
|
|
85
85
|
def record_version_state_after_migrating(version)
|
86
86
|
sm_table = self.class.schema_migrations_table_name
|
87
|
-
|
88
87
|
@migrated_versions ||= []
|
89
88
|
if down?
|
90
89
|
@migrated_versions.delete(version.to_i)
|
91
90
|
ActiveRecord::Base.connection.update("DELETE FROM #{sm_table} WHERE version = #{quote(version_string(version))}")
|
92
91
|
else
|
93
|
-
@migrated_versions.
|
92
|
+
@migrated_versions.add(version.to_i)
|
94
93
|
ActiveRecord::Base.connection.insert("INSERT INTO #{sm_table} (version) VALUES (#{quote(version_string(version))})")
|
95
94
|
end
|
96
95
|
end
|
data/lib/trusty_cms/setup.rb
CHANGED
@@ -36,7 +36,7 @@ module TrustyCms
|
|
36
36
|
:password => password,
|
37
37
|
:password_confirmation => password
|
38
38
|
}
|
39
|
-
admin = User.
|
39
|
+
admin = User.find_by(login: username)
|
40
40
|
admin = User.new unless admin
|
41
41
|
admin.update_attributes(attributes)
|
42
42
|
admin.admin = true
|
data/spec/ci/database.mysql.yml
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
ADDED
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
require 'acts_as_tree'
|
5
|
+
require "trusty_cms"
|
6
|
+
require 'ckeditor'
|
7
|
+
require 'radius'
|
8
|
+
require 'trusty_cms/extension_loader'
|
9
|
+
require 'trusty_cms/initializer'
|
10
|
+
require 'string_extensions/string_extensions'
|
11
|
+
require 'active_record_extensions/active_record_extensions'
|
12
|
+
require 'configuration_extensions/configuration_extensions'
|
13
|
+
require 'compass'
|
14
|
+
require 'rack/cache'
|
15
|
+
require "sass-rails"
|
16
|
+
|
17
|
+
if defined?(Bundler)
|
18
|
+
# If you precompile assets before deploying to production, use this line
|
19
|
+
require 'rake'
|
20
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
21
|
+
# If you want your assets lazily compiled in production, use this line
|
22
|
+
# Bundler.require(:default, :assets, Rails.env)
|
23
|
+
end
|
24
|
+
|
25
|
+
module TrustyCms
|
26
|
+
class Application < Rails::Application
|
27
|
+
include TrustyCms::Initializer
|
28
|
+
|
29
|
+
config.autoload_paths += %W(#{TRUSTY_CMS_ROOT}/lib)
|
30
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
31
|
+
config.autoload_paths += %W(#{config.root}/app/helpers)
|
32
|
+
|
33
|
+
Sass.load_paths << Compass::Frameworks['compass'].stylesheets_directory
|
34
|
+
|
35
|
+
# Initialize extension paths
|
36
|
+
config.initialize_extension_paths
|
37
|
+
extension_loader = ExtensionLoader.instance {|l| l.initializer = self }
|
38
|
+
extension_loader.paths(:load).reverse_each do |path, value|
|
39
|
+
config.autoload_paths.unshift path
|
40
|
+
$LOAD_PATH.unshift path
|
41
|
+
end
|
42
|
+
# config.add_plugin_paths(extension_loader.paths(:plugin))
|
43
|
+
# TODO: Come back and look at this.
|
44
|
+
radiant_locale_paths = Dir[File.join(TRUSTY_CMS_ROOT, 'config', 'locales', '*.{rb,yml}')]
|
45
|
+
config.i18n.load_path = radiant_locale_paths + extension_loader.paths(:locale)
|
46
|
+
|
47
|
+
config.encoding = 'utf-8'
|
48
|
+
# Skip frameworks you're not going to use (only works if using vendor/rails).
|
49
|
+
# To use Rails without a database, you must remove the Active Record framework
|
50
|
+
# config.frameworks -= [ :action_mailer ]
|
51
|
+
|
52
|
+
# Only load the extensions named here, in the order given. By default all
|
53
|
+
# extensions in vendor/extensions are loaded, in alphabetical order. :all
|
54
|
+
# can be used as a placeholder for all extensions not explicitly named.
|
55
|
+
|
56
|
+
# An example of how to add extensions:
|
57
|
+
# config.extensions = [ :snippets, :clipped, :layouts, :reorder, :multi_site, :rad_social]
|
58
|
+
|
59
|
+
config.extensions = []
|
60
|
+
config.extensions_migration_order = []
|
61
|
+
|
62
|
+
# By default, only English translations are loaded. Remove any of these from
|
63
|
+
# the list below if you'd like to provide any of the additional options
|
64
|
+
# config.ignore_extensions []
|
65
|
+
|
66
|
+
# Your secret key for verifying cookie session data integrity.
|
67
|
+
# If you change this key, all old sessions will become invalid!
|
68
|
+
# Make sure the secret is at least 30 characters and all random,
|
69
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
70
|
+
|
71
|
+
# Comment out this line if you want to turn off all caching, or
|
72
|
+
# add options to modify the behavior. In the majority of deployment
|
73
|
+
# scenarios it is desirable to leave TrustyCms's cache enabled and in
|
74
|
+
# the default configuration.
|
75
|
+
#
|
76
|
+
# Additional options:
|
77
|
+
# :use_x_sendfile => true
|
78
|
+
# Turns on X-Sendfile support for Apache with mod_xsendfile or lighttpd.
|
79
|
+
# :use_x_accel_redirect => '/some/virtual/path'
|
80
|
+
# Turns on X-Accel-Redirect support for nginx. You have to provide
|
81
|
+
# a path that corresponds to a virtual location in your webserver
|
82
|
+
# configuration.
|
83
|
+
# :entitystore => "radiant:tmp/cache/entity"
|
84
|
+
# Sets the entity store type (preceding the colon) and storage
|
85
|
+
# location (following the colon, relative to Rails.root).
|
86
|
+
# We recommend you use radiant: since this will enable manual expiration.
|
87
|
+
# :metastore => "radiant:tmp/cache/meta"
|
88
|
+
# Sets the meta store type and storage location. We recommend you use
|
89
|
+
# radiant: since this will enable manual expiration and acceleration headers.
|
90
|
+
|
91
|
+
# TODO: We're not sure this is actually working, but we can't really test this until the app initializes.
|
92
|
+
config.middleware.use Rack::Cache,
|
93
|
+
:private_headers => ['Authorization'],
|
94
|
+
:entitystore => "radiant:tmp/cache/entity",
|
95
|
+
:metastore => "radiant:tmp/cache/meta",
|
96
|
+
:verbose => false,
|
97
|
+
:allow_reload => false,
|
98
|
+
:allow_revalidate => false
|
99
|
+
# TODO: There's got to be a better place for this, but in order for assets to work fornow, we need ConditionalGet
|
100
|
+
# TODO: Workaround from: https://github.com/rtomayko/rack-cache/issues/80
|
101
|
+
config.middleware.insert_before(Rack::ConditionalGet, Rack::Cache)
|
102
|
+
config.assets.enabled = true
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
config.filter_parameters += [:password, :password_confirmation]
|
107
|
+
|
108
|
+
# Use the database for sessions instead of the cookie-based default,
|
109
|
+
# which shouldn't be used to store highly confidential information
|
110
|
+
# (create the session table with 'rake db:sessions:create')
|
111
|
+
# config.action_controller.session_store = :cookie_store DEPRECATED
|
112
|
+
|
113
|
+
# Activate observers that should always be running
|
114
|
+
#config.active_record.observers = :user_action_observer
|
115
|
+
|
116
|
+
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
|
117
|
+
# All files from config/locales/*.rb,yml are added automatically.
|
118
|
+
# config.i18n.load_path << Dir[File.join(Rails.root, 'my', 'locales', '*.{rb,yml}')]
|
119
|
+
# config.i18n.default_locale = :'en'
|
120
|
+
|
121
|
+
# Make Active Record use UTC-base instead of local time
|
122
|
+
config.time_zone = 'UTC'
|
123
|
+
|
124
|
+
# Set the default field error proc
|
125
|
+
config.action_view.field_error_proc = Proc.new do |html, instance|
|
126
|
+
if html !~ /label/
|
127
|
+
%{<span class="error-with-fieldxxxx">#{html} <span class="error">#{[instance.error_message].flatten.first}</span></span>}.html_safe
|
128
|
+
else
|
129
|
+
html
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
config.after_initialize do
|
134
|
+
extension_loader.load_extensions
|
135
|
+
extension_loader.load_extension_initalizers
|
136
|
+
|
137
|
+
#Dir["#{TRUSTY_CMS_ROOT}/config/initializers/**/*.rb"].sort.each do |initializer|
|
138
|
+
# load(initializer)
|
139
|
+
#end
|
140
|
+
|
141
|
+
extension_loader.activate_extensions # also calls initialize_views
|
142
|
+
#config.add_controller_paths(extension_loader.paths(:controller))
|
143
|
+
#config.add_eager_load_paths(extension_loader.paths(:eager_load))
|
144
|
+
|
145
|
+
# Add new inflection rules using the following format:
|
146
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
147
|
+
inflect.uncountable 'config'
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|