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
@@ -1,57 +0,0 @@
|
|
1
|
-
class MergeBehaviorsAndPages < ActiveRecord::Migration
|
2
|
-
class OldPage < ActiveRecord::Base
|
3
|
-
set_table_name 'pages'
|
4
|
-
end
|
5
|
-
|
6
|
-
@@page_map = {
|
7
|
-
"Page Missing" => "FileNotFoundPage"
|
8
|
-
}
|
9
|
-
|
10
|
-
@@behavior_map = @@page_map.invert
|
11
|
-
|
12
|
-
def self.up
|
13
|
-
announce "converting behavior names to class names"
|
14
|
-
OldPage.find(:all).each do |page|
|
15
|
-
unless page.behavior_id.blank?
|
16
|
-
page.behavior_id = page_name(page.behavior_id)
|
17
|
-
page.save!
|
18
|
-
end
|
19
|
-
end
|
20
|
-
rename_column :pages, :behavior_id, :type
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.down
|
24
|
-
rename_column :pages, :type, :behavior_id
|
25
|
-
OldPage.reset_column_information
|
26
|
-
announce "converting class names back to behavior names"
|
27
|
-
OldPage.find(:all).each do |page|
|
28
|
-
unless page.behavior_id.blank?
|
29
|
-
page.behavior_id = behavior_name(page.behavior_id)
|
30
|
-
page.save!
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.page_name(behavior_name)
|
36
|
-
if @@page_map.has_key?(behavior_name)
|
37
|
-
@@page_map[behavior_name]
|
38
|
-
else
|
39
|
-
name = behavior_name.scan(/\w+/).map { |word| word.capitalize }.join
|
40
|
-
name = $1 if name =~ /^(.*?)Behavior$/
|
41
|
-
name += "Page" unless name =~ /Page$/
|
42
|
-
name
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.behavior_name(page_name)
|
47
|
-
if @@behavior_map.has_key?(page_name)
|
48
|
-
@@behavior_map[page_name]
|
49
|
-
else
|
50
|
-
name = page_name.gsub(/(^.|[A-Z])/, ' \1').strip
|
51
|
-
name = $1 if name =~ /^(.*)Page$/
|
52
|
-
name
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
|
57
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
describe Admin::RegionsHelper do
|
4
|
-
|
5
|
-
describe "#render_region" do
|
6
|
-
|
7
|
-
before :each do
|
8
|
-
allow(controller).to receive(:controller_name).and_return("page")
|
9
|
-
allow(controller).to receive(:template_name).and_return("index")
|
10
|
-
end
|
11
|
-
|
12
|
-
it "outputs html_safe string" do
|
13
|
-
expect(helper.render_region :foo).to be_html_safe
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|