diff --git a/.ruby-gemset b/.ruby-gemset index d30d91090..8147a3413 100644 --- a/.ruby-gemset +++ b/.ruby-gemset @@ -1 +1 @@ -rails_4.0 +browsercms diff --git a/.travis.yml b/.travis.yml index 8baba4031..aff81decc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby rvm: - - "2.0.0" + - "2.3.0" # - "1.9.2" # uncomment this line if your project needs to run something other than `rake`: # script: bundle exec rspec spec diff --git a/Gemfile b/Gemfile index 095b76b7c..384498625 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'http://rubygems.org' -ruby '2.0.0' +ruby '2.3.0' # Load this project as a gem. gemspec @@ -12,6 +12,11 @@ gem 'bluecloth', :groups=>[:development, :test] # For YARD gem "thin" # To avoid annoying Ruby 1.9.3/Rails/Webrick warnings - See http://stackoverflow.com/questions/7082364/what-does-warn-could-not-determine-content-length-of-response-body-mean-and-h +gem 'sass-rails', '~>5.0.0' +gem 'sprockets-rails', '~>2.3.1' + +# Uncomment to confirm that older versions work (for compaitiblity with Spree 2.2.4/bcms_spree) +# gem 'paperclip', '~> 3.4.1' # For testing behavior in production group :production do gem 'uglifier' @@ -19,19 +24,23 @@ end group :development do gem 'rake' - gem 'debugger' - gem 'quiet_assets' + # gem 'debugger' + gem 'better_errors' + gem 'binding_of_caller' + gem 'pry' end group :test, :development do gem 'minitest' + gem "test-unit", "~> 3.0" gem 'minitest-rails' - gem 'minitest-reporters' + gem 'minitest-reporters', '~>1.0.0' + gem 'rails-controller-testing' end group :test do gem 'poltergeist' gem 'm', '~> 1.2' - + gem 'single_test' gem 'factory_girl_rails', '3.3.0' gem "mocha", :require=>false gem "sqlite3-ruby", :require => "sqlite3" @@ -39,7 +48,7 @@ group :test do # Cucumber and dependencies gem 'capybara' gem 'database_cleaner' - gem 'cucumber-rails', :require=> false + gem 'cucumber-rails', '~> 1.4.1', :require=> false gem 'cucumber' gem 'launchy' gem 'ruby-prof' diff --git a/Gemfile.lock b/Gemfile.lock index 74b784332..3cd603ed3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,20 +1,20 @@ PATH remote: . specs: - browsercms (4.0.0.beta) + browsercms (5.0.2.rc1) actionpack-page_caching (~> 1.0) ancestry (~> 2.0.0) bootstrap-sass - ckeditor_rails (~> 4.3.0) - compass-rails (~> 1.1.3) - devise (~> 3.0) - jquery-rails (~> 3.1) + ckeditor_rails + compass-rails (~> 3.0.0) + devise (~> 4.2.0) + jquery-rails (~> 4.1.1) jquery-ui-rails (~> 4.1) panoramic - paperclip (~> 3.5.1) - rails (~> 4.0.0) + paperclip (~> 3.4) + rails (~> 5.0.2) sass-rails - simple_form (>= 3.0.0.rc, < 3.1) + simple_form (~> 3.3.0) term-ansicolor underscore-rails (~> 1.4) will_paginate (~> 3.0.0) @@ -22,255 +22,332 @@ PATH GEM remote: http://rubygems.org/ specs: - actionmailer (4.0.2) - actionpack (= 4.0.2) - mail (~> 2.5.4) - actionpack (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) + actioncable (5.0.2) + actionpack (= 5.0.2) + nio4r (>= 1.2, < 3.0) + websocket-driver (~> 0.6.1) + actionmailer (5.0.2) + actionpack (= 5.0.2) + actionview (= 5.0.2) + activejob (= 5.0.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.0.2) + actionview (= 5.0.2) + activesupport (= 5.0.2) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionpack-page_caching (1.1.0) + actionpack (>= 4.0.0, < 6) + actionview (5.0.2) + activesupport (= 5.0.2) + builder (~> 3.1) erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - actionpack-page_caching (1.0.2) - actionpack (>= 4.0.0, < 5) - activemodel (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - activerecord (4.0.2) - activemodel (= 4.0.2) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.2) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.2) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - addressable (2.3.5) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.0.2) + activesupport (= 5.0.2) + globalid (>= 0.3.6) + activemodel (5.0.2) + activesupport (= 5.0.2) + activerecord (5.0.2) + activemodel (= 5.0.2) + activesupport (= 5.0.2) + arel (~> 7.0) + activesupport (5.0.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.5.0) + public_suffix (~> 2.0, >= 2.0.2) ancestry (2.0.0) activerecord (>= 3.0.0) - ansi (1.4.3) - arel (4.0.2) - aruba (0.5.3) - childprocess (>= 0.3.6) - cucumber (>= 1.1.1) - rspec-expectations (>= 2.7.0) - atomic (1.1.14) - bcrypt-ruby (3.1.2) + ansi (1.5.0) + arel (7.1.4) + aruba (0.14.2) + childprocess (~> 0.5.6) + contracts (~> 0.9) + cucumber (>= 1.3.19) + ffi (~> 1.9.10) + rspec-expectations (>= 2.99) + thor (~> 0.19) + autoprefixer-rails (6.7.7.1) + execjs + bcrypt (3.1.11) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) bluecloth (2.2.0) - bootstrap-sass (3.1.0.2) - sass (~> 3.2) - builder (3.1.4) - capybara (2.1.0) + bootstrap-sass (3.3.7) + autoprefixer-rails (>= 5.2.1) + sass (>= 3.3.4) + builder (3.2.3) + capybara (2.13.0) + addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - childprocess (0.3.9) + childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) - chunky_png (1.3.0) - ckeditor_rails (4.3.1) + chunky_png (1.3.8) + ckeditor_rails (4.6.2) railties (>= 3.0) - climate_control (0.0.3) - activesupport (>= 3.0) - cocaine (0.5.3) + climate_control (0.1.0) + cliver (0.3.2) + cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) - columnize (0.3.6) - compass (0.12.2) + coderay (1.1.1) + compass (1.0.3) chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.1) - compass-rails (1.1.3) - compass (>= 0.12.2) - cucumber (1.3.6) + compass-core (~> 1.0.2) + compass-import-once (~> 1.0.5) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + sass (>= 3.3.13, < 3.5) + compass-core (1.0.3) + multi_json (~> 1.0) + sass (>= 3.3.0, < 3.5) + compass-import-once (1.0.5) + sass (>= 3.2, < 3.5) + compass-rails (3.0.2) + compass (~> 1.0.0) + sass-rails (< 5.1) + sprockets (< 4.0) + concurrent-ruby (1.0.5) + contracts (0.15.0) + cucumber (2.4.0) builder (>= 2.1.2) + cucumber-core (~> 1.5.0) + cucumber-wire (~> 0.0.1) diff-lcs (>= 1.1.3) - gherkin (~> 2.12.0) - multi_json (~> 1.7.5) - multi_test (>= 0.0.2) - cucumber-rails (1.3.0) - capybara (>= 1.1.2) - cucumber (>= 1.1.8) - nokogiri (>= 1.5.0) - daemons (1.1.9) - database_cleaner (1.2.0) - debugger (1.6.2) - columnize (>= 0.3.1) - debugger-linecache (~> 1.2.0) - debugger-ruby_core_source (~> 1.2.3) - debugger-linecache (1.2.0) - debugger-ruby_core_source (1.2.3) - devise (3.2.2) - bcrypt-ruby (~> 3.0) + gherkin (~> 4.0) + multi_json (>= 1.7.5, < 2.0) + multi_test (>= 0.1.2) + cucumber-core (1.5.0) + gherkin (~> 4.0) + cucumber-rails (1.4.5) + capybara (>= 1.1.2, < 3) + cucumber (>= 1.3.8, < 4) + mime-types (>= 1.16, < 4) + nokogiri (~> 1.5) + railties (>= 3, < 5.1) + cucumber-wire (0.0.1) + daemons (1.2.4) + database_cleaner (1.5.3) + debug_inspector (0.0.2) + devise (4.2.1) + bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 3.2.6, < 5) - thread_safe (~> 0.1) + railties (>= 4.1.0, < 5.1) + responders warden (~> 1.2.3) - diff-lcs (1.2.4) + diff-lcs (1.3) erubis (2.7.0) - eventmachine (1.0.3) - execjs (1.4.0) - multi_json (~> 1.0) + eventmachine (1.2.3) + execjs (2.7.0) factory_girl (3.3.0) activesupport (>= 3.0.0) factory_girl_rails (3.3.0) factory_girl (~> 3.3.0) railties (>= 3.0.0) - faye-websocket (0.4.7) - eventmachine (>= 0.12.0) - ffi (1.9.0) - fssm (0.2.10) - gherkin (2.12.1) - multi_json (~> 1.3) - hashie (2.0.5) - hike (1.2.3) - http_parser.rb (0.5.3) - i18n (0.6.9) - jquery-rails (3.1.0) - railties (>= 3.0, < 5.0) + ffi (1.9.18) + gherkin (4.1.1) + globalid (0.3.7) + activesupport (>= 4.1.0) + i18n (0.8.1) + jquery-rails (4.1.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (4.1.1) - railties (>= 3.1.0) - launchy (2.3.0) + jquery-ui-rails (4.2.1) + railties (>= 3.2.16) + launchy (2.4.3) addressable (~> 2.3) - m (1.3.2) + loofah (2.0.3) + nokogiri (>= 1.5.9) + m (1.5.0) method_source (>= 0.6.7) rake (>= 0.9.2.2) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - metaclass (0.0.1) + mail (2.6.4) + mime-types (>= 1.16, < 4) + metaclass (0.0.4) method_source (0.8.2) - mime-types (1.25.1) - mini_portile (0.5.1) - minitest (4.7.5) - minitest-rails (0.9.2) - minitest (~> 4.7) - rails (>= 3.0) - minitest-reporters (0.14.20) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitest (5.10.1) + minitest-rails (3.0.0) + minitest (~> 5.8) + railties (~> 5.0) + minitest-reporters (1.0.20) ansi builder - minitest (>= 2.12, < 5.0) - powerbar - mocha (0.14.0) + minitest (>= 5.0) + ruby-progressbar + mocha (1.2.1) metaclass (~> 0.0.1) - multi_json (1.7.9) - multi_test (0.0.2) - mysql2 (0.3.13) - nokogiri (1.6.0) - mini_portile (~> 0.5.0) + multi_json (1.12.1) + multi_test (0.1.2) + mysql2 (0.4.5) + nio4r (2.0.0) + nokogiri (1.7.1) + mini_portile2 (~> 2.1.0) orm_adapter (0.5.0) - panoramic (0.0.4) + panoramic (0.0.6) rails (>= 3.0.7) paperclip (3.5.4) activemodel (>= 3.0.0) activesupport (>= 3.0.0) cocaine (~> 0.5.3) mime-types - poltergeist (1.3.0) - capybara (~> 2.1.0) - faye-websocket (>= 0.4.4, < 0.5.0) - http_parser.rb (~> 0.5.3) - polyglot (0.3.3) - powerbar (1.0.11) - ansi (~> 1.4.0) - hashie (>= 1.1.0) - quiet_assets (1.0.2) - railties (>= 3.1, < 5.0) - rack (1.5.2) - rack-test (0.6.2) + poltergeist (1.14.0) + capybara (~> 2.1) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + power_assert (1.0.1) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + public_suffix (2.0.5) + rack (2.0.1) + rack-test (0.6.3) rack (>= 1.0) - rails (4.0.2) - actionmailer (= 4.0.2) - actionpack (= 4.0.2) - activerecord (= 4.0.2) - activesupport (= 4.0.2) + rails (5.0.2) + actioncable (= 5.0.2) + actionmailer (= 5.0.2) + actionpack (= 5.0.2) + actionview (= 5.0.2) + activejob (= 5.0.2) + activemodel (= 5.0.2) + activerecord (= 5.0.2) + activesupport (= 5.0.2) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.2) - sprockets-rails (~> 2.0.0) - railties (4.0.2) - actionpack (= 4.0.2) - activesupport (= 4.0.2) + railties (= 5.0.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.1) + actionpack (~> 5.x) + actionview (~> 5.x) + activesupport (~> 5.x) + rails-dom-testing (2.0.2) + activesupport (>= 4.2.0, < 6.0) + nokogiri (~> 1.6) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.0.2) + actionpack (= 5.0.2) + activesupport (= 5.0.2) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.1.1) - rspec-expectations (2.14.1) - diff-lcs (>= 1.1.3, < 2.0) - ruby-prof (0.13.0) - sass (3.2.14) - sass-rails (4.0.1) - railties (>= 4.0.0, < 5.0) - sass (>= 3.1.10) - sprockets-rails (~> 2.0.0) - simple_form (3.0.1) - actionpack (>= 4.0.0, < 4.1) - activemodel (>= 4.0.0, < 4.1) - sprockets (2.10.1) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) + rake (12.0.0) + rb-fsevent (0.9.8) + rb-inotify (0.9.8) + ffi (>= 0.5.0) + responders (2.3.0) + railties (>= 4.2.0, < 5.1) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-prof (0.16.2) + ruby-progressbar (1.8.1) + sass (3.4.23) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + simple_form (3.3.1) + actionpack (> 4, < 5.1) + activemodel (> 4, < 5.1) + single_test (0.6.0) + rake + slop (3.6.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (2.3.3) actionpack (>= 3.0) activesupport (>= 3.0) - sprockets (~> 2.8) - sqlite3 (1.3.7) + sprockets (>= 2.8, < 4.0) + sqlite3 (1.3.13) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) - term-ansicolor (1.3.0) + term-ansicolor (1.5.0) tins (~> 1.0) - thin (1.5.1) - daemons (>= 1.0.9) - eventmachine (>= 0.12.6) - rack (>= 1.0.0) - thor (0.18.1) - thread_safe (0.1.3) - atomic - tilt (1.4.1) - tins (1.0.0) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.38) - uglifier (2.1.2) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - underscore-rails (1.5.2) - warden (1.2.3) + test-unit (3.2.3) + power_assert + thin (1.7.0) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (>= 1, < 3) + thor (0.19.4) + thread_safe (0.3.6) + tilt (2.0.7) + tins (1.13.2) + tzinfo (1.2.3) + thread_safe (~> 0.1) + uglifier (3.1.9) + execjs (>= 0.3.0, < 3) + underscore-rails (1.8.3) + warden (1.2.7) rack (>= 1.0) - will_paginate (3.0.5) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + will_paginate (3.0.12) xpath (2.0.0) nokogiri (~> 1.3) - yard (0.8.7) + yard (0.9.8) PLATFORMS ruby DEPENDENCIES aruba + better_errors + binding_of_caller bluecloth browsercms! capybara cucumber - cucumber-rails + cucumber-rails (~> 1.4.1) database_cleaner - debugger factory_girl_rails (= 3.3.0) launchy m (~> 1.2) minitest minitest-rails - minitest-reporters + minitest-reporters (~> 1.0.0) mocha mysql2 poltergeist - quiet_assets + pry + rails-controller-testing rake ruby-prof + sass-rails (~> 5.0.0) + single_test + sprockets-rails (~> 2.3.1) sqlite3-ruby + test-unit (~> 3.0) thin uglifier yard + +RUBY VERSION + ruby 2.3.0p0 + +BUNDLED WITH + 1.14.6 diff --git a/Rakefile b/Rakefile index aa1f21408..687c5c5a4 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ #!/usr/bin/env rake begin + $arel_silence_type_casting_deprecation=true require 'bundler/setup' rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' @@ -19,18 +20,21 @@ load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks require 'rake/testtask' +require 'single_test/tasks' Rake::TestTask.new('units') do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/unit/**/*_test.rb' t.verbose = false + t.warning = false end Rake::TestTask.new('spec') do |t| t.libs << 'lib' t.libs << 'spec' t.pattern = "spec/**/*_spec.rb" + t.warning = false end Rake::TestTask.new('test:functionals' => ['project:ensure_db_exists', 'app:test:prepare']) do |t| @@ -38,7 +42,7 @@ Rake::TestTask.new('test:functionals' => ['project:ensure_db_exists', 'app:test: t.libs << 'test' t.pattern = 'test/functional/**/*_test.rb' t.verbose = false - + t.warning = false end require 'cucumber' @@ -80,7 +84,7 @@ end desc 'Runs all the tests, specs and scenarios.' task :test => ['project:ensure_db_exists', 'app:test:prepare'] do - tests_to_run = ENV['TEST'] ? ["test:single"] : %w(test:units spec test:functionals features) + tests_to_run = %w(test:units spec test:functionals features) run_tests(tests_to_run) end @@ -101,7 +105,7 @@ def run_tests(tests_to_run) end # Build and run against MySQL. -task 'ci:test' => ['project:setup:mysql', 'db:drop', 'db:create:all', 'db:install', 'test'] +task 'ci:test' => [ 'project:setup:mysql', 'db:drop', 'db:create:all', 'db:install', 'test'] task :default => 'ci:test' require 'yard' diff --git a/app/assets/stylesheets/cms/_assets.css.scss b/app/assets/stylesheets/cms/_assets.scss similarity index 100% rename from app/assets/stylesheets/cms/_assets.css.scss rename to app/assets/stylesheets/cms/_assets.scss diff --git a/app/assets/stylesheets/cms/_base.css.scss b/app/assets/stylesheets/cms/_base.scss similarity index 100% rename from app/assets/stylesheets/cms/_base.css.scss rename to app/assets/stylesheets/cms/_base.scss diff --git a/app/assets/stylesheets/cms/_cms-buttons.css.scss b/app/assets/stylesheets/cms/_cms-buttons.scss similarity index 100% rename from app/assets/stylesheets/cms/_cms-buttons.css.scss rename to app/assets/stylesheets/cms/_cms-buttons.scss diff --git a/app/assets/stylesheets/cms/_cms-forms.css.scss b/app/assets/stylesheets/cms/_cms-forms.scss similarity index 100% rename from app/assets/stylesheets/cms/_cms-forms.css.scss rename to app/assets/stylesheets/cms/_cms-forms.scss diff --git a/app/assets/stylesheets/cms/_colors.css.scss b/app/assets/stylesheets/cms/_colors.scss similarity index 100% rename from app/assets/stylesheets/cms/_colors.css.scss rename to app/assets/stylesheets/cms/_colors.scss diff --git a/app/assets/stylesheets/cms/_dashboard.css.scss b/app/assets/stylesheets/cms/_dashboard.scss similarity index 100% rename from app/assets/stylesheets/cms/_dashboard.css.scss rename to app/assets/stylesheets/cms/_dashboard.scss diff --git a/app/assets/stylesheets/cms/_glyph.css.scss b/app/assets/stylesheets/cms/_glyph.scss similarity index 100% rename from app/assets/stylesheets/cms/_glyph.css.scss rename to app/assets/stylesheets/cms/_glyph.scss diff --git a/app/assets/stylesheets/cms/_main-area.css.scss b/app/assets/stylesheets/cms/_main-area.scss similarity index 100% rename from app/assets/stylesheets/cms/_main-area.css.scss rename to app/assets/stylesheets/cms/_main-area.scss diff --git a/app/assets/stylesheets/cms/_nav.css.scss b/app/assets/stylesheets/cms/_nav.scss similarity index 100% rename from app/assets/stylesheets/cms/_nav.css.scss rename to app/assets/stylesheets/cms/_nav.scss diff --git a/app/assets/stylesheets/cms/_sidebar.css.scss b/app/assets/stylesheets/cms/_sidebar.scss similarity index 100% rename from app/assets/stylesheets/cms/_sidebar.css.scss rename to app/assets/stylesheets/cms/_sidebar.scss diff --git a/app/assets/stylesheets/cms/_sitemap.css.scss b/app/assets/stylesheets/cms/_sitemap.scss similarity index 100% rename from app/assets/stylesheets/cms/_sitemap.css.scss rename to app/assets/stylesheets/cms/_sitemap.scss diff --git a/app/assets/stylesheets/cms/_submenu.css.scss b/app/assets/stylesheets/cms/_submenu.scss similarity index 100% rename from app/assets/stylesheets/cms/_submenu.css.scss rename to app/assets/stylesheets/cms/_submenu.scss diff --git a/app/assets/stylesheets/cms/application.css.scss b/app/assets/stylesheets/cms/application.scss similarity index 86% rename from app/assets/stylesheets/cms/application.css.scss rename to app/assets/stylesheets/cms/application.scss index 87150596e..f3e570448 100644 --- a/app/assets/stylesheets/cms/application.css.scss +++ b/app/assets/stylesheets/cms/application.scss @@ -32,6 +32,12 @@ $experimental-support-for-khtml: false; @import 'cms/styles/_glyph'; +/* IMPORTS JQUERY-UI CSS FROM GEM */ +@import "/assets/jquery.ui.core.css"; +@import "/assets/jquery.ui.datepicker.css"; +@import "/assets/jquery.ui.theme.css"; + + /* PAGE STYLE & LAYOUT IMPORTS */ diff --git a/app/assets/stylesheets/cms/core.css.scss b/app/assets/stylesheets/cms/core.scss similarity index 100% rename from app/assets/stylesheets/cms/core.css.scss rename to app/assets/stylesheets/cms/core.scss diff --git a/app/assets/stylesheets/cms/default-forms.css.scss b/app/assets/stylesheets/cms/default-forms.scss similarity index 100% rename from app/assets/stylesheets/cms/default-forms.css.scss rename to app/assets/stylesheets/cms/default-forms.scss diff --git a/app/assets/stylesheets/cms/includes/_animation.css.scss b/app/assets/stylesheets/cms/includes/_animation.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/_animation.css.scss rename to app/assets/stylesheets/cms/includes/_animation.scss diff --git a/app/assets/stylesheets/cms/includes/_rem.css.scss b/app/assets/stylesheets/cms/includes/_rem.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/_rem.css.scss rename to app/assets/stylesheets/cms/includes/_rem.scss diff --git a/app/assets/stylesheets/cms/includes/animation/_animate.css.scss b/app/assets/stylesheets/cms/includes/animation/_animate.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/_animate.css.scss rename to app/assets/stylesheets/cms/includes/animation/_animate.scss diff --git a/app/assets/stylesheets/cms/includes/animation/_core.css.scss b/app/assets/stylesheets/cms/includes/animation/_core.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/_core.css.scss rename to app/assets/stylesheets/cms/includes/animation/_core.scss diff --git a/app/assets/stylesheets/cms/includes/animation/_shared.css.scss b/app/assets/stylesheets/cms/includes/animation/_shared.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/_shared.css.scss rename to app/assets/stylesheets/cms/includes/animation/_shared.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_bouncing.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_bouncing.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_classes.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_classes.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_classes.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_classes.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_fading.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_fading.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_fading.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_fading.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_flippers.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_flippers.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_flippers.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_flippers.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_rotating.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_rotating.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_rotating.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_rotating.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_specials.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_specials.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_specials.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_specials.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.scss diff --git a/app/assets/stylesheets/cms/page_content_editing.css.scss b/app/assets/stylesheets/cms/page_content_editing.scss similarity index 100% rename from app/assets/stylesheets/cms/page_content_editing.css.scss rename to app/assets/stylesheets/cms/page_content_editing.scss diff --git a/app/assets/stylesheets/cms/page_editor.css.scss b/app/assets/stylesheets/cms/page_editor.scss similarity index 100% rename from app/assets/stylesheets/cms/page_editor.css.scss rename to app/assets/stylesheets/cms/page_editor.scss diff --git a/app/assets/stylesheets/cms/style.css.scss b/app/assets/stylesheets/cms/style.scss similarity index 100% rename from app/assets/stylesheets/cms/style.css.scss rename to app/assets/stylesheets/cms/style.scss diff --git a/app/assets/stylesheets/cms/styles/_alerts.css.scss b/app/assets/stylesheets/cms/styles/_alerts.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_alerts.css.scss rename to app/assets/stylesheets/cms/styles/_alerts.scss diff --git a/app/assets/stylesheets/cms/styles/_base-grid.css.scss b/app/assets/stylesheets/cms/styles/_base-grid.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_base-grid.css.scss rename to app/assets/stylesheets/cms/styles/_base-grid.scss diff --git a/app/assets/stylesheets/cms/styles/_buttons.css.scss b/app/assets/stylesheets/cms/styles/_buttons.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_buttons.css.scss rename to app/assets/stylesheets/cms/styles/_buttons.scss diff --git a/app/assets/stylesheets/cms/styles/_dropdown.css.scss b/app/assets/stylesheets/cms/styles/_dropdown.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_dropdown.css.scss rename to app/assets/stylesheets/cms/styles/_dropdown.scss diff --git a/app/assets/stylesheets/cms/styles/_forms.css.scss b/app/assets/stylesheets/cms/styles/_forms.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_forms.css.scss rename to app/assets/stylesheets/cms/styles/_forms.scss diff --git a/app/assets/stylesheets/cms/styles/_glyph.css.scss b/app/assets/stylesheets/cms/styles/_glyph.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_glyph.css.scss rename to app/assets/stylesheets/cms/styles/_glyph.scss diff --git a/app/assets/stylesheets/cms/styles/_images.css.scss b/app/assets/stylesheets/cms/styles/_images.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_images.css.scss rename to app/assets/stylesheets/cms/styles/_images.scss diff --git a/app/assets/stylesheets/cms/styles/_lists.css.scss b/app/assets/stylesheets/cms/styles/_lists.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_lists.css.scss rename to app/assets/stylesheets/cms/styles/_lists.scss diff --git a/app/assets/stylesheets/cms/styles/_modal.css.scss b/app/assets/stylesheets/cms/styles/_modal.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_modal.css.scss rename to app/assets/stylesheets/cms/styles/_modal.scss diff --git a/app/assets/stylesheets/cms/styles/_progress.css.scss b/app/assets/stylesheets/cms/styles/_progress.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_progress.css.scss rename to app/assets/stylesheets/cms/styles/_progress.scss diff --git a/app/assets/stylesheets/cms/styles/_tables.css.scss b/app/assets/stylesheets/cms/styles/_tables.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_tables.css.scss rename to app/assets/stylesheets/cms/styles/_tables.scss diff --git a/app/assets/stylesheets/cms/styles/_text.css.scss b/app/assets/stylesheets/cms/styles/_text.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_text.css.scss rename to app/assets/stylesheets/cms/styles/_text.scss diff --git a/app/controllers/cms/application_controller.rb b/app/controllers/cms/application_controller.rb index 81f445bac..96ed13ddf 100644 --- a/app/controllers/cms/application_controller.rb +++ b/app/controllers/cms/application_controller.rb @@ -1,6 +1,11 @@ module Cms class ApplicationController < ::ApplicationController include Cms::AdminController - + + before_action :no_browser_caching + + def no_browser_caching + expires_now + end end end \ No newline at end of file diff --git a/app/controllers/cms/base_controller.rb b/app/controllers/cms/base_controller.rb index 690eedaa2..103abc2ac 100644 --- a/app/controllers/cms/base_controller.rb +++ b/app/controllers/cms/base_controller.rb @@ -1,9 +1,9 @@ module Cms class BaseController < Cms::ApplicationController - before_filter :redirect_to_cms_site + before_action :redirect_to_cms_site before_action :authenticate_cms_user! - before_filter :cms_access_required + before_action :cms_access_required layout 'cms/application' diff --git a/app/controllers/cms/connectors_controller.rb b/app/controllers/cms/connectors_controller.rb index 140d5dabe..7b8e1f4dd 100644 --- a/app/controllers/cms/connectors_controller.rb +++ b/app/controllers/cms/connectors_controller.rb @@ -1,7 +1,7 @@ module Cms class ConnectorsController < Cms::BaseController - - before_filter :load_page, :only => [:new, :create] + + before_action :load_page, :only => [:new, :create] def new @block_type = ContentType.find_by_key(params[:block_type] || session[:last_block_type] || 'html_block') diff --git a/app/controllers/cms/content_block_controller.rb b/app/controllers/cms/content_block_controller.rb index e88dfa168..4525efb3d 100644 --- a/app/controllers/cms/content_block_controller.rb +++ b/app/controllers/cms/content_block_controller.rb @@ -166,9 +166,8 @@ def resource end # methods for loading one or a collection of blocks - def load_blocks - @search_filter = SearchFilter.build(params[:search_filter], model_class) + @search_filter = SearchFilter.build(search_params, model_class) options = {} @@ -184,11 +183,15 @@ def load_blocks scope = scope.with_parent_id(params[:section_id]) end @total_number_of_items = scope.count - @blocks = scope.paginate(options) + @blocks = scope.paginate(:page=>options[:page]).order(options[:order]) check_permissions end + def search_params + params[:search_filter].permit(:term) if params[:search_filter].present? + end + def load_block find_block check_permissions @@ -269,7 +272,7 @@ def update_block def model_params defaults = {"publish_on_save" => false} model_params = params[model_form_name] - defaults.merge(model_params) + defaults.merge(model_params.to_unsafe_h) end def after_update_on_success diff --git a/app/controllers/cms/content_controller.rb b/app/controllers/cms/content_controller.rb index 58bed6dcb..4d5add839 100644 --- a/app/controllers/cms/content_controller.rb +++ b/app/controllers/cms/content_controller.rb @@ -8,15 +8,15 @@ class ContentController < Cms::ApplicationController include Cms::MobileAware helper MobileHelper - skip_before_filter :redirect_to_cms_site - before_filter :redirect_non_cms_users_to_public_site, :only => [:show, :show_page_route] - before_filter :construct_path, :only => [:show] - before_filter :construct_path_from_route, :only => [:show_page_route] - before_filter :try_to_redirect, :only => [:show] - before_filter :try_to_stream_file, :only => [:show] - before_filter :load_page, :only => [:show, :show_page_route] - before_filter :check_access_to_page, :except => [:edit, :preview] - before_filter :select_cache_directory + #skip_before_filter :redirect_to_cms_site + before_action :redirect_non_cms_users_to_public_site, :only => [:show, :show_page_route] + before_action :construct_path, :only => [:show] + before_action :construct_path_from_route, :only => [:show_page_route] + before_action :try_to_redirect, :only => [:show] + before_action :try_to_stream_file, :only => [:show] + before_action :load_page, :only => [:show, :show_page_route] + before_action :check_access_to_page, :except => [:edit, :preview] + before_action :select_cache_directory self.responder = Cms::ContentResponder @@ -64,12 +64,11 @@ def assign(key, value) end private - def render_editing_frame @page_title = @page.page_title # Adds all provided parameters to the iframe - @edit_page_path = ActionDispatch::Http::URL.url_for(path: edit_content_path(current_page), params: params.except(:controller, :action, :path), only_path: true) + @edit_page_path = edit_content_path(current_page, params.except(:controller, :action, :path).permit! ) render 'editing_frame', :layout => 'cms/page_editor' end diff --git a/app/controllers/cms/dynamic_views_controller.rb b/app/controllers/cms/dynamic_views_controller.rb index 90aab2c69..f91fa648f 100644 --- a/app/controllers/cms/dynamic_views_controller.rb +++ b/app/controllers/cms/dynamic_views_controller.rb @@ -4,7 +4,7 @@ class DynamicViewsController < Cms::BaseController include Cms::AdminTab check_permissions :administrate - before_filter :load_view, :only => [:show, :edit, :update, :destroy] + before_action :load_view, :only => [:show, :edit, :update, :destroy] helper_method :dynamic_view_type diff --git a/app/controllers/cms/form_entries_controller.rb b/app/controllers/cms/form_entries_controller.rb index 795efb03a..757243b66 100644 --- a/app/controllers/cms/form_entries_controller.rb +++ b/app/controllers/cms/form_entries_controller.rb @@ -32,16 +32,36 @@ def submit end end + def bulk_update + # Duplicates ContentBlockController#bulk_update + ids = params[:content_id] || [] + models = ids.collect do |id| + FormEntry.find(id.to_i) + end + + if params[:commit] == 'Delete' + deleted = models.select do |m| + m.destroy + end + flash[:notice] = "Deleted #{deleted.size} records." + end + + redirect_to entries_path(params[:form_id]) + end + # Same behavior as ContentBlockController#index def index - form = Cms::Form.where(id: params[:id]).first - @blocks = Cms::FormEntry.where(form_id: params[:id]).paginate({page: params[:page], order: params[:order]}) - @entry = Cms::FormEntry.for(form) - + @form = Cms::Form.where(id: params[:id]).first + # Allows us to use the content_block/index view - @content_type = FauxContentType.new(form) - @search_filter = SearchFilter.build(params[:search_filter], Cms::FormEntry) + @content_type = FauxContentType.new(@form) + @search_filter = SearchFilter.build(search_params, Cms::FormEntry) + + @blocks = Cms::FormEntry.where(form_id: params[:id]).search(@search_filter.term).paginate({page: params[:page], order: params[:order]}) + @entry = Cms::FormEntry.for(@form) + @total_number_of_items = @blocks.size + end def edit @@ -80,6 +100,10 @@ def save_entry_failure protected + def search_params + params[:search_filter].permit(:term) if params[:search_filter].present? + end + def find_form_and_populate_entry @form = Cms::Form.find(params[:form_id]) @entry = Cms::FormEntry.for(@form) @@ -115,5 +139,6 @@ def columns_for_index def content_type @content_type end + end end \ No newline at end of file diff --git a/app/controllers/cms/forms_controller.rb b/app/controllers/cms/forms_controller.rb index 797be0139..6aaf3af9c 100644 --- a/app/controllers/cms/forms_controller.rb +++ b/app/controllers/cms/forms_controller.rb @@ -1,7 +1,7 @@ class Cms::FormsController < Cms::ContentBlockController - before_filter :associate_form_fields, only: [:create, :update] - before_filter :strip_new_entry_params, only: [:create, :update] + before_action :associate_form_fields, only: [:create, :update] + before_action :strip_new_entry_params, only: [:create, :update] helper do # For new forms, if the user doesn't complete and save them, we need to delete them from the database. diff --git a/app/controllers/cms/links_controller.rb b/app/controllers/cms/links_controller.rb index ea668b59b..5af9177fb 100644 --- a/app/controllers/cms/links_controller.rb +++ b/app/controllers/cms/links_controller.rb @@ -1,9 +1,9 @@ module Cms class LinksController < Cms::BaseController - before_filter :load_section, :only => [:new, :create, :move_to] - before_filter :load_link, :only => [:destroy, :update] - before_filter :load_draft_link, :only => [:edit] + before_action :load_section, :only => [:new, :create, :move_to] + before_action :load_link, :only => [:destroy, :update] + before_action :load_draft_link, :only => [:edit] include Cms::PublishWorkflow diff --git a/app/controllers/cms/page_components_controller.rb b/app/controllers/cms/page_components_controller.rb index ce0a326ce..92759873c 100644 --- a/app/controllers/cms/page_components_controller.rb +++ b/app/controllers/cms/page_components_controller.rb @@ -2,7 +2,6 @@ module Cms class PageComponentsController < Cms::ApplicationController layout false respond_to :json - def new @default_type = Cms::ContentType.default @content_types = Cms::ContentType.other_connectables diff --git a/app/controllers/cms/page_route_options_controller.rb b/app/controllers/cms/page_route_options_controller.rb index 6ff5f9c7e..3b418d9bd 100644 --- a/app/controllers/cms/page_route_options_controller.rb +++ b/app/controllers/cms/page_route_options_controller.rb @@ -1,8 +1,8 @@ module Cms class PageRouteOptionsController < Cms::BaseController - before_filter :load_page_route - before_filter :load_model, :only => [:edit, :update, :destroy] + before_action :load_page_route + before_action :load_model, :only => [:edit, :update, :destroy] def new @model = resource.new diff --git a/app/controllers/cms/page_routes_controller.rb b/app/controllers/cms/page_routes_controller.rb index f394bfdfb..9001387db 100644 --- a/app/controllers/cms/page_routes_controller.rb +++ b/app/controllers/cms/page_routes_controller.rb @@ -1,7 +1,7 @@ module Cms class PageRoutesController < Cms::BaseController - before_filter :load_page_route, :only => [:edit, :update, :destroy] + before_action :load_page_route, :only => [:edit, :update, :destroy] def index @page_routes = PageRoute.paginate(:page => params[:page]).order("name") diff --git a/app/controllers/cms/pages_controller.rb b/app/controllers/cms/pages_controller.rb index 375435096..a053c2716 100644 --- a/app/controllers/cms/pages_controller.rb +++ b/app/controllers/cms/pages_controller.rb @@ -3,10 +3,10 @@ class PagesController < Cms::BaseController helper Cms::RenderingHelper - before_filter :load_section, :only => [:new, :create] - before_filter :load_page, :only => [:versions, :version, :revert_to, :destroy] - before_filter :load_draft_page, :only => [:edit, :update] - before_filter :hide_toolbar, :only => [:new, :create] + before_action :load_section, :only => [:new, :create] + before_action :load_page, :only => [:versions, :version, :revert_to, :destroy] + before_action :load_draft_page, :only => [:edit, :update] + before_action :hide_toolbar, :only => [:new, :create] before_action :strip_visibility_params, :only => [:create, :update] include Cms::PublishWorkflow diff --git a/app/controllers/cms/portlet_controller.rb b/app/controllers/cms/portlet_controller.rb index 150ddc56b..285bd221d 100644 --- a/app/controllers/cms/portlet_controller.rb +++ b/app/controllers/cms/portlet_controller.rb @@ -1,7 +1,7 @@ module Cms class PortletController < Cms::ApplicationController - skip_before_filter :redirect_to_cms_site + skip_before_action :redirect_to_cms_site if self.respond_to?(:redirect_to_cms_site) def execute_handler @portlet = Portlet.find(params[:id]) @@ -16,6 +16,14 @@ def execute_handler end + # Adding this here temporarily to get tests to pass. Makes little sense as this is skipping this method + # but for some reason this method is not defined within the portlet controller. + def redirect_to_cms_site + if using_cms_subdomains? && !request_is_for_cms_subdomain? + redirect_to(url_with_cms_domain_prefix) + end + end + end end diff --git a/app/controllers/cms/sections_controller.rb b/app/controllers/cms/sections_controller.rb index c47d360ba..de1263bc8 100644 --- a/app/controllers/cms/sections_controller.rb +++ b/app/controllers/cms/sections_controller.rb @@ -1,8 +1,8 @@ module Cms class SectionsController < Cms::BaseController - before_filter :load_parent, :only => [:new, :create] - before_filter :load_section, :only => [:edit, :update, :destroy, :move] + before_action :load_parent, :only => [:new, :create] + before_action :load_section, :only => [:edit, :update, :destroy, :move] helper_method :public_groups helper_method :cms_groups @@ -89,7 +89,7 @@ def load_section end def public_groups - @public_groups ||= Cms::Group.public.order("#{Cms::Group.table_name}.name") + @public_groups ||= Cms::Group.public_groups.order("#{Cms::Group.table_name}.name") end def cms_groups diff --git a/app/controllers/cms/sessions_controller.rb b/app/controllers/cms/sessions_controller.rb index 05990530c..f6bd25e73 100644 --- a/app/controllers/cms/sessions_controller.rb +++ b/app/controllers/cms/sessions_controller.rb @@ -2,7 +2,7 @@ module Cms # Handles the login/logout function of the site. class SessionsController < Devise::SessionsController include Cms::AdminController - before_filter :redirect_to_cms_site, :only => [:new] + before_action :redirect_to_cms_site, :only => [:new] layout 'cms/application' diff --git a/app/controllers/cms/tasks_controller.rb b/app/controllers/cms/tasks_controller.rb index ae41a922f..e3068d594 100644 --- a/app/controllers/cms/tasks_controller.rb +++ b/app/controllers/cms/tasks_controller.rb @@ -1,7 +1,7 @@ module Cms class TasksController < Cms::BaseController - before_filter :load_page, :only => [:new, :create] + before_action :load_page, :only => [:new, :create] def new @task = @page.tasks.build(:assigned_by => current_user) diff --git a/app/controllers/cms/users_controller.rb b/app/controllers/cms/users_controller.rb index 80adee0f3..637884ddb 100644 --- a/app/controllers/cms/users_controller.rb +++ b/app/controllers/cms/users_controller.rb @@ -3,26 +3,25 @@ class UsersController < Cms::ResourceController include Cms::AdminTab check_permissions :administrate, :except => [:change_password, :update_password] - before_filter :only_self_or_administrator, :only => [:change_password, :update_password] - after_filter :update_flash, :only => [:update] - + before_action :only_self_or_administrator, :only => [:change_password, :update_password] + after_action :update_flash, :only => [:update] def index @have_external_users = Cms::ExternalUser.count > 0 query, conditions = [], [] - unless params[:show_expired] + if params[:show_expired] != "yes" query << "expires_at IS NULL OR expires_at >= ?" conditions << Time.now.utc end - unless params[:key_word].blank? + if !params[:key_word].blank? query << %w(login email first_name last_name).collect { |f| "lower(#{f}) LIKE lower(?)" }.join(" OR ") 4.times { conditions << "%#{params[:key_word]}%" } end - unless params[:group_id].to_i == 0 + if params[:group_id].present? && params[:group_id] != 0 query << "#{UserGroupMembership.table_name}.group_id = ?" conditions << params[:group_id] end @@ -32,7 +31,11 @@ def index per_page = params[:per_page] || 10 page_num = params[:page] ? params[:page].to_i : 1 - @users = PersistentUser.where(conditions).paginate(page: page_num, per_page: per_page).includes(:user_group_memberships).references(:user_group_memberships).order("first_name, last_name, email") + if conditions.count==1 && conditions.first.blank? + @users = PersistentUser.all.paginate(page: page_num, per_page: per_page).includes(:user_group_memberships).references(:user_group_memberships).order("first_name, last_name, email") + else + @users = PersistentUser.where(conditions).paginate(page: page_num, per_page: per_page).includes(:user_group_memberships).references(:user_group_memberships).order("first_name, last_name, email") + end end def new diff --git a/app/controllers/tests/pretend_controller.rb b/app/controllers/tests/pretend_controller.rb index 4839efad9..3d0c4f2bd 100644 --- a/app/controllers/tests/pretend_controller.rb +++ b/app/controllers/tests/pretend_controller.rb @@ -11,11 +11,11 @@ class Tests::PretendController < ApplicationController RESTRICTED_H1 = "Restricted" def restricted - render :text =>"

#{RESTRICTED_H1}

You can see this restricted page." + render plain: "

#{RESTRICTED_H1}

You can see this restricted page." end def open - render :text =>"

Open Page

You can see this public page." + render plain: "

Open Page

You can see this public page." end def error diff --git a/app/helpers/cms/application_helper.rb b/app/helpers/cms/application_helper.rb index 0bda07298..82c0e9832 100644 --- a/app/helpers/cms/application_helper.rb +++ b/app/helpers/cms/application_helper.rb @@ -171,18 +171,19 @@ def render_pagination(collection, content_type, options={}) if collection.blank? content_tag(:div, "No Content", :class => "pagination") else - model_class = content_type.instance_of?(Class) ? content_type : content_type.model_class + content_type_constant = content_type.name.constantize render :partial => "pagination", :locals => { :collection => collection, - :first_page_path => polymorphic_path(engine_aware_path(model_class), {:page => 1}.merge(options)), - :previous_page_path => polymorphic_path(engine_aware_path(model_class), {:page => collection.previous_page ? collection.previous_page : 1}.merge(options)), - :current_page_path => polymorphic_path(engine_aware_path(model_class), options), - :next_page_path => polymorphic_path(engine_aware_path(model_class), {:page => collection.next_page ? collection.next_page : collection.current_page}.merge(options)), - :last_page_path => polymorphic_path(engine_aware_path(model_class), {:page => collection.total_pages}.merge(options)) + :first_page_path => engine(content_type_constant).polymorphic_path(content_type_constant,{:page => 1}.merge(options)), + :previous_page_path => engine(content_type_constant).polymorphic_path(content_type_constant,{:page => collection.previous_page ? collection.previous_page : 1}.merge(options)), + :current_page_path => engine(content_type_constant.name.constantize).polymorphic_path(content_type_constant, options), + :next_page_path => engine(content_type_constant).polymorphic_path(content_type_constant,{:page => collection.next_page ? collection.next_page : collection.current_page}.merge(options)), + :last_page_path => engine(content_type_constant).polymorphic_path(content_type_constant,{:page => collection.total_pages}.merge(options)), + :content_type => content_type } end end - + def url_with_mode(url, mode) url = "" unless url # Handles cases where request.referrer is nil (see cms/_page_toolbar.html.erb for an example) uri = URI.parse(url) diff --git a/app/helpers/cms/form_tag_helper.rb b/app/helpers/cms/form_tag_helper.rb index b1e8334e8..46aac75df 100644 --- a/app/helpers/cms/form_tag_helper.rb +++ b/app/helpers/cms/form_tag_helper.rb @@ -8,9 +8,16 @@ module FormTagHelper # support. def content_block_form_for(object, *args, &block) options = args.extract_options! - simple_form_for(engine_aware_path(object), *(args << options.merge(builder: Cms::FormBuilder::ContentBlockFormBuilder)), &block) + simple_form_for(engine_aware_path(object), *(args << options.merge(builder: Cms::FormBuilder::ContentBlockFormBuilder, wrapper: 'browsercms')), &block) end + # Simple wrapper for Rails form_for that will use the CMS CustomFormBuilder. + # Can be used by portlets or other random public facing views to render content. + def cms_form_for(*args, &block) + options = args.extract_options! + options.merge!(:builder => Cms::FormBuilder::ContentBlockFormBuilder) + form_for(*(args + [options]), &block) + end def forecasting_a_new_section?(form_object) Cms::Section.with_path(form_object.object.class.path).first.nil? diff --git a/app/helpers/cms/page_helper.rb b/app/helpers/cms/page_helper.rb index bcd7edd7c..eb980ea8f 100644 --- a/app/helpers/cms/page_helper.rb +++ b/app/helpers/cms/page_helper.rb @@ -28,7 +28,7 @@ module PageHelper # Ideally, this could be improved if sprockets allows for dynamically determining which js library to use. # @return [String] Names of the JS file needed to load the editor. def cms_content_editor - "bcms/#{Cms.content_editor}" + "/assets/bcms/#{Cms.content_editor}" end # Outputs the title for this page. Used by both internal CMS pages, as well as page templates. Call use_page_title to diff --git a/app/helpers/cms/path_helper.rb b/app/helpers/cms/path_helper.rb index 3ef192b25..59ae12a9f 100644 --- a/app/helpers/cms/path_helper.rb +++ b/app/helpers/cms/path_helper.rb @@ -34,7 +34,7 @@ def sortable_column_path(content_type, column_to_sort) filtered_params.delete(:action) filtered_params.delete(:controller) filtered_params.merge!(:order => determine_order(filtered_params[:order], column_to_sort)) - polymorphic_path(engine_aware_path(content_type.model_class), filtered_params) + polymorphic_path(engine_aware_path(content_type.model_class), filtered_params.to_unsafe_h) end def link_to_usages(block) diff --git a/app/helpers/cms/section_nodes_helper.rb b/app/helpers/cms/section_nodes_helper.rb index 3b05dea42..4d9e81950 100644 --- a/app/helpers/cms/section_nodes_helper.rb +++ b/app/helpers/cms/section_nodes_helper.rb @@ -21,7 +21,7 @@ def add_link_path_data(section_node, parent_section_node) def add_section_path_data(section_node, parent_section_node) section = figure_out_target_section(parent_section_node, section_node) - new_section_path(section_id: section) + new_section_path(section_id: section.id) end # When sitemap initially renders, we only want to show first level. diff --git a/app/inputs/attachments_input.rb b/app/inputs/attachments_input.rb index 61499e392..8eb142728 100644 --- a/app/inputs/attachments_input.rb +++ b/app/inputs/attachments_input.rb @@ -1,6 +1,6 @@ class AttachmentsInput < SimpleForm::Inputs::Base - def input + def input(wrapper_options) definitions = Cms::Attachment.definitions_for(object.class.name, :multiple) if definitions.empty? template.render(partial: 'cms/attachments/no_attachments_defined', locals: {object: object}) diff --git a/app/inputs/cms_text_area_input.rb b/app/inputs/cms_text_area_input.rb index 0157bf4d7..c2a2b883f 100644 --- a/app/inputs/cms_text_area_input.rb +++ b/app/inputs/cms_text_area_input.rb @@ -3,7 +3,7 @@ class CmsTextAreaInput < SimpleForm::Inputs::TextInput include Cms::FormBuilder::DefaultInput - def input + def input(wrapper_options) extract_default @builder.text_area(attribute_name, input_html_options).html_safe end diff --git a/app/inputs/date_picker_input.rb b/app/inputs/date_picker_input.rb index db6a59730..199a96ae5 100644 --- a/app/inputs/date_picker_input.rb +++ b/app/inputs/date_picker_input.rb @@ -2,7 +2,7 @@ # 1. Allows for empty dates (i.e. no date) class DatePickerInput < SimpleForm::Inputs::TextInput - def input + def input(wrapper_options) @builder.text_field(attribute_name, input_html_options).html_safe end end \ No newline at end of file diff --git a/app/inputs/file_picker_input.rb b/app/inputs/file_picker_input.rb index cd1a91ff6..e1b34a801 100644 --- a/app/inputs/file_picker_input.rb +++ b/app/inputs/file_picker_input.rb @@ -6,7 +6,7 @@ # @option options [String] :hint (blank) Helpful tips for the person entering the field, appears blank if nothing is specified. class FilePickerInput < SimpleForm::Inputs::Base - def input + def input(wrapper_options) # New blocks will not have their attachments created yet. object.ensure_attachment_exists if object.respond_to?(:ensure_attachment_exists) diff --git a/app/inputs/name_input.rb b/app/inputs/name_input.rb index 73bf5da1a..1a691afff 100644 --- a/app/inputs/name_input.rb +++ b/app/inputs/name_input.rb @@ -14,7 +14,7 @@ def initialize(*args) options[:placeholder] = "Name" if options[:placeholder].nil? end - def input + def input(wrapper_options) add_slug_source_for_content_that_needs_it unless options[:label] diff --git a/app/inputs/path_input.rb b/app/inputs/path_input.rb index 3e98937d1..59ba5ee5f 100644 --- a/app/inputs/path_input.rb +++ b/app/inputs/path_input.rb @@ -1,6 +1,6 @@ class PathInput < SimpleForm::Inputs::TextInput - def input + def input(wrapper_options) if forecasting_a_new_section? options[:hint] = "Forecast: Saving this first #{object.class.display_name} will create a new section at #{object.class.path}." end diff --git a/app/inputs/template_editor_input.rb b/app/inputs/template_editor_input.rb index 55e7959c1..840b5681f 100644 --- a/app/inputs/template_editor_input.rb +++ b/app/inputs/template_editor_input.rb @@ -2,11 +2,11 @@ class TemplateEditorInput < SimpleForm::Inputs::TextInput include Cms::FormBuilder::DefaultInput - def label + def label(wrapper_options) super if render_template_input? end - def input + def input(wrapper_options) if render_template_input? options[:default] = object.class.default_template options[:default_handler] = "erb" unless options[:default_handler] diff --git a/app/inputs/text_editor_input.rb b/app/inputs/text_editor_input.rb index b72bf26de..ad77c1c76 100644 --- a/app/inputs/text_editor_input.rb +++ b/app/inputs/text_editor_input.rb @@ -1,6 +1,6 @@ class TextEditorInput < SimpleForm::Inputs::TextInput - def input + def input(wrapper_options) tag_id = "#{object_name}_#{attribute_name}" s = template.select_tag(:dhtml_selector, template.options_for_select([["Rich Text", ""],["Simple Text", "disabled"]], diff --git a/app/models/cms/abstract_file_block.rb b/app/models/cms/abstract_file_block.rb index 8efae4a17..2335ac053 100644 --- a/app/models/cms/abstract_file_block.rb +++ b/app/models/cms/abstract_file_block.rb @@ -4,7 +4,7 @@ class AbstractFileBlock < ActiveRecord::Base def self.with_parent_id(parent_id) if parent_id == 'all' - where(true) # Empty scope for chaining + self.all # Empty scope for chaining else self.includes({:attachments => :section_node}) .references(:section_node) diff --git a/app/models/cms/category.rb b/app/models/cms/category.rb index 929a6ecea..7258a4ac7 100644 --- a/app/models/cms/category.rb +++ b/app/models/cms/category.rb @@ -30,7 +30,7 @@ def of_type(type_name) def ancestors fn = lambda do |cat, parents| if cat.parent_id - p = self.class.find(cat.parent) + p = self.class.find(cat.parent.id) fn.call(p, (parents << p)) else parents.reverse diff --git a/app/models/cms/content_type.rb b/app/models/cms/content_type.rb index 2d8e7daf5..04872a94c 100644 --- a/app/models/cms/content_type.rb +++ b/app/models/cms/content_type.rb @@ -32,9 +32,8 @@ def available_by_module modules[content_type.module_name] = [] unless modules[content_type.module_name] modules[content_type.module_name] << content_type end - modules + modules.compact end - # Returns a list of all ContentTypes in the system. Content Types can opt out of this list by specifying: # # class MyWidget < ActiveRecord::Base @@ -50,11 +49,12 @@ def available end subclasses << Cms::Portlet subclasses.uniq! { |k| k.name } # filter duplicate classes - subclasses.map do |klass| + z=subclasses.map do |klass| unless klass < Cms::Portlet Cms::ContentType.new(name: klass.name) end - end.compact.sort { |a, b| a.name <=> b.name } + end.compact.sort { |a, b| a.name.to_s <=> b.name.to_s } + z.map{|y| y if y.name != nil }.compact end def list @@ -75,12 +75,12 @@ def default() # Returns only user generated Content Blocks def user_generated_connectables() - available.select { |content_type| !content_type.name.starts_with?("Cms::") } + available.select { |content_type| !content_type&.name&.starts_with?("Cms::") } end # Return content types that can be accessed as pages. def addressable() - available.select { |content_type| content_type.model_class.addressable? } + available.select { |content_type| content_type.model_class.try(:addressable?) } end end @@ -127,7 +127,7 @@ def self.create! # configured to specify this. # @return [Symbol] def module_name - model_class.content_module + model_class&.content_module end # Returns the partial used to render the form fields for a given block. @@ -144,12 +144,12 @@ def display_name_plural end def model_class - name.constantize + name.try(:constantize) end # Determines if the content can be connected to other pages. def connectable? - model_class.connectable? + model_class.try(:connectable?) end # Cms::HtmlBlock -> html_block diff --git a/app/models/cms/dynamic_view.rb b/app/models/cms/dynamic_view.rb index d19189d03..2896de7e7 100644 --- a/app/models/cms/dynamic_view.rb +++ b/app/models/cms/dynamic_view.rb @@ -29,7 +29,8 @@ def self.inherited(subclass) validates_presence_of :name, :format, :handler, :path, :locale validates_uniqueness_of :name, :scope => [:format, :handler], - :message => "Must have a unique combination of name, format and handler" + :message => "Must have a unique combination of name, format and handler", + conditions: -> { where(deleted: false) } end end diff --git a/app/models/cms/email_message.rb b/app/models/cms/email_message.rb index 5b909af7b..f57ac4a1b 100644 --- a/app/models/cms/email_message.rb +++ b/app/models/cms/email_message.rb @@ -6,7 +6,7 @@ class EmailMessage < ActiveRecord::Base scope :undelivered, -> { where("delivered_at is null") } validates_presence_of :recipients - after_create :deliver_now + after_create :deliver_mail_now def delivered? !!delivered_at @@ -48,14 +48,14 @@ def self.mailbot_address end #TODO: Take this out when we have an email queue processor - def deliver_now + def deliver_mail_now deliver! end def deliver! return false if delivered? self.sender = self.class.mailbot_address if self.sender.blank? - Cms::EmailMessageMailer.email_message(self).deliver + Cms::EmailMessageMailer.email_message(self).deliver_now update_attributes(:delivered_at => Time.now) end diff --git a/app/models/cms/form.rb b/app/models/cms/form.rb index e9f1dee1c..10b84dfd4 100644 --- a/app/models/cms/form.rb +++ b/app/models/cms/form.rb @@ -26,6 +26,7 @@ def field(name) end def required?(name) + name = name.to_s if name.class==Symbol field = field(name) field ? field.required? : false end diff --git a/app/models/cms/form_entry.rb b/app/models/cms/form_entry.rb index 0369912c4..c66ba19e7 100644 --- a/app/models/cms/form_entry.rb +++ b/app/models/cms/form_entry.rb @@ -23,6 +23,10 @@ def enable_validations class << self + def search(term) + where("data_columns like ?", "%#{term}%") + end + # Create an Entry for a specific Form. It will have validation and accessors based on the fields of the form. # # @param [Cms::Form] form diff --git a/app/models/cms/group.rb b/app/models/cms/group.rb index b0d292e5e..da2804410 100644 --- a/app/models/cms/group.rb +++ b/app/models/cms/group.rb @@ -36,7 +36,7 @@ def with_code(c) end end - scope :public, -> { where(["#{Cms::GroupType.table_name}.cms_access = ?", false]).includes(:group_type).references(:group_type) } + scope :public_groups, -> { where(["#{Cms::GroupType.table_name}.cms_access = ?", false]).includes(:group_type).references(:group_type) } scope :cms_access, -> { where(["#{Cms::GroupType.table_name}.cms_access = ?", true]).includes(:group_type).references(:group_type) } def guest? diff --git a/app/models/cms/guest_user.rb b/app/models/cms/guest_user.rb index 1ef1d8d2e..6f0101a05 100644 --- a/app/models/cms/guest_user.rb +++ b/app/models/cms/guest_user.rb @@ -13,7 +13,7 @@ def initialize(attributes={}) end def able_to?(*name) - group && group.permissions.count(:conditions => ["name in (?)", name.map(&:to_s)]) > 0 + group && group&.permissions&.collect(&:name).include?(name) end # Guests never get access to the CMS. diff --git a/app/models/cms/page.rb b/app/models/cms/page.rb index afa7ea420..912bcaf68 100644 --- a/app/models/cms/page.rb +++ b/app/models/cms/page.rb @@ -302,11 +302,10 @@ def append_leading_slash_to_path self.path = "/#{path}" end end - # remove trailing slash, unless the path is only a slash. uses capture and # substition because ruby regex engine does not support lookbehind def remove_trailing_slash_from_path - self.path.sub!(/(.+)\/+$/, '\1') + self.path = self.path.sub(/(.+)\/+$/, '\1') end def path_not_reserved @@ -370,8 +369,8 @@ def connectable_count_for_container(container) end def name_with_section_path - a = ancestors - (a[1..a.size].map { |a| a.name } + [name]).join(" / ") + anc = ancestors + (anc[1..anc.size].map { |a| a.name } + [name]).join(" / ") end # @return [Boolean] true if this page is the home page of the site. @@ -379,6 +378,12 @@ def home? path == "/" end + + # @return [Boolean] true if this page can be deleted or not. + def deletable? + !home? + end + # This will return the "top level section" for this page, which is the section directly # below the root (a.k.a My Site) that this page is in. If this page is in root, # then this will return root. diff --git a/app/models/cms/search_filter.rb b/app/models/cms/search_filter.rb index 353697f77..6bb263d5b 100644 --- a/app/models/cms/search_filter.rb +++ b/app/models/cms/search_filter.rb @@ -4,7 +4,6 @@ class SearchFilter include ::ActiveModel::Model attr_accessor :model_class, :term - def self.build(params_hash, model_class) model = self.new(params_hash) model.model_class = model_class diff --git a/app/models/cms/section_node.rb b/app/models/cms/section_node.rb index ae6e0e159..a6e9623ed 100644 --- a/app/models/cms/section_node.rb +++ b/app/models/cms/section_node.rb @@ -80,7 +80,11 @@ def link? end def deletable? - !self.root? && (!section? || node.deletable?) + return false if self.root? + if node.respond_to?(:deletable?) + return node.deletable? + end + true end # @param [Section] section diff --git a/app/portlets/dynamic_portlet.rb b/app/portlets/dynamic_portlet.rb index c6de2d723..1d16827ad 100644 --- a/app/portlets/dynamic_portlet.rb +++ b/app/portlets/dynamic_portlet.rb @@ -4,4 +4,8 @@ def render eval(@portlet.code) unless @portlet.code.blank? end + def attributes=(new_attributes, guard_protected_attributes = true) + self.assign_attributes(new_attributes) + end + end diff --git a/app/views/cms/application/_pagination.html.erb b/app/views/cms/application/_pagination.html.erb index 0638f695a..582b62dfb 100644 --- a/app/views/cms/application/_pagination.html.erb +++ b/app/views/cms/application/_pagination.html.erb @@ -10,7 +10,7 @@ <%= link_to "<<  ".html_safe, first_page_path, :id => "first_page_link" %> <%= link_to "<  ".html_safe, previous_page_path, :id => "previous_page_link" %> <% url = URI.parse(current_page_path) %> - <%= form_tag url.path, :method => :get, :class => "current_page", style: 'display:inline' do %> + <%= form_tag engine(content_type).url_for({}), :method => :get, :class => "current_page", style: 'display:inline' do %> <% url.query.to_s.split('&').each do |p| ; k, v = p.split('=') %> <%= hidden_field_tag(k, CGI::unescape(v.to_s), :id => "pagination_hidden_#{k}") unless k == "page" %> diff --git a/app/views/cms/attachments/_attachment.html.erb b/app/views/cms/attachments/_attachment.html.erb index 1f2aca4a8..b04172d0b 100644 --- a/app/views/cms/attachments/_attachment.html.erb +++ b/app/views/cms/attachments/_attachment.html.erb @@ -6,7 +6,7 @@ <% if attachment.is_image? %> <%= link_to(image_tag(attachment_path_for(attachment), :size => '60x60', :data => {:purpose => 'attachment'}), attachment_path_for(attachment), target: "_blank") %> <% else %> - <%= image_tag "cms/icons/file_types/#{attachment.icon}.png" %> + <%= image_tag "cms/icons/file_types/#{attachment.icon}.png", :style => "width:18px;height:18px;" %> <% end %> <%= attachment.attachment_name.singularize.capitalize %> <%= number_to_human_size(attachment.size) %> diff --git a/app/views/cms/attachments/_attachment_manager.html.erb b/app/views/cms/attachments/_attachment_manager.html.erb index 631b24cd9..10706637b 100644 --- a/app/views/cms/attachments/_attachment_manager.html.erb +++ b/app/views/cms/attachments/_attachment_manager.html.erb @@ -12,7 +12,7 @@ diff --git a/app/views/cms/file_blocks/render.html.erb b/app/views/cms/file_blocks/render.html.erb index db78a7a23..bb868a129 100644 --- a/app/views/cms/file_blocks/render.html.erb +++ b/app/views/cms/file_blocks/render.html.erb @@ -1,5 +1,5 @@
- <%= image_tag "cms/icons/file_types/#{@content_block.file.icon}.png", :alt=>@content_block.file.icon %> + <%= image_tag "cms/icons/file_types/#{@content_block.file.icon}.png", :style => "width:18px;height:18px;", :alt=>@content_block.file.icon %> <%= link_to @content_block.name, attachment_path_for(@content_block.file) %> <%= @content_block.file_size %>
diff --git a/app/views/cms/form_entries/index.html.erb b/app/views/cms/form_entries/index.html.erb index 392affcae..1e7d5c6bf 100644 --- a/app/views/cms/form_entries/index.html.erb +++ b/app/views/cms/form_entries/index.html.erb @@ -1,4 +1,5 @@ <% content_for :bulk_actions do %> <%= render 'buttons' %> + <%= hidden_field_tag :form_id, @form.id %> <% end %> <%= render file: 'cms/content_block/index' %> diff --git a/app/views/layouts/cms/_content_types.html.erb b/app/views/layouts/cms/_content_types.html.erb index b9bdeb391..158ef3f8b 100644 --- a/app/views/layouts/cms/_content_types.html.erb +++ b/app/views/layouts/cms/_content_types.html.erb @@ -4,7 +4,7 @@ <%= divider_tag %> <% end %> <% modules = Cms::ContentType.available_by_module - modules.keys.sort.each_with_index do |module_name, i| %> + modules.keys.compact.sort.each_with_index do |module_name, i| %> <%= divider_tag(i) %> <% modules[module_name].each do |type| %> <%= nav_link_to h(type.display_name), engine_aware_path(type) %> diff --git a/app/views/layouts/cms/_main_menu.html.erb b/app/views/layouts/cms/_main_menu.html.erb index 25b171f2a..ceda6e866 100644 --- a/app/views/layouts/cms/_main_menu.html.erb +++ b/app/views/layouts/cms/_main_menu.html.erb @@ -64,7 +64,7 @@