trusty-cms 2.0.9.pre.beta → 2.0.10.pre.beta
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/Gemfile +5 -1
- data/Gemfile.lock +30 -12
- data/Rakefile +24 -4
- data/app/assets/javascripts/admin/page-edit.js +3 -3
- data/app/assets/javascripts/admin/tabcontrol.js.erb +14 -14
- data/app/assets/javascripts/admin/treetable.js +4 -2
- data/app/assets/stylesheets/admin/_base.scss +3 -3
- 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 +59 -17
- 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/helpers/admin/node_helper.rb +4 -4
- data/app/models/trusty_cms/config.rb +1 -0
- data/app/views/admin/pages/edit.html.haml +1 -1
- data/app/views/admin/pages/remove.html.haml +1 -1
- data/app/views/admin/preferences/edit.html.haml +35 -35
- data/app/views/admin/users/_password_fields.html.haml +1 -1
- data/config/application.rb +2 -1
- data/config/boot.rb +0 -1
- data/config/environments/development.rb +1 -0
- data/config/environments/test.rb +2 -4
- data/config/routes.rb +1 -0
- data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -1
- data/lib/tasks/database.rake +1 -3
- data/lib/trusty_cms.rb +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 +151 -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 +0 -1
- data/spec/helpers/regions_helper_spec.rb +1 -1
- data/spec/rails_helper.rb +3 -4
- data/spec/spec_helper.rb +13 -77
- data/trusty_cms.gemspec +2 -1
- metadata +157 -76
@@ -54,22 +54,11 @@ div.popup {
|
|
54
54
|
}
|
55
55
|
.buttons {
|
56
56
|
border-top: 1px solid #e5e5e5;
|
57
|
-
background: whitesmoke;
|
58
|
-
font-size: 85%;
|
59
|
-
margin: 1.5em -20px -10px;
|
60
|
-
padding: 10px;
|
61
57
|
text-align: right;
|
62
58
|
input.button {
|
63
59
|
font-size: 120%;
|
64
60
|
}
|
65
61
|
button {
|
66
|
-
font-size: 110%;
|
67
|
-
padding: 4px 15px 5px;
|
68
|
-
background: whitesmoke;
|
69
|
-
border: 1px solid #959595;
|
70
|
-
@include border-radius(100px);
|
71
|
-
@include single-box-shadow(white, 0, 2px, 0, inset);
|
72
|
-
@include linear-gradient(color-stops(#dddddd 0%, #eeeeee 15%, white 100%));
|
73
62
|
&.default {
|
74
63
|
border: 1px solid #154ca6;
|
75
64
|
@include single-box-shadow(#c7e0f6, 0, 2px, 1px, inset);
|
@@ -6,8 +6,8 @@
|
|
6
6
|
width: 100%;
|
7
7
|
margin-right: -4px;
|
8
8
|
.tab {
|
9
|
-
background-color: #
|
10
|
-
color:
|
9
|
+
background-color: #e4e4e4;
|
10
|
+
color: black;
|
11
11
|
display: inline-block;
|
12
12
|
font-size: 90%;
|
13
13
|
text-align: left;
|
@@ -18,11 +18,11 @@
|
|
18
18
|
@include border-top-radius(6px);
|
19
19
|
&.here {
|
20
20
|
background-color: white;
|
21
|
-
color:
|
21
|
+
color: #737272;
|
22
22
|
font-weight: bold;
|
23
23
|
}
|
24
24
|
span:hover {
|
25
|
-
color:
|
25
|
+
color: #737272;
|
26
26
|
}
|
27
27
|
.close {
|
28
28
|
margin-top: -4px;
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module Admin::NodeHelper
|
2
2
|
|
3
|
-
def render_nodes(page, starting_index, parent_index = nil)
|
3
|
+
def render_nodes(page, starting_index, parent_index = nil, simple = false)
|
4
4
|
@rendered_html = ""
|
5
|
-
render_node page, starting_index, parent_index
|
5
|
+
render_node page, starting_index, parent_index, simple
|
6
6
|
@rendered_html
|
7
7
|
end
|
8
8
|
|
9
|
-
def render_node(page, index, parent_index = nil)
|
9
|
+
def render_node(page, index, parent_index = nil, simple = false)
|
10
10
|
|
11
11
|
@current_node = prepare_page(page)
|
12
12
|
|
13
13
|
@rendered_html += (render :partial => 'admin/pages/node',
|
14
14
|
:locals => {level: index, index: index, parent_index: parent_index,
|
15
|
-
page: page, simple:
|
15
|
+
page: page, simple: simple, branch: (page.children.count > 0) })
|
16
16
|
index
|
17
17
|
end
|
18
18
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
- render_region :main do |main|
|
4
4
|
- main.edit_header do
|
5
|
-
%h1=
|
5
|
+
%h1= ''
|
6
6
|
- main.edit_form do
|
7
7
|
= form_for @page, :as => :page, :url => admin_page_path(@page), :html => {:method => :put, :multipart => true, :id => 'edit_page', 'data-onsubmit_status'=>t('saving_changes')} do |fields|
|
8
8
|
= render :partial => "fields", :object => fields
|
@@ -9,7 +9,7 @@
|
|
9
9
|
.inset
|
10
10
|
%table.index#site_map
|
11
11
|
%tbody
|
12
|
-
- render_nodes @page, @page.id
|
12
|
+
- render_nodes @page, @page.id, nil, true
|
13
13
|
= @rendered_html.html_safe
|
14
14
|
|
15
15
|
= form_for [:admin, @page.becomes(Page)], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing pages…"} do
|
@@ -7,38 +7,38 @@
|
|
7
7
|
|
8
8
|
- main.edit_form do
|
9
9
|
= form_for @user, :url => admin_preferences_url, :html => { :method => :put, 'data-onsubmit_status' => "#{t('saving_preferences')}…" } do |f|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
10
|
+
%fieldset
|
11
|
+
= render :partial => 'admin/users/avatar'
|
12
|
+
|
13
|
+
= render_region :form_top, :locals => {:f => f}
|
14
|
+
|
15
|
+
- render_region :form, :locals => {:f => f} do |form|
|
16
|
+
- form.edit_name do
|
17
|
+
%p
|
18
|
+
= f.label :name, t("name")
|
19
|
+
= f.text_field :name, :class => "textbox", :size => 32, :maxlength => 100
|
20
|
+
|
21
|
+
- form.edit_email do
|
22
|
+
%p
|
23
|
+
= f.label :email, t("email_address"), :class => "optional"
|
24
|
+
= f.text_field "email", :class => 'textbox', :size => 32, :maxlength => 255
|
25
|
+
|
26
|
+
- form.edit_username do
|
27
|
+
%p
|
28
|
+
= f.label :login, t("username")
|
29
|
+
= f.text_field "login", :class => "textbox", :size => 32, :maxlength => 40, :required => true
|
30
|
+
|
31
|
+
- form.edit_password do
|
32
|
+
= render "admin/users/password_fields", :f => f
|
33
|
+
|
34
|
+
- form.edit_locale do
|
35
|
+
%p
|
36
|
+
= f.label :locale, t('language')
|
37
|
+
= f.select "locale", available_locales_select
|
38
|
+
|
39
|
+
- render_region :form_bottom, :locals => {:f => f} do |form_bottom|
|
40
|
+
- form_bottom.edit_buttons do
|
41
|
+
.buttons
|
42
|
+
= save_model_button @user
|
43
|
+
= t('or')
|
44
|
+
= link_to t('cancel'), admin_url, {:class => "warning"}
|
@@ -13,6 +13,6 @@
|
|
13
13
|
- unless @user.new_record?
|
14
14
|
%span
|
15
15
|
= t('or')
|
16
|
-
%a{:href=>"#", :onclick=>" $('#display_password').show(); $('#change_password').hide()"}= t('cancel')
|
16
|
+
%a{:href=>"#", :class=>"warning", :onclick=>" $('#display_password').show(); $('#change_password').hide()"}= t('cancel')
|
17
17
|
|
18
18
|
|
data/config/application.rb
CHANGED
@@ -8,6 +8,8 @@ require 'trusty_cms/extension_loader'
|
|
8
8
|
require 'trusty_cms/initializer'
|
9
9
|
require 'compass'
|
10
10
|
require 'rack/cache'
|
11
|
+
require 'trustygems'
|
12
|
+
|
11
13
|
|
12
14
|
if defined?(Bundler)
|
13
15
|
# If you precompile assets before deploying to production, use this line
|
@@ -117,7 +119,6 @@ module TrustyCms
|
|
117
119
|
html
|
118
120
|
end
|
119
121
|
end
|
120
|
-
|
121
122
|
config.after_initialize do
|
122
123
|
extension_loader.load_extensions
|
123
124
|
extension_loader.load_extension_initalizers
|
data/config/boot.rb
CHANGED
@@ -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
|
data/config/routes.rb
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
load File.join(TRUSTY_CMS_ROOT, "config", "routes.rb")
|
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/trusty_cms.rb
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,151 @@
|
|
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
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
20
|
+
# If you want your assets lazily compiled in production, use this line
|
21
|
+
# Bundler.require(:default, :assets, Rails.env)
|
22
|
+
end
|
23
|
+
|
24
|
+
module TrustyCms
|
25
|
+
class Application < Rails::Application
|
26
|
+
include TrustyCms::Initializer
|
27
|
+
|
28
|
+
config.autoload_paths += %W(#{TRUSTY_CMS_ROOT}/lib)
|
29
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
30
|
+
config.autoload_paths += %W(#{config.root}/app/helpers)
|
31
|
+
|
32
|
+
Sass.load_paths << Compass::Frameworks['compass'].stylesheets_directory
|
33
|
+
|
34
|
+
# Initialize extension paths
|
35
|
+
config.initialize_extension_paths
|
36
|
+
extension_loader = ExtensionLoader.instance {|l| l.initializer = self }
|
37
|
+
extension_loader.paths(:load).reverse_each do |path, value|
|
38
|
+
config.autoload_paths.unshift path
|
39
|
+
$LOAD_PATH.unshift path
|
40
|
+
end
|
41
|
+
# config.add_plugin_paths(extension_loader.paths(:plugin))
|
42
|
+
# TODO: Come back and look at this.
|
43
|
+
radiant_locale_paths = Dir[File.join(TRUSTY_CMS_ROOT, 'config', 'locales', '*.{rb,yml}')]
|
44
|
+
config.i18n.load_path = radiant_locale_paths + extension_loader.paths(:locale)
|
45
|
+
|
46
|
+
config.encoding = 'utf-8'
|
47
|
+
# Skip frameworks you're not going to use (only works if using vendor/rails).
|
48
|
+
# To use Rails without a database, you must remove the Active Record framework
|
49
|
+
# config.frameworks -= [ :action_mailer ]
|
50
|
+
|
51
|
+
# Only load the extensions named here, in the order given. By default all
|
52
|
+
# extensions in vendor/extensions are loaded, in alphabetical order. :all
|
53
|
+
# can be used as a placeholder for all extensions not explicitly named.
|
54
|
+
|
55
|
+
# An example of how to add extensions:
|
56
|
+
# config.extensions = [ :snippets, :clipped, :layouts, :reorder, :multi_site, :rad_social]
|
57
|
+
|
58
|
+
config.extensions = []
|
59
|
+
config.extensions_migration_order = []
|
60
|
+
|
61
|
+
# By default, only English translations are loaded. Remove any of these from
|
62
|
+
# the list below if you'd like to provide any of the additional options
|
63
|
+
# config.ignore_extensions []
|
64
|
+
|
65
|
+
# Your secret key for verifying cookie session data integrity.
|
66
|
+
# If you change this key, all old sessions will become invalid!
|
67
|
+
# Make sure the secret is at least 30 characters and all random,
|
68
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
69
|
+
|
70
|
+
# Comment out this line if you want to turn off all caching, or
|
71
|
+
# add options to modify the behavior. In the majority of deployment
|
72
|
+
# scenarios it is desirable to leave TrustyCms's cache enabled and in
|
73
|
+
# the default configuration.
|
74
|
+
#
|
75
|
+
# Additional options:
|
76
|
+
# :use_x_sendfile => true
|
77
|
+
# Turns on X-Sendfile support for Apache with mod_xsendfile or lighttpd.
|
78
|
+
# :use_x_accel_redirect => '/some/virtual/path'
|
79
|
+
# Turns on X-Accel-Redirect support for nginx. You have to provide
|
80
|
+
# a path that corresponds to a virtual location in your webserver
|
81
|
+
# configuration.
|
82
|
+
# :entitystore => "radiant:tmp/cache/entity"
|
83
|
+
# Sets the entity store type (preceding the colon) and storage
|
84
|
+
# location (following the colon, relative to Rails.root).
|
85
|
+
# We recommend you use radiant: since this will enable manual expiration.
|
86
|
+
# :metastore => "radiant:tmp/cache/meta"
|
87
|
+
# Sets the meta store type and storage location. We recommend you use
|
88
|
+
# radiant: since this will enable manual expiration and acceleration headers.
|
89
|
+
|
90
|
+
# TODO: We're not sure this is actually working, but we can't really test this until the app initializes.
|
91
|
+
config.middleware.use Rack::Cache,
|
92
|
+
:private_headers => ['Authorization'],
|
93
|
+
:entitystore => "radiant:tmp/cache/entity",
|
94
|
+
:metastore => "radiant:tmp/cache/meta",
|
95
|
+
:verbose => false,
|
96
|
+
:allow_reload => false,
|
97
|
+
:allow_revalidate => false
|
98
|
+
# TODO: There's got to be a better place for this, but in order for assets to work fornow, we need ConditionalGet
|
99
|
+
# TODO: Workaround from: https://github.com/rtomayko/rack-cache/issues/80
|
100
|
+
config.middleware.insert_before(Rack::ConditionalGet, Rack::Cache)
|
101
|
+
config.assets.enabled = true
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
config.filter_parameters += [:password, :password_confirmation]
|
106
|
+
|
107
|
+
# Use the database for sessions instead of the cookie-based default,
|
108
|
+
# which shouldn't be used to store highly confidential information
|
109
|
+
# (create the session table with 'rake db:sessions:create')
|
110
|
+
# config.action_controller.session_store = :cookie_store DEPRECATED
|
111
|
+
|
112
|
+
# Activate observers that should always be running
|
113
|
+
#config.active_record.observers = :user_action_observer
|
114
|
+
|
115
|
+
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
|
116
|
+
# All files from config/locales/*.rb,yml are added automatically.
|
117
|
+
# config.i18n.load_path << Dir[File.join(Rails.root, 'my', 'locales', '*.{rb,yml}')]
|
118
|
+
# config.i18n.default_locale = :'en'
|
119
|
+
|
120
|
+
# Make Active Record use UTC-base instead of local time
|
121
|
+
config.time_zone = 'UTC'
|
122
|
+
|
123
|
+
# Set the default field error proc
|
124
|
+
config.action_view.field_error_proc = Proc.new do |html, instance|
|
125
|
+
if html !~ /label/
|
126
|
+
%{<span class="error-with-fieldxxxx">#{html} <span class="error">#{[instance.error_message].flatten.first}</span></span>}.html_safe
|
127
|
+
else
|
128
|
+
html
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
config.after_initialize do
|
133
|
+
extension_loader.load_extensions
|
134
|
+
extension_loader.load_extension_initalizers
|
135
|
+
|
136
|
+
#Dir["#{TRUSTY_CMS_ROOT}/config/initializers/**/*.rb"].sort.each do |initializer|
|
137
|
+
# load(initializer)
|
138
|
+
#end
|
139
|
+
|
140
|
+
extension_loader.activate_extensions # also calls initialize_views
|
141
|
+
#config.add_controller_paths(extension_loader.paths(:controller))
|
142
|
+
#config.add_eager_load_paths(extension_loader.paths(:eager_load))
|
143
|
+
|
144
|
+
# Add new inflection rules using the following format:
|
145
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
146
|
+
inflect.uncountable 'config'
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|