Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[#448] Make BrowserCMS a Mountable Engine

Reworked the entire project so it works as an isolated mountable engine. Rather than using paths like cms_dashboard_path, within the engine users can call _dashboard_ and from outside they can call cms.dashboard_path.

Includes the following updates:

* Regenerated project files to use a test/dummy application, like a typical engine would.
* Changed most of the paths so they aren't namespaced via convention (i.e. no more cms_dashboard_path)
* Completely removed all fixtures in favor of FactoryGirl
* Updated unit/functional tests to use new path patterns as well as factories.
* Started the process of replacing functional and integration with Cucumber features (both for improved documentation and fixing brittle tests)
* Improve cucumber coverage of more areas of the admin site.
* Moving config (like initializers) and other testing code (like sample controllers) may help solve [#416] which should allow bcms to be specified in a Gemfile using :git=> syntax
* Removed the namespacing of attributes on forms (i.e params[:html_block] rather than params[:cms_html_block])
* Added new method for adding the bcms routes to a project (mount_browsercms rather than routes_for_browser_cms). Old method is deprecated, and new projects will be generated with the new syntax.
  • Loading branch information...
commit 6098699fed2e3dbd65815ac3a5ce0dd6acc103d2 1 parent 83a237b
@peakpg peakpg authored
Showing with 2,323 additions and 8,362 deletions.
  1. +2 −0  .gitignore
  2. +2 −2 Gemfile
  3. +12 −9 Gemfile.lock
  4. +66 −7 Rakefile
  5. 0  test/dummy/log/test.log → app/assets/images/browsercms/.gitkeep
  6. +9 −0 app/assets/javascripts/browsercms/application.js
  7. +7 −0 app/assets/stylesheets/browsercms/application.css
  8. +4 −0 app/controllers/browsercms/application_controller.rb
  9. +4 −4 app/controllers/cms/content_block_controller.rb
  10. +4 −4 app/controllers/cms/dynamic_views_controller.rb
  11. +4 −4 app/controllers/cms/home_controller.rb
  12. +2 −2 app/controllers/cms/links_controller.rb
  13. +5 −5 app/controllers/cms/page_routes_controller.rb
  14. +7 −7 app/controllers/cms/pages_controller.rb
  15. +3 −3 app/controllers/cms/portlets_controller.rb
  16. +2 −2 app/controllers/cms/resource_controller.rb
  17. +1 −1  app/controllers/cms/routes_controller.rb
  18. +7 −7 app/controllers/cms/sections_controller.rb
  19. +1 −1  app/controllers/cms/sessions_controller.rb
  20. +2 −2 app/controllers/cms/tasks_controller.rb
  21. +3 −3 app/controllers/cms/users_controller.rb
  22. +4 −0 app/helpers/browsercms/application_helper.rb
  23. +1 −8 app/helpers/cms/application_helper.rb
  24. +8 −1 app/helpers/cms/page_helper.rb
  25. +15 −5 app/helpers/cms/path_helper.rb
  26. +1 −1  app/helpers/cms/template_support.rb
  27. +3 −1 app/models/cms/content_type.rb
  28. +7 −2 app/models/cms/dynamic_view.rb
  29. +7 −0 app/models/cms/group.rb
  30. +4 −4 app/models/cms/page.rb
  31. +5 −0 app/models/cms/page_partial.rb
  32. +11 −0 app/models/cms/page_route.rb
  33. +4 −0 app/models/cms/page_template.rb
  34. +1 −1  app/views/cms/cache/show.html.erb
  35. +1 −1  app/views/cms/categories/_form.html.erb
  36. +2 −2 app/views/cms/connectors/new.html.erb
  37. +1 −1  app/views/cms/dashboard/_page_drafts.html.erb
  38. +1 −1  app/views/cms/dashboard/_tasks.html.erb
  39. +1 −1  app/views/cms/dynamic_views/index.html.erb
  40. +1 −1  app/views/cms/dynamic_views/new.html.erb
  41. +2 −2 app/views/cms/file_blocks/_form.html.erb
  42. +1 −1  app/views/cms/groups/_form.html.erb
  43. +4 −4 app/views/cms/groups/_permissions.html.erb
  44. +2 −2 app/views/cms/groups/_sections.html.erb
  45. +3 −3 app/views/cms/groups/index.html.erb
  46. +1 −1  app/views/cms/links/edit.html.erb
  47. +1 −1  app/views/cms/links/new.html.erb
  48. +1 −1  app/views/cms/page_routes/edit.html.erb
  49. +2 −2 app/views/cms/page_routes/index.html.erb
  50. +1 −1  app/views/cms/page_routes/new.html.erb
  51. +4 −4 app/views/cms/page_routes/show.html.erb
  52. +3 −3 app/views/cms/pages/_edit_connector.html.erb
  53. +2 −2 app/views/cms/pages/_edit_container.html.erb
  54. +1 −1  app/views/cms/pages/edit.html.erb
  55. +5 −5 app/views/cms/pages/new.html.erb
  56. +1 −1  app/views/cms/redirects/index.html.erb
  57. +1 −1  app/views/cms/redirects/new.html.erb
  58. +1 −1  app/views/cms/routes/index.html.erb
  59. +4 −4 app/views/cms/sections/_form.html.erb
  60. +1 −1  app/views/cms/sections/edit.html.erb
  61. +3 −3 app/views/cms/sections/new.html.erb
  62. +1 −1  app/views/cms/sessions/new.html.erb
  63. +8 −8 app/views/cms/shared/_admin_sidebar.html.erb
  64. +1 −1  app/views/cms/users/_toolbar.html.erb
  65. +2 −2 app/views/cms/users/change_password.html.erb
  66. +1 −1  app/views/cms/users/edit.html.erb
  67. +2 −2 app/views/cms/users/index.html.erb
  68. +1 −1  app/views/cms/users/new.html.erb
  69. +1 −1  app/views/cms/users/show.html.erb
  70. +6 −6 app/views/layouts/_cms_toolbar.html.erb
  71. +6 −6 app/views/layouts/_page_toolbar.html.erb
  72. +14 −0 app/views/layouts/browsercms/application.html.erb
  73. +2 −2 app/views/portlets/login/render.html.erb
  74. +1 −1  app/views/portlets/portlets/_form.html.erb
  75. +1 −1  bin/bcms
  76. +1 −1  bin/bcms-upgrade
  77. +0 −4 config.ru
  78. +0 −44 config/application.rb
  79. +0 −13 config/boot.rb
  80. +0 −6 config/environment.rb
  81. +0 −34 config/environments/development.rb
  82. +0 −49 config/environments/production.rb
  83. +0 −44 config/environments/test.rb
  84. +0 −4 config/initializers/cms.rb
  85. +0 −11 config/initializers/inflections.rb
  86. +0 −9 config/initializers/secret_token.rb
  87. +0 −10 config/initializers/session_store.rb
  88. +87 −36 config/routes.rb
  89. +36 −0 features/acts_as_content_page.feature
  90. +13 −0 features/caching.feature
  91. +3 −2 features/ckeditor.feature
  92. +6 −6 features/{serving_pages.feature → content_files.feature}
  93. +21 −0 features/content_pages.feature
  94. +15 −0 features/create_pages.feature
  95. +33 −0 features/manage_groups.feature
  96. +10 −0 features/manage_html_blocks.feature
  97. +72 −0 features/manage_page_routes.feature
  98. +20 −0 features/manage_redirects.feature
  99. +12 −0 features/manage_sections.feature
  100. +25 −0 features/page_templates.feature
  101. +44 −15 features/portlets.feature
  102. +14 −0 features/sitemap.feature
  103. +3 −0  features/step_definitions/acts_as_content_page_steps.rb.rb
  104. +9 −0 features/step_definitions/ckeditor_steps.rb
  105. +73 −3 features/step_definitions/content_pages_steps.rb
  106. +6 −0 features/step_definitions/data_steps.rb
  107. +1 −0  features/step_definitions/html_blocks_steps.rb
  108. +18 −0 features/step_definitions/manage_sections_steps.rb
  109. +65 −0 features/step_definitions/page_route_steps.rb
  110. +5 −0 features/step_definitions/page_template_steps.rb
  111. +13 −0 features/step_definitions/permissions_steps.rb
  112. +55 −2 features/step_definitions/portlets_steps.rb
  113. +12 −0 features/step_definitions/redirect_steps.rb
  114. +18 −0 features/step_definitions/sitemap_steps.rb
  115. +2 −2 features/support/debugging.rb
  116. +13 −0 features/support/env.rb
  117. +0 −2  features/support/paths.rb
  118. +1 −1  lib/browsercms.rb
  119. +1 −1  lib/cms/authentication/controller.rb
  120. +2 −0  lib/cms/authoring.rb
  121. +2 −1  lib/cms/engine.rb
  122. +60 −0 lib/cms/route_extensions.rb
  123. +0 −152 lib/cms/routes.rb
  124. +1 −0  lib/tasks/cms.rake
  125. +0 −9 lib/tasks/namespaced.rake
  126. +0 −2  rails/init.rb
  127. +3 −3 script/rails
  128. +0 −2  test/dummy/README.txt
  129. +1 −2  test/dummy/Rakefile
  130. +9 −0 test/dummy/app/assets/javascripts/application.js
  131. +7 −0 test/dummy/app/assets/stylesheets/application.css
  132. +3 −0  test/dummy/app/controllers/cms/sample_blocks_controller.rb
  133. 0  test/dummy/{log/server.log → app/mailers/.gitkeep}
  134. 0  test/dummy/{log/production.log → app/models/.gitkeep}
  135. +22 −0 test/dummy/app/models/cms/sample_block.rb
  136. +3 −3 test/dummy/app/views/layouts/application.html.erb
  137. +0 −17 test/dummy/app/views/layouts/templates/default.html.erb
  138. +8 −8 test/dummy/config/application.rb
  139. +13 −8 test/dummy/config/database.yml
  140. +9 −3 test/dummy/config/environments/development.rb
  141. +23 −12 test/dummy/config/environments/production.rb
  142. +12 −1 test/dummy/config/environments/test.rb
  143. +7 −0 test/dummy/config/initializers/backtrace_silencers.rb
  144. +4 −0 test/dummy/config/initializers/browsercms.rb
  145. +10 −0 test/dummy/config/initializers/inflections.rb
  146. +5 −0 test/dummy/config/initializers/mime_types.rb
  147. +1 −1  test/dummy/config/initializers/secret_token.rb
  148. +1 −1  test/dummy/config/initializers/session_store.rb
  149. +14 −0 test/dummy/config/initializers/wrap_parameters.rb
  150. +1 −1  test/dummy/config/locales/en.yml
  151. +15 −2 test/dummy/config/routes.rb
  152. +0 −97 test/dummy/db/demo/data.rb
  153. +0 −6 test/dummy/db/demo/page_partials/_footer.html.erb
  154. +0 −24 test/dummy/db/demo/page_partials/_header.html.erb
  155. +0 −49 test/dummy/db/demo/page_templates/home_page.html.erb
  156. +0 −37 test/dummy/db/demo/page_templates/sub_page.html.erb
  157. +0 −274 test/dummy/db/migrate/20080815014337_browsercms_3_0_0.rb
  158. +0 −9 test/dummy/db/migrate/20091109175123_browsercms_3_0_5.rb
  159. +40 −39 test/dummy/db/schema.rb
  160. +1 −58 test/dummy/db/seeds.rb
  161. +0 −1  test/dummy/db/test.sqlite3
  162. 0  test/dummy/lib/assets/.gitkeep
  163. +0 −11 test/dummy/lib/demo_site.rake
  164. +0 −5,171 test/dummy/log/development.log
  165. +26 −0 test/dummy/public/404.html
  166. +26 −0 test/dummy/public/422.html
  167. +26 −0 test/dummy/public/500.html
  168. 0  test/dummy/public/favicon.ico
  169. +0 −1  test/dummy/public/site/customconfig.js
  170. +28 −12 test/factories.rb
  171. +0 −97 test/fixtures/cms/cms_connectors.yml
  172. +0 −13 test/fixtures/cms/cms_content_type_groups.yml
  173. +0 −50 test/fixtures/cms/cms_content_types.yml
  174. +0 −16 test/fixtures/cms/cms_group_permissions.yml
  175. +0 −31 test/fixtures/cms/cms_group_sections.yml
  176. +0 −11 test/fixtures/cms/cms_group_type_permissions.yml
  177. +0 −25 test/fixtures/cms/cms_group_types.yml
  178. +0 −25 test/fixtures/cms/cms_groups.yml
  179. +0 −67 test/fixtures/cms/cms_html_block_versions.yml
  180. +0 −63 test/fixtures/cms/cms_html_blocks.yml
  181. +0 −265 test/fixtures/cms/cms_page_versions.yml
  182. +0 −85 test/fixtures/cms/cms_pages.yml
  183. +0 −26 test/fixtures/cms/cms_permissions.yml
  184. +0 −46 test/fixtures/cms/cms_section_nodes.yml
  185. +0 −19 test/fixtures/cms/cms_sections.yml
  186. +0 −9 test/fixtures/cms/cms_sites.yml
  187. +0 −11 test/fixtures/cms/cms_user_group_memberships.yml
  188. +0 −15 test/fixtures/cms/cms_users.yml
  189. +1 −0  test/functional/cms/categories_controller_test.rb
  190. +2 −0  test/functional/cms/connectors_controller_test.rb
  191. +9 −4 test/functional/cms/content_block_controller_test.rb
  192. +17 −93 test/functional/cms/content_controller_test.rb
  193. +0 −58 test/functional/cms/dynamic_views_controller_test.rb
  194. +1 −0  test/functional/cms/file_blocks_controller_test.rb
  195. +0 −52 test/functional/cms/groups_controller_test.rb
  196. +7 −6 test/functional/cms/html_blocks_controller_test.rb
  197. +4 −2 test/functional/cms/image_blocks_controller_test.rb
  198. +3 −2 test/functional/cms/links_controller_test.rb
  199. +199 −195 test/functional/cms/pages_controller_test.rb
  200. +0 −37 test/functional/cms/section_nodes_controller_test.rb
  201. +13 −8 test/functional/cms/sections_controller_test.rb
  202. +67 −65 test/functional/cms/sessions_controller_test.rb
  203. +8 −3 test/functional/cms/tasks_controller_test.rb
  204. +14 −4 test/functional/cms/toolbar_controller_test.rb
  205. +224 −215 test/functional/cms/users_controller_test.rb
  206. +0 −22 test/functional/tests/pretend_controller_test.rb
  207. +0 −20 test/integration/cms/ckeditor_test.rb
  208. +4 −1 test/integration/cms/password_management_test.rb
  209. +0 −14 test/integration/login_test.rb
  210. +34 −0 test/support/engine_controller_hacks.rb
  211. +45 −0 test/support/factory_helpers.rb
  212. +70 −0 test/support/rails_3_1_routes_hack.rb
  213. +27 −95 test/test_helper.rb
  214. +9 −17 test/unit/behaviors/attaching_test.rb
  215. +11 −0 test/unit/factories_test.rb
  216. +4 −4 test/unit/helpers/menu_helper_test.rb
  217. +23 −22 test/unit/helpers/path_helper_test.rb
  218. +1 −1  test/unit/lib/routes_test.rb
  219. +2 −2 test/{ → unit}/mock_file_test.rb
  220. +14 −0 test/unit/models/content_type_test.rb
  221. +1 −4 test/unit/models/dynamic_views_test.rb
  222. +7 −1 test/unit/models/email_page_portlet_test.rb
  223. +17 −1 test/unit/models/group_test.rb
  224. +13 −5 test/unit/models/page_partial_test.rb
  225. +17 −2 test/unit/models/page_route_test.rb
  226. +16 −6 test/unit/models/page_template_test.rb
  227. +2 −2 test/unit/models/page_test.rb
  228. +2 −1  test/unit/models/sections_test.rb
  229. +3 −3 test/unit/models/site_test.rb
  230. +15 −17 test/unit/models/user_test.rb
  231. +11 −18 upgrading_to_3_1.md
View
2  .gitignore
@@ -17,7 +17,9 @@ public/cache
patches
rerun.txt
test/dummy/log/*
+test/dummy/tmp/*
doc/api
.yardoc/*
.rvmrc
+
View
4 Gemfile
@@ -4,7 +4,7 @@ source 'http://rubygems.org'
gemspec
gem 'jquery-rails'
-
+gem 'rack', '1.3.3' # At least until 1.3.5 is out. Avoids warnings about already defined constants.
gem "mysql2"
@@ -24,5 +24,5 @@ group :test do
gem 'cucumber-rails'
gem 'cucumber'
gem 'launchy'
-
+ gem 'ruby-prof'
end
View
21 Gemfile.lock
@@ -52,15 +52,15 @@ GEM
xpath (~> 0.1.4)
childprocess (0.2.2)
ffi (~> 1.0.6)
- cucumber (1.0.6)
+ cucumber (1.1.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
- gherkin (~> 2.4.18)
+ gherkin (~> 2.5.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
- cucumber-rails (1.0.5)
+ cucumber-rails (1.1.1)
capybara (>= 1.1.1)
- cucumber (~> 1.0.6)
+ cucumber (>= 1.1.0)
nokogiri (>= 1.5.0)
database_cleaner (0.6.7)
diff-lcs (1.1.3)
@@ -70,15 +70,15 @@ GEM
factory_girl (~> 1.3)
railties (>= 3.0.0)
ffi (1.0.9)
- gherkin (2.4.18)
+ gherkin (2.5.1)
json (>= 1.4.6)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.14)
railties (~> 3.0)
thor (~> 0.14)
- json (1.6.0)
- json_pure (1.6.0)
+ json (1.6.1)
+ json_pure (1.6.1)
launchy (2.0.5)
addressable (~> 2.2.6)
mail (2.3.0)
@@ -92,7 +92,7 @@ GEM
mysql2 (0.3.7)
nokogiri (1.5.0)
polyglot (0.3.2)
- rack (1.3.2)
+ rack (1.3.3)
rack-cache (1.0.3)
rack (>= 0.4)
rack-mount (0.8.3)
@@ -118,8 +118,9 @@ GEM
thor (~> 0.14.6)
rake (0.9.2)
rdoc (3.9.4)
+ ruby-prof (0.10.8)
rubyzip (0.9.4)
- selenium-webdriver (2.6.0)
+ selenium-webdriver (2.8.0)
childprocess (>= 0.2.1)
ffi (>= 1.0.7)
json_pure
@@ -158,6 +159,8 @@ DEPENDENCIES
launchy
mocha (= 0.9.8)
mysql2
+ rack (= 1.3.3)
+ ruby-prof
sqlite3-ruby
test-unit (= 2.1.1)
yard
View
73 Rakefile
@@ -1,13 +1,72 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
-require File.expand_path('../config/application', __FILE__)
+APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
+load 'rails/tasks/engine.rake'
+
+
+Bundler::GemHelper.install_tasks
-require 'rake'
require 'rake/testtask'
-Browsercms::Application.load_tasks
+Rake::TestTask.new('test:units') do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/unit/**/*_test.rb'
+ t.verbose = false
+end
-require 'bundler'
-Bundler::GemHelper.install_tasks
+Rake::TestTask.new('test:functionals') do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/functional/**/*_test.rb'
+ t.verbose = false
+
+end
+
+Rake::TestTask.new('test:integration') do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/integration/**/*_test.rb'
+ t.verbose = false
+end
+
+require 'cucumber'
+require 'cucumber/rake/task'
+
+Cucumber::Rake::Task.new(:features) do |t|
+ t.cucumber_opts = "features --format progress"
+end
+
+desc 'Runs all the tests'
+task :test do
+ tests_to_run = ENV['TEST'] ? ["test:single"] : %w(test:units test:functionals test:integration features)
+ errors = tests_to_run.collect do |task|
+ begin
+ Rake::Task[task].invoke
+ nil
+ rescue => e
+ { :task => task, :exception => e }
+ end
+ end.compact
+
+ if errors.any?
+ puts errors.map { |e| "Errors running #{e[:task]}! #{e[:exception].inspect}" }.join("\n")
+ abort
+ end
+end
+
+#task :test => ['test:units', 'test:functionals', 'test:integration', 'features']
+task :default => :test
View
0  test/dummy/log/test.log → app/assets/images/browsercms/.gitkeep
File renamed without changes
View
9 app/assets/javascripts/browsercms/application.js
@@ -0,0 +1,9 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
View
7 app/assets/stylesheets/browsercms/application.css
@@ -0,0 +1,7 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require_tree .
+*/
View
4 app/controllers/browsercms/application_controller.rb
@@ -0,0 +1,4 @@
+module Browsercms
+ class ApplicationController < ActionController::Base
+ end
+end
View
8 app/controllers/cms/content_block_controller.rb
@@ -114,8 +114,8 @@ def model_class
content_type.model_class
end
- def model_name
- ActiveModel::Naming.singular(model_class)
+ def model_form_name
+ content_type.model_class_form_name
end
# methods for loading one or a collection of blocks
@@ -168,7 +168,7 @@ def block_form
# new related methods
def build_block
- @block = model_class.new(params[model_name])
+ @block = model_class.new(params[model_form_name])
check_permissions
end
@@ -207,7 +207,7 @@ def after_create_on_error
# update related methods
def update_block
load_block
- @block.update_attributes(params[model_name])
+ @block.update_attributes(params[model_form_name])
end
def after_update_on_success
View
8 app/controllers/cms/dynamic_views_controller.rb
@@ -18,10 +18,10 @@ def new
end
def create
- @view = dynamic_view_type.new(params[ActionController::RecordIdentifier.singular_class_name(dynamic_view_type)])
+ @view = dynamic_view_type.new(params[dynamic_view_type.resource_collection_name])
if @view.save
flash[:notice] = "#{dynamic_view_type} '#{@view.name}' was created"
- redirect_to cms_index_path_for(dynamic_view_type.name.underscore.pluralize)
+ redirect_to cms_index_path_for(dynamic_view_type)
else
render :action => "new"
end
@@ -49,8 +49,8 @@ def destroy
protected
def dynamic_view_type
@dynamic_view_type ||= begin
- uri = request.request_uri.sub(/\?.*/, '')
- type_name = uri.split('/')[2].classify
+ url = request.path.sub(/\?.*/, '')
+ type_name = url.split('/')[2].classify
begin
type = "Cms::#{type_name}".constantize
rescue NameError
View
8 app/controllers/cms/home_controller.rb
@@ -1,7 +1,7 @@
module Cms
-class HomeController < Cms::BaseController
- def index
- redirect_to '/'
+ class HomeController < Cms::BaseController
+ def index
+ redirect_to '/'
+ end
end
-end
end
View
4 app/controllers/cms/links_controller.rb
@@ -34,11 +34,11 @@ def destroy
respond_to do |format|
if @link.destroy
message = "Link '#{@link.name}' was deleted."
- format.html { flash[:notice] = message; redirect_to(cms_sitemap_url) }
+ format.html { flash[:notice] = message; redirect_to(sitemap_url) }
format.json { render :json => {:success => true, :message => message } }
else
message = "Link '#{@link.name}' could not be deleted"
- format.html { flash[:error] = message; redirect_to(cms_sitemap_url) }
+ format.html { flash[:error] = message; redirect_to(sitemap_url) }
format.json { render :json => {:success => false, :message => message } }
end
end
View
10 app/controllers/cms/page_routes_controller.rb
@@ -13,19 +13,19 @@ def new
end
def create
- @page_route = PageRoute.new(params[:cms_page_route])
+ @page_route = PageRoute.new(params[:page_route])
if @page_route.save
flash[:notice] = "Page Route Created"
- redirect_to cms_page_route_url(@page_route)
+ redirect_to page_route_url(@page_route)
else
render :action => "new"
end
end
def update
- if @page_route.update_attributes(params[:cms_page_route])
+ if @page_route.update_attributes(params[:page_route])
flash[:notice] = "Page Route Updated"
- redirect_to cms_page_route_url(@page_route)
+ redirect_to page_route_url(@page_route)
else
render :action => "new"
end
@@ -35,7 +35,7 @@ def update
def destroy
@page_route.destroy
flash[:notice] = "Page Route Deleted"
- redirect_to cms_page_routes_url
+ redirect_to page_routes_url
end
protected
View
14 app/controllers/cms/pages_controller.rb
@@ -23,7 +23,7 @@ def show
end
def create
- @page = Page.new(params[:cms_page])
+ @page = Page.new(params[:page])
@page.section = @section
if @page.save
flash[:notice] = "Page was '#{@page.name}' created."
@@ -34,7 +34,7 @@ def create
end
def update
- if @page.update_attributes(params[:cms_page])
+ if @page.update_attributes(params[:page])
flash[:notice] = "Page was '#{@page.name}' updated."
redirect_to @page
else
@@ -49,11 +49,11 @@ def destroy
respond_to do |format|
if @page.destroy
message = "Page '#{@page.name}' was deleted."
- format.html { flash[:notice] = message; redirect_to(cms_sitemap_url) }
+ format.html { flash[:notice] = message; redirect_to(sitemap_url) }
format.json { render :json => {:success => true, :message => message } }
else
message = "Page '#{@page.name}' could not be deleted"
- format.html { flash[:error] = message; redirect_to(cms_sitemap_url) }
+ format.html { flash[:error] = message; redirect_to(sitemap_url) }
format.json { render :json => {:success => false, :message => message } }
end
end
@@ -67,7 +67,7 @@ def destroy
raise Cms::Errors::AccessDenied unless @pages.all? { |page| current_user.able_to_edit?(page) }
@pages.each { |page| page.send(status) }
flash[:notice] = "#{params[:page_ids].size} pages #{verb}"
- redirect_to cms_dashboard_url
+ redirect_to dashboard_url
else
load_page
if @page.send(status)
@@ -101,8 +101,8 @@ def revert_to
private
def strip_publish_params
unless current_user.able_to?(:publish_content)
- params[:cms_page].delete :hidden
- params[:cms_page].delete :archived
+ params[:page].delete :hidden
+ params[:page].delete :archived
end
end
View
6 app/controllers/cms/portlets_controller.rb
@@ -28,15 +28,15 @@ def block_form
end
def new_block_path
- new_cms_portlet_path
+ new_portlet_path
end
def block_path(action=nil)
- send("#{action ? "#{action}_" : ""}cms_portlet_path", @block)
+ send("#{action ? "#{action}_" : ""}portlet_path", @block)
end
def blocks_path
- cms_portlets_path
+ portlets_path
end
end
end
View
4 app/controllers/cms/resource_controller.rb
@@ -12,7 +12,7 @@ def new
end
def create
- @object = build_object(params["cms_#{variable_name}"])
+ @object = build_object(params[variable_name])
if @object.save
flash[:notice] = "#{resource_name.singularize.titleize} '#{object_name}' was created"
redirect_to after_create_url
@@ -84,7 +84,7 @@ def object_name
end
def index_url
- cms_index_url_for("cms_#{resource_name}")
+ cms_index_url_for(resource_name)
end
def after_create_url
View
2  app/controllers/cms/routes_controller.rb
@@ -8,7 +8,7 @@ def index
unless params[:path].blank?
@path = params[:path]
- @route = ActionController::Routing::Routes.recognize_path(@path)
+ @route = Rails.application.routes.recognize_path(@path)
end
@routes = Rails.application.routes.routes.collect do |route|
View
14 app/controllers/cms/sections_controller.rb
@@ -8,11 +8,11 @@ class Cms::SectionsController < Cms::BaseController
helper_method :cms_groups
def index
- redirect_to cms_sitemap_path
+ redirect_to cms.sitemap_path
end
def show
- redirect_to cms_sitemap_path
+ redirect_to cms.sitemap_path
end
def new
@@ -21,7 +21,7 @@ def new
end
def create
- @section = Cms::Section.new(params[:cms_section])
+ @section = Cms::Section.new(params[:section])
@section.parent = @parent
@section.groups = @section.parent.groups unless current_user.able_to?(:administrate)
if @section.save
@@ -36,8 +36,8 @@ def edit
end
def update
- params[:cms_section].delete('group_ids') if params[:cms_section] && !current_user.able_to?(:administrate)
- @section.attributes = params[:cms_section]
+ params[:section].delete('group_ids') if params[:section] && !current_user.able_to?(:administrate)
+ @section.attributes = params[:section]
if @section.save
flash[:notice] = "Section '#{@section.name}' was updated"
redirect_to @section
@@ -50,11 +50,11 @@ def destroy
respond_to do |format|
if @section.deletable? && @section.destroy
message = "Section '#{@section.name}' was deleted."
- format.html { flash[:notice] = message; redirect_to(cms_sitemap_url) }
+ format.html { flash[:notice] = message; redirect_to(sitemap_url) }
format.json { render :json => {:success => true, :message => message } }
else
message = "Section '#{@section.name}' could not be deleted"
- format.html { flash[:error] = message; redirect_to(cms_sitemap_url) }
+ format.html { flash[:error] = message; redirect_to(sitemap_url) }
format.json { render :json => {:success => false, :message => message } }
end
end
View
2  app/controllers/cms/sessions_controller.rb
@@ -25,7 +25,7 @@ def create
redirect_to((!params[:success_url].blank? && params[:success_url]) || session[:return_to] || "/")
session[:return_to] = nil
else
- redirect_back_or_default(cms_home_url)
+ redirect_back_or_default(cms.home_url)
end
else
note_failed_signin
View
4 app/controllers/cms/tasks_controller.rb
@@ -27,7 +27,7 @@ def complete
end
end
flash[:notice] = "Tasks marked as complete"
- redirect_to cms_dashboard_path
+ redirect_to dashboard_path
else
@task = Task.find(params[:id])
if @task.assigned_to == current_user
@@ -41,7 +41,7 @@ def complete
end
rescue ActiveRecord::RecordNotFound
flash[:error] = "No tasks were marked for completion"
- redirect_to cms_dashboard_path
+ redirect_to dashboard_path
end
private
View
6 app/controllers/cms/users_controller.rb
@@ -43,7 +43,7 @@ def change_password
def update_password
if user.update_attributes(params[:cms_user])
flash[:notice] = "Password for '#{user.login}' was changed"
- redirect_to(current_user.able_to?(:administrate) ? cms_users_path : cms_user_path(user))
+ redirect_to(current_user.able_to?(:administrate) ? users_path : user_path(user))
else
render :action => 'change_password'
end
@@ -56,12 +56,12 @@ def disable
rescue Exception => e
flash[:error] = e.message
end
- redirect_to cms_users_path
+ redirect_to users_path
end
def enable
user.enable!
- redirect_to cms_users_path
+ redirect_to users_path
end
protected
View
4 app/helpers/browsercms/application_helper.rb
@@ -0,0 +1,4 @@
+module Browsercms
+ module ApplicationHelper
+ end
+end
View
9 app/helpers/cms/application_helper.rb
@@ -2,13 +2,6 @@
module Cms
module ApplicationHelper
- # Return the JS file to load the configured default WYSIWYG editor
- #
- # Ideally, this could be improved if sprockets allows for dynamically determining which js library to use.
- def cms_content_editor
- "bcms/#{Cms.content_editor}"
- end
-
def searchable_sections(selected = nil)
root = Section.root.first
options = [['All sections', 'all'], [root.name, root.id]]
@@ -47,7 +40,7 @@ def link_to_usages(block)
count = block.connected_pages.count
if count > 0
# Would love a cleaner solution to this problem, see http://stackoverflow.com/questions/702728
- path = Portlet === block ? usages_cms_portlet_path(block) : [:usages, block]
+ path = Portlet === block ? usages_portlet_path(block) : [:usages, block]
link_to count, path, :id => block.id, :block_type => block.content_block_type
else
count
View
9 app/helpers/cms/page_helper.rb
@@ -1,6 +1,13 @@
module Cms
module PageHelper
+ # Return the JS file to load the configured default WYSIWYG editor
+ #
+ # Ideally, this could be improved if sprockets allows for dynamically determining which js library to use.
+ def cms_content_editor
+ "bcms/#{Cms.content_editor}"
+ end
+
# Outputs the title for this page. Used by both internal CMS pages, as well as page templates. If not explicitily set,
# returns the title of the page.
#
@@ -56,7 +63,7 @@ def container_has_block?(name, &block)
# Add the code to render the CMS toolbar.
def cms_toolbar
toolbar = <<HTML
-<iframe src="#{cms_toolbar_path(:page_id => @page.id, :page_version => @page.version, :mode => @mode, :page_toolbar => @show_page_toolbar ? 1 : 0) }" width="100%" height="#{@show_page_toolbar ? 159 : 100 }px" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" name="cms_toolbar"></iframe>
+<iframe src="#{cms.toolbar_path(:page_id => @page.id, :page_version => @page.version, :mode => @mode, :page_toolbar => @show_page_toolbar ? 1 : 0) }" width="100%" height="#{@show_page_toolbar ? 159 : 100 }px" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" name="cms_toolbar"></iframe>
HTML
toolbar.html_safe if @show_toolbar
end
View
20 app/helpers/cms/path_helper.rb
@@ -1,4 +1,8 @@
module Cms
+
+ # @todo All methods really need to be renamed to match conventions for Engines.
+ # In CMS::Engine, shouldn't have cms_ in method name.
+ # From app, should be cms.xyz_path
module PathHelper
def cms_index_path_for(resource, options={})
send("#{resource_collection_name(resource).underscore.pluralize.gsub('/','_')}_path", options)
@@ -18,17 +22,20 @@ def cms_new_url_for(resource, options={})
def cms_connectable_path(connectable, options={})
if Portlet === connectable
- cms_portlet_path(connectable)
+ cms.portlet_path(connectable)
else
connectable
end
end
-
+
+ # @todo Really needs to be renamed to match conventions for Engines.
+ # In CMS::Engine, should be edit_connectable_path
+ # From app, should be cms.edit_connectable_path
def edit_cms_connectable_path(connectable, options={})
if Portlet === connectable
- edit_cms_portlet_path(connectable, options)
+ edit_portlet_path(connectable, options)
else
- polymorphic_path([:edit, connectable], options)
+ polymorphic_path([:edit, connectable], options)
end
end
@@ -37,9 +44,12 @@ def edit_cms_connectable_path(connectable, options={})
# the resource can be a ContentType, ActiveRecord::Base instance
# or just a string or symbol
def resource_collection_name(resource)
+ if resource.respond_to?(:resource_collection_name)
+ return resource.resource_collection_name
+ end
collection_name = case resource
when ContentType then resource.model_class_form_name
- when ActiveRecord::Base then ActiveModel::Naming.singular(resource)
+ when ActiveRecord::Base then resource.class.model_name.demodulize
else resource.to_s
end
end
View
2  app/helpers/cms/template_support.rb
@@ -13,7 +13,7 @@ def self.included(controller)
helper do
def cms_toolbar
if current_user.able_to?(:administrate, :edit_content, :publish_content)
- %Q{<iframe src="#{cms_toolbar_path(:page_toolbar => 0)}" width="100%" height="100px" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" name="cms_toolbar"></iframe>}
+ %Q{<iframe src="#{cms.toolbar_path(:page_toolbar => 0)}" width="100%" height="100px" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" name="cms_toolbar"></iframe>}
end
end
end
View
4 app/models/cms/content_type.rb
@@ -57,8 +57,10 @@ def model_class
name.constantize
end
+ # Cms::HtmlBlock -> html_block
+ # ThingBlock -> thing_block
def model_class_form_name
- ActiveModel::Naming.singular(model_class)
+ model_class.model_name.element
end
# Allows models to show additional columns when being shown in a list.
View
9 app/models/cms/dynamic_view.rb
@@ -83,9 +83,14 @@ def set_publish_on_save
end
# Get the plural symbol for a particular resource.
- # i.e. Cms::PageTemplate -> :cms_page_templates
+ # i.e. Cms::PageTemplate -> :page_templates
def self.resource_name
- ActiveModel::Naming.plural(self).to_sym
+ resource_collection_name.pluralize
+ end
+
+ # Default implementation
+ def self.resource_collection_name
+ model_name.underscore
end
end
end
View
7 app/models/cms/group.rb
@@ -39,4 +39,11 @@ def self.guest
with_code(GUEST_CODE).first
end
+
+ def has_permission?(permission)
+ permissions.any? do |p|
+ return true if permission.to_sym == p.name.to_sym
+ end
+ false
+ end
end
View
8 app/models/cms/page.rb
@@ -137,9 +137,9 @@ def copy_connectors(options={})
end
# Adds a Content block to this page.
- #
- #
- def create_connector(connectable, container=:main)
+ # @param [ContentBlock] connectable The content block to be added
+ # @param [Symbol] container The container to add it in (default :main)
+ def add_content(connectable, container=:main)
transaction do
raise "Connectable is nil" unless connectable
raise "Container is required" if container.blank?
@@ -157,7 +157,7 @@ def create_connector(connectable, container=:main)
end
end
- alias_method :add_content, :create_connector
+ alias_method :create_connector, :add_content
def move_connector(connector, direction)
transaction do
View
5 app/models/cms/page_partial.rb
@@ -14,6 +14,11 @@ def self.display_name(file_name)
"#{name.sub(/^_/, '').titleize} (#{format}/#{handler})"
end
+ def self.resource_collection_name
+ "page_partial"
+ end
+
+
def prepend_underscore
if !name.blank? && name[0, 1] != '_'
self.name = "_#{name}"
View
11 app/models/cms/page_route.rb
@@ -73,6 +73,17 @@ def to
"cms/content#show_page_route"
end
+ # @param [Symbol | Array] method A method name (like :get) or array of names (ie. [:get :post]) to constraint this route.
+ def via=(method)
+ if method.respond_to?(:each)
+ method.each do |m|
+ add_condition(:method, m)
+ end
+ else
+ add_condition(:method, method)
+ end
+ end
+
# Returns which methods this route can be via. Defaults to [:get, :post] if not specified.
def via
found = conditions.collect() { |condition|
View
4 app/models/cms/page_template.rb
@@ -20,6 +20,10 @@ def self.display_name(file_name)
"#{name.titleize} (#{format}/#{handler})"
end
+ def self.resource_collection_name
+ "page_template"
+ end
+
# This is a combination of file system page templates
# and database page templates
def self.options
View
2  app/views/cms/cache/show.html.erb
@@ -5,7 +5,7 @@
<% end %>
<%= content_for :functions do %>
- <%= link_to(span_tag("Clear Page Cache"), cms_cache_path,
+ <%= link_to(span_tag("Clear Page Cache"), cache_path,
:class => "button http_delete") %>
<% end %>
View
2  app/views/cms/categories/_form.html.erb
@@ -32,5 +32,5 @@
})
</script>
<% end %>
- <p>Before you can create a category, you must <%= link_to "create a category type", new_cms_category_type_path %>. Each category must have a category type. For example, if you plan to categorize your news releases, you might create a "News Release" category type.</p>
+ <p>Before you can create a category, you must <%= link_to "create a category type", new_category_type_path %>. Each category must have a category type. For example, if you plan to categorize your news releases, you might create a "News Release" category type.</p>
<% end %>
View
4 app/views/cms/connectors/new.html.erb
@@ -31,7 +31,7 @@
<h1><%=h @toolbar_title %></h1>
<%= link_to span_tag("Add to Page"), "#", :id => "add_button", :class => "button disabled" %>
<%= link_to span_tag("View Content"), "#", :id => "view_button", :class => "button disabled" %>
- <%= form_tag cms_connectors_path, :id => 'connect_form' do %>
+ <%= form_tag connectors_path, :id => 'connect_form' do %>
<%= hidden_field_tag :page_id, @page.to_param %>
<%= hidden_field_tag :container, @container %>
<%= hidden_field_tag :connectable_type, '' %>
@@ -40,7 +40,7 @@
<br clear="all" />
<% end %>
-<%= form_tag new_cms_connector_path, :method => :get do %>
+<%= form_tag new_connector_path, :method => :get do %>
<%= hidden_field_tag :page_id, @page.to_param %>
<%= hidden_field_tag :container, @container %>
<div style="margin: 20px 2px;">
View
2  app/views/cms/dashboard/_page_drafts.html.erb
@@ -1,7 +1,7 @@
<div class="dashboard_unit" id="page_drafts">
<h2 class="left">Page Drafts</h2>
- <%= form_tag publish_cms_pages_path, :method => :put do %>
+ <%= form_tag cms.publish_pages_path, :method => :put do %>
<div class="roundedcorners" style="position: relative">
<table class="data">
<thead>
View
2  app/views/cms/dashboard/_tasks.html.erb
@@ -1,7 +1,7 @@
<div class="dashboard_unit" id="tasks">
<h2 class="left">Tasks</h2>
- <%= form_tag complete_cms_tasks_path, :method => :put do %>
+ <%= form_tag cms.complete_tasks_path, :method => :put do %>
<div class="roundedcorners" style="position: relative">
<table class="data">
<thead>
View
2  app/views/cms/dynamic_views/index.html.erb
@@ -20,7 +20,7 @@
<% end %>
<%= content_for :functions do %>
- <%= add_button cms_new_path_for(dynamic_view_type.name.underscore) %>
+ <%= add_button cms_new_path_for(dynamic_view_type) %>
<%= edit_button %>
<%= delete_button :title => "Are you sure you want to delete this #{dynamic_view_type.name.demodulize.underscore.titleize}?" %>
<% end %>
View
2  app/views/cms/dynamic_views/new.html.erb
@@ -1,3 +1,3 @@
<% @page_title = @toolbar_title = "New #{dynamic_view_type.name.titleize}" %>
-<%= content_for :functions, link_to(span_tag("List All"), cms_index_path_for(dynamic_view_type.name.underscore.pluralize), :class => "button") %>
+<%= content_for :functions, link_to(span_tag("List All"), cms_index_path_for(dynamic_view_type), :class => "button") %>
<%= render :partial => 'form' %>
View
4 app/views/cms/file_blocks/_form.html.erb
@@ -12,8 +12,8 @@
jQuery(function($) {
<% if @block.new_record? %>
var sectionIdPathMap = <%= @sections.inject({}){|map, sec| map[sec.id.to_s] = sec.path.sub(/\/$/,''); map}.to_json.html_safe %>
- $('#cms_file_block_attachment_file, #cms_file_block_attachment_section_id').change(function(){
- $('#cms_file_block_attachment_file_path').val(sectionIdPathMap[$('#cms_file_block_attachment_section_id').val()]+'/'+$.cms.sanitizeFileName($('#cms_file_block_attachment_file').val()))
+ $('#file_block_attachment_file, #file_block_attachment_section_id').change(function(){
+ $('#file_block_attachment_file_path').val(sectionIdPathMap[$('#file_block_attachment_section_id').val()]+'/'+$.cms.sanitizeFileName($('#file_block_attachment_file').val()))
})
<% end %>
});
View
2  app/views/cms/groups/_form.html.erb
@@ -13,7 +13,7 @@
<% end %>
<%= content_for :functions do %>
- <%= link_to(span_tag("List All"), cms_groups_path,
+ <%= link_to(span_tag("List All"), groups_path,
:id => "list_all_button",
:class => "button") %>
<% end %>
View
8 app/views/cms/groups/_permissions.html.erb
@@ -1,9 +1,9 @@
<%= content_for :html_head do %>
<%= javascript_tag do %>
jQuery(function($){
- var cms_access_group_ids = <%= Cms::GroupType.cms_access.all.map{|e| e.id.to_s}.to_json %>
- $('#cms_group_group_type_id').change(function() {
- if ($.inArray($('#cms_group_group_type_id')[0].value, cms_access_group_ids) < 0) {
+ var cms_access_group_ids = <%= Cms::GroupType.cms_access.all.map{|e| e.id.to_s}.to_json.html_safe %>
+ $('#group_group_type_id').change(function() {
+ if ($.inArray($('#group_group_type_id')[0].value, cms_access_group_ids) < 0) {
$('#permissions').hide()
$('#section-action').text('view')
} else {
@@ -22,7 +22,7 @@
<div class="checkboxes">
<% Cms::Permission.all(:order => "name").each do |p| %>
<div class="checkbox_fields">
- <%= check_box_tag "cms_group[permission_ids][]", p.id, @group.permissions.include?(p), :id => "permission_ids_#{p.id}", :class => "permission_ids" %>
+ <%= check_box_tag "group[permission_ids][]", p.id, @group.permissions.include?(p), :id => "permission_ids_#{p.id}", :class => "permission_ids" %>
<label for="permission_ids_<%= p.id %>" style="width: 400px;#padding-top: 6px;"><%=h p.full_name %></label>
</div>
<div class="instructions"><%=h p.description %></div>
View
4 app/views/cms/groups/_sections.html.erb
@@ -1,10 +1,10 @@
<div class="checkbox_group fields">
<label>Section Permissions</label>
- <%= hidden_field_tag "cms_group[section_ids][]", "" %>
+ <%= hidden_field_tag "group[section_ids][]", "" %>
<div class="checkboxes">
<% Cms::Section.all(:order => "path").each do |s|%>
<div class="checkbox_fields">
- <%= check_box_tag "cms_group[section_ids][]", s.id, @group.sections.include?(s), :id => "section_ids_#{s.id}", :class => "section_ids" %>
+ <%= check_box_tag "group[section_ids][]", s.id, @group.sections.include?(s), :id => "section_ids_#{s.id}", :class => "section_ids" %>
<label for= "section_ids_<%= s.id %>" style="width: 400px; padding-top: 0; #padding-top: 4px;"><%=h s.name %><span style="padding-top: 0; font-weight: lighter; display: inline; float: none;">(Path: <%=h s.path %>)</span></label>
</div>
<% end %>
View
6 app/views/cms/groups/index.html.erb
@@ -2,7 +2,7 @@
<% @toolbar_title = "List Groups" %>
<%= content_for :functions do %>
- <%= link_to(span_tag("Add Group"), new_cms_group_path,
+ <%= link_to(span_tag("Add Group"), new_group_path,
:id => "new_group_button", :class => "button") %>
<% end %>
@@ -12,12 +12,12 @@
<tr>
<th colspan="2" class="first">
<div class="dividers">
- <%= link_to "Name", cms_groups_path(:order => determine_order(params[:order], "#{Cms::Group.table_name}.name")) %>
+ <%= link_to "Name", groups_path(:order => determine_order(params[:order], "#{Cms::Group.table_name}.name")) %>
</div>
</th>
<th>
<div class="dividers">
- <%= link_to "Type", cms_groups_path(:order => determine_order(params[:order], "#{Cms::GroupType.table_name}.name")) %>
+ <%= link_to "Type", groups_path(:order => determine_order(params[:order], "#{Cms::GroupType.table_name}.name")) %>
</div>
</th>
<th colspan="2" class="last"><div class="dividers">Permissions</div></th>
View
2  app/views/cms/links/edit.html.erb
@@ -1,7 +1,7 @@
<% page_title "Edit '#{h(@link.name)}' Link" %>
<%= content_for :functions do %>
<%= "<h1>#{ @page_title }</h1>" %>
-<%= link_to(span_tag("list all"), cms_sitemap_path, :class => "button") %>
+<%= link_to(span_tag("list all"), cms.sitemap_path, :class => "button") %>
<br clear="all"/>
<% end %>
<%= form_for(@link) do |f| %>
View
2  app/views/cms/links/new.html.erb
@@ -1,7 +1,7 @@
<% @link_title = @page_title = "Add New Link to Sitemap" %>
<%= content_for :functions do %>
<%= "<h1>#{ @page_title }</h1>" %>
-<%= link_to(span_tag("list all"), cms_sitemap_path, :class => "button") %>
+<%= link_to(span_tag("list all"), cms.sitemap_path, :class => "button") %>
<br clear="all"/>
<% end %>
<%= form_for(@link) do |f| %>
View
2  app/views/cms/page_routes/edit.html.erb
@@ -1,3 +1,3 @@
<% @toolbar_title = page_title "Edit Page Route" %>
-<%= content_for :functions, link_to(span_tag("List All"), cms_page_routes_path, :class => "button") %>
+<%= content_for :functions, link_to(span_tag("List All"), page_routes_path, :class => "button") %>
<%= render :partial => 'form' %>
View
4 app/views/cms/page_routes/index.html.erb
@@ -20,11 +20,11 @@
<% end %>
<%= content_for :functions do %>
- <%= add_button new_cms_page_route_path %>
+ <%= add_button new_page_route_path %>
<%= edit_button %>
<%= delete_button :title => "Are you sure you want to delete this Page Route?" %>
<%= link_to(span_tag("View"), "#", :id => 'view_button', :class => "button") %>
- <%= link_to(span_tag("View Rails Routes"), cms_routes_path, :class => "button") %>
+ <%= link_to(span_tag("View Rails Routes"), routes_path, :class => "button") %>
<% end %>
<div class="roundedcorners">
View
2  app/views/cms/page_routes/new.html.erb
@@ -1,3 +1,3 @@
<% @toolbar_title = page_title "New Page Route" %>
-<%= content_for :functions, link_to(span_tag("List All"), cms_page_routes_path, :class => "button") %>
+<%= content_for :functions, link_to(span_tag("List All"), page_routes_path, :class => "button") %>
<%= render :partial => 'form' %>
View
8 app/views/cms/page_routes/show.html.erb
@@ -1,10 +1,10 @@
<% @toolbar_title = page_title "'#{@page_route.name}' Page Route" %>
<%= content_for :functions do %>
- <%= add_button new_cms_page_route_path %>
- <%= edit_button :path=>edit_cms_page_route_path(@page_route), :enabled=>true %>
+ <%= add_button new_page_route_path %>
+ <%= edit_button :path=>edit_page_route_path(@page_route), :enabled=>true %>
<%= delete_button :path=>@page_route, :title => "Are you sure you want to delete this Page Route?", :enabled=>true %>
- <%= link_to(span_tag("List All"), cms_page_routes_path, :class => "button") %>
- <%= link_to(span_tag("View Rails Routes"), cms_routes_path, :class => "button") %>
+ <%= link_to(span_tag("List All"), page_routes_path, :class => "button") %>
+ <%= link_to(span_tag("View Rails Routes"), routes_path, :class => "button") %>
<% end %>
<%= @page_route.name %>
View
6 app/views/cms/pages/_edit_connector.html.erb
@@ -3,13 +3,13 @@
<%= link_to image_tag("cms/pages/show_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms_connectable_path(connectable), :title => "View this content (#{connectable.name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
<%= link_to image_tag("cms/pages/edit_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), edit_cms_connectable_path(connectable, :_redirect_to => @page.path), :title => "Edit this content (#{connectable.name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
<% if @page.connectors.for_page_version(@page.version).in_container(connector.container).count > 1 %>
- <%= link_to image_tag("cms/pages/up_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), move_up_cms_connector_path(connector), :class => "http_put", :title => "Move this content up (#{connectable.name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
- <%= link_to image_tag("cms/pages/down_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), move_down_cms_connector_path(connector), :class => "http_put", :title => "Move this content down (#{connectable.name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
+ <%= link_to image_tag("cms/pages/up_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms.move_up_connector_path(connector), :class => "http_put", :title => "Move this content up (#{connectable.name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
+ <%= link_to image_tag("cms/pages/down_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms.move_down_connector_path(connector), :class => "http_put", :title => "Move this content down (#{connectable.name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
<% else %>
<%= image_tag("cms/pages/up_connectable_disabled.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;") %>
<%= image_tag("cms/pages/down_connectable_disabled.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;") %>
<% end %>
- <%= link_to image_tag("cms/pages/delete_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms_connector_path(connector, :_redirect_to => @page.path), :class => "confirm_with_title http_delete", :title => "Remove this content from page (#{connectable.name}). It will remain available in the Content Library." , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
+ <%= link_to image_tag("cms/pages/delete_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms.connector_path(connector, :_redirect_to => @page.path), :class => "confirm_with_title http_delete", :title => "Remove this content from page (#{connectable.name}). It will remain available in the Content Library." , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
<%= status_icon connector.status,
:class => "published_status",
:title => connector.live? ? "This content is published and can be seen by site visitors." : "This content is a draft and won't be seen by site visitors until this page is published." ,
View
4 app/views/cms/pages/_edit_container.html.erb
@@ -1,7 +1,7 @@
<div class="cms_edit_container" style="height: auto; background: url(<%= asset_path "cms/containers/alpha.png" %>) repeat-x 0 0; border: 1px solid #999; margin: -8px 0 0 -8px; padding: 24px 7px 1px 7px; position: relative;">
<div style="display: block; width: 100%; position: absolute; top: 5px; left: 5px; height: 30px;">
- <%= link_to image_tag("cms/pages/add_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms_content_types_path(:connect_to_page_id => @page, :connect_to_container => name), :title => "Add new content to this container (#{name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
- <%= link_to image_tag("cms/pages/connect_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), new_cms_connector_path(:page_id => @page, :container => name), :title => "Insert existing content into this container (#{name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;", :id=>"insert_existing_content_#{name}"%>
+ <%= link_to image_tag("cms/pages/add_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms.content_types_path(:connect_to_page_id => @page, :connect_to_container => name), :title => "Add new content to this container (#{name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;"%>
+ <%= link_to image_tag("cms/pages/connect_connectable.gif", :style => "text-decoration: none; padding: 0; background: none; margin: 0; float: none; border: none;"), cms.new_connector_path(:page_id => @page, :container => name), :title => "Insert existing content into this container (#{name})" , :style => "text-decoration: none; padding: 0 2px 0 0; background: none; margin: 0; float: none; border: none;", :id=>"insert_existing_content_#{name}"%>
<%= image_tag "cms/#{@page.container_published?(name) ? 'published' : 'draft'}_status.gif",
:class => "published_status",
:title => @page.container_published?(name) ? "This content is published and can be seen by site visitors." : "This content is a draft and won't be seen by site visitors until this page is published.",
View
2  app/views/cms/pages/edit.html.erb
@@ -1,7 +1,7 @@
<% page_title "Edit Properties / '#{h(@page.name)}' Page" %>
<%= content_for :functions do%>
<h1><%= @page_title %></h1>
-<%= link_to(span_tag("list all"), cms_sitemap_path, :class => "button") %>
+<%= link_to(span_tag("list all"), cms.sitemap_path, :class => "button") %>
<%= link_to(span_tag("edit content"), @page.path, :class => "button") %>
<br clear="all" />
<% end %>
View
10 app/views/cms/pages/new.html.erb
@@ -1,13 +1,13 @@
<%= content_for :html_head do %>
<script type="text/javascript">
jQuery(function($){
- $("#cms_page_name").keyup(function(){
+ $("#page_name").keyup(function(){
var section = { name: <%= @page.section.name.to_json.html_safe %>, path: <%= @page.section.path.to_json.html_safe %> };
- var page_name = $.trim($("#cms_page_name").val())
+ var page_name = $.trim($("#page_name").val())
if (page_name == section.name || page_name == 'Overview') {
- $("#cms_page_path").val(section.path)
+ $("#page_path").val(section.path)
} else {
- $("#cms_page_path").val(
+ $("#page_path").val(
section.path.replace(/\/$/, '') + "/" + $.cms.slug(page_name)
)
}
@@ -19,7 +19,7 @@ jQuery(function($){
<% page_title "New Page" %>
<%= content_for :functions do %>
<%= "<h1>#{ @page_title }</h1>" %>
-<%= link_to(span_tag("list all"), cms_sitemap_path, :class => "button") %>
+<%= link_to(span_tag("list all"), cms.sitemap_path, :class => "button") %>
<br clear="all"/>
<% end %>
<%= form_for(@page) do |f| %>
View
2  app/views/cms/redirects/index.html.erb
@@ -19,7 +19,7 @@
<% end %>
<% end %>
<%= content_for :functions do %>
- <%= add_button new_cms_redirect_path %>
+ <%= add_button new_redirect_path %>
<%= edit_button %>
<%= delete_button :title => "Are you sure you want to delete this Redirect?" %>
<% end -%>
View
2  app/views/cms/redirects/new.html.erb
@@ -1,3 +1,3 @@
<% @page_title = @toolbar_title = "New Redirect" %>
-<%= content_for :functions, link_to(span_tag("List All"), cms_redirects_path, :class => "button") %>
+<%= content_for :functions, link_to(span_tag("List All"), redirects_path, :class => "button") %>
<%= render :partial => 'form' %>
View
2  app/views/cms/routes/index.html.erb
@@ -4,7 +4,7 @@
<% end %>
<div style="margin: 10px 0">
- <%= form_tag cms_routes_path, :method => :get do %>
+ <%= form_tag routes_path, :method => :get do %>
<label>
Path to Test: <%= text_field_tag :path, @path, :size => 50 %>
</label>
View
8 app/views/cms/sections/_form.html.erb
@@ -14,11 +14,11 @@
<%= able_to?(:administrate) do %>
<div class="checkbox_group fields" style="float: left; width: 100%">
<label>Public Permissions</label>
- <%= hidden_field_tag "cms_section[group_ids][]", "", :id => nil %>
+ <%= hidden_field_tag "section[group_ids][]", "", :id => nil %>
<div class="checkboxes">
<% for group in public_groups %>
<div class="checkbox_fields">
- <%= check_box_tag "cms_section[group_ids][]", group.id,
+ <%= check_box_tag "section[group_ids][]", group.id,
@section.groups.include?(group), :class => "public_group_ids", :id => "public_group_ids_#{group.id}", :tabindex => next_tabindex %>
<label for="public_group_ids_<%= group.id %>"><%= group.name %></label>
</div>
@@ -34,11 +34,11 @@
<div class="checkbox_group fields" style="float: left; width: 100%">
<label>CMS Permissions</label>
- <%= hidden_field_tag "cms_section[group_ids][]", "", :id => nil %>
+ <%= hidden_field_tag "section[group_ids][]", "", :id => nil %>
<div class="checkboxes">
<% for group in cms_groups %>
<div class="checkbox_fields">
- <%= check_box_tag "cms_section[group_ids][]", group.id,
+ <%= check_box_tag "section[group_ids][]", group.id,
@section.groups.include?(group), :class => "cms_group_ids", :id => "cms_group_ids_#{group.id}", :tabindex => next_tabindex %>
<label for="cms_group_ids_<%= group.id %>"><%= group.name %></label>
</div>
View
2  app/views/cms/sections/edit.html.erb
@@ -1,7 +1,7 @@
<% page_title "Edit Properties / '#{h(@section.name)}' Section" %>
<%= content_for :functions do %>
<h1><%= @page_title %></h1>
-<%= link_to(span_tag("list all"), cms_sitemap_path, :class => "button") %>
+<%= link_to(span_tag("list all"), cms.sitemap_path, :class => "button") %>
<br clear="all"/>
<% end %>
<%= form_for(@section) do |f| %>
View
6 app/views/cms/sections/new.html.erb
@@ -1,9 +1,9 @@
<%= content_for :html_head do %>
<script type="text/javascript">
jQuery(function($){
- $("#cms_section_name").keyup(function(){
+ $("#section_name").keyup(function(){
var section_path = "<%= @parent.path %>".replace(/\/$/, '')
- $("#cms_section_path").val(section_path + "/" + $.cms.slug($(this).val()))
+ $("#section_path").val(section_path + "/" + $.cms.slug($(this).val()))
})
})
</script>
@@ -11,7 +11,7 @@ jQuery(function($){
<% page_title "New Section" %>
<%= content_for :functions do %>
<%= "<h1>#{ @page_title }</h1>" %>
-<%= link_to(span_tag("list all"), cms_sitemap_path, :class => "button") %>
+<%= link_to(span_tag("list all"), sitemap_path, :class => "button") %>
<br clear="all"/>
<% end %>
<%= form_for(@section, :id => 'section_form') do |f| %>
View
2  app/views/cms/sessions/new.html.erb
@@ -14,7 +14,7 @@
<% @login ||= "Username" %>
<% @password ||= "Password" %>
-<%= form_tag cms_login_path, :id => 'login_form' do %>
+<%= form_tag cms.login_path, :id => 'login_form' do %>
<div class="field">
<%= text_field_tag 'login', @login, :onfocus => "if(this.value == 'Username') this.value = '';", :onblur => "if(this.value == '') this.value = 'Username';", :tabindex => 1 %>
</div>
View
16 app/views/cms/shared/_admin_sidebar.html.erb
@@ -1,8 +1,8 @@
<div class="first">
<h3>Users</h3>
<ul>
- <li<%= ' class="open"' if @menu_section == 'users' %>><%= link_to "Users", cms_users_path %></li>
- <li<%= ' class="open"' if @menu_section == 'groups' %>><%= link_to "Groups", cms_groups_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'users' %>><%= link_to "Users", users_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'groups' %>><%= link_to "Groups", groups_path %></li>
</ul>
</div>
<div class="bottom_cap bottom_pad"></div>
@@ -11,9 +11,9 @@
<div>
<h3>Templates</h3>
<ul>
- <li<%= ' class="open"' if @menu_section == 'page_partials' %>><%= link_to "Page Partials", cms_page_partials_path %></li>
- <li<%= ' class="open"' if @menu_section == 'page_templates' %>><%= link_to "Page Templates", cms_page_templates_path %></li>
- <li<%= ' class="open"' if @menu_section == 'page_routes' %>><%= link_to "Page Routes", cms_page_routes_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'page_partials' %>><%= link_to "Page Partials", page_partials_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'page_templates' %>><%= link_to "Page Templates", page_templates_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'page_routes' %>><%= link_to "Page Routes", page_routes_path %></li>
</ul>
</div>
<div class="bottom_cap bottom_pad"></div>
@@ -22,9 +22,9 @@
<div>
<h3>Tools</h3>
<ul>
- <li<%= ' class="open"' if @menu_section == 'caching' %>><%= link_to "Page Caching", cms_cache_path %></li>
- <li<%= ' class="open"' if @menu_section == 'redirects' %>><%= link_to "Redirects", cms_redirects_path %></li>
- <li<%= ' class="open"' if @menu_section == 'email_messages' %>><%= link_to "Email Messages", cms_email_messages_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'caching' %>><%= link_to "Page Caching", cache_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'redirects' %>><%= link_to "Redirects", redirects_path %></li>
+ <li<%= ' class="open"' if @menu_section == 'email_messages' %>><%= link_to "Email Messages", email_messages_path %></li>
</ul>
</div>
<div class="bottom_cap"></div>
View
2  app/views/cms/users/_toolbar.html.erb
@@ -12,7 +12,7 @@
<% if @users %>
<div class="box">
- <%= form_tag(cms_users_path, :method => :get ) do %>
+ <%= form_tag(users_path, :method => :get ) do %>
<div><%= text_field_tag "key_word", params[:key_word] %></div><div id="user_search_submit_container">
<%= image_submit_tag "cms/user_search_submit.gif", :alt=>"submit", :id=>"user_search_submit" %>
</div>
View
4 app/views/cms/users/change_password.html.erb
@@ -1,8 +1,8 @@
<% @page_title = @toolbar_title = "Set New Password" %>
<%= able_to? :administrate do %>
<%= content_for :toolbar_links do %>
- <%= link_to(span_tag("List All"), url_for(:controller => "users", :action => "index"), :id => "list_all_button", :class => "button") %>
- <%= link_to(span_tag("Edit User"), url_for(:controller => "users", :action => "edit", :id => @user.id), :id => "edit_user_button", :class => "button") %>
+ <%= link_to(span_tag("List All"), users_path, :id => "list_all_button", :class => "button") %>
+ <%= link_to(span_tag("Edit User"), edit_user_path(@user), :id => "edit_user_button", :class => "button") %>
<% end %>
<%= content_for :functions, render(:partial => "toolbar") %>
View
2  app/views/cms/users/edit.html.erb
@@ -1,7 +1,7 @@
<% @page_title = @toolbar_title = "Edit User '#{h(@user.login)}'" %>
<%= content_for :toolbar_links do %>
- <%= link_to(span_tag("List All"), cms_users_path,
+ <%= link_to(span_tag("List All"), users_path,
:id => "list_all_button",
:class => "button") %>
<%= link_to(span_tag("Change Password"), [:change_password, @user],
View
4 app/views/cms/users/index.html.erb
@@ -2,7 +2,7 @@
<% @toolbar_title = "List Users" %>
<%= content_for :toolbar_links do %>
- <%= link_to(span_tag("ADD USER"), new_cms_user_path,
+ <%= link_to(span_tag("ADD USER"), new_user_path,
:id => "add_user_button",
:class => "button") %>
<% end %>
@@ -26,7 +26,7 @@
<% @users.each do |user|%>
<tr>
<td class="first"></td>
- <td><div class="dividers"><%= link_to "#{user.full_name_or_login}", edit_cms_user_path(user) %></div></td>
+ <td><div class="dividers"><%= link_to "#{user.full_name_or_login}", edit_user_path(user) %></div></td>
<td><div class="dividers"><%= link_to user.email, "mailto:#{user.email}" %></div></td>
<td>
<div class="dividers">
View
2  app/views/cms/users/new.html.erb
@@ -1,7 +1,7 @@
<% @page_title = @toolbar_title = "New User" %>
<%= content_for :toolbar_links do %>
- <%= link_to(span_tag("List All"), cms_users_path,
+ <%= link_to(span_tag("List All"), users_path,
:id => "list_all_button",
:class => "button") %>
<% end %>
View
2  app/views/cms/users/show.html.erb
@@ -1,7 +1,7 @@
<% @page_title = @toolbar_title = h(@user.login) %>
<%= content_for :toolbar_links do %>
- <%= link_to(span_tag("List All"), cms_users_path,
+ <%= link_to(span_tag("List All"), users_path,
:id => "list_all_button",
:class => "button") if current_user.able_to?(:administrate) %>
<%= link_to(span_tag("Change Password"), [:change_password, @user],
View
12 app/views/layouts/_cms_toolbar.html.erb
@@ -2,14 +2,14 @@
<div id="nav">
<h1><%= link_to image_tag("cms/browsercms_logo.png"), "/", :target => "_top" %></h1>
<ul id="section">
- <li><%= link_to image_tag("cms/nav_dash#{'_on' if tab == :dashboard}.gif", :id => 'nav_dash_img'), cms_dashboard_path, :target => "_top" %></li>
- <%= able_to?(:edit_content, :publish_content) do %><li><%= link_to image_tag("cms/nav_sitemap#{'_on' if tab == :sitemap}.gif", :id => 'nav_sitemap_img'), cms_sitemap_path, :target => "_top" %></li><% end %>
- <%= able_to?(:edit_content, :publish_content) do %><li><%= link_to image_tag("cms/nav_content_library#{'_on' if tab == :content_library}.gif", :id => 'nav_content_library_img'), cms_content_library_path, :target => "_top" %></li><% end %>
- <%= able_to?(:administrate) do %><li><%= link_to image_tag("cms/nav_admin#{'_on' if tab == :administration}.gif", :id => 'nav_admin_img'), cms_administration_path, :target => "_top" %></li><% end %>
+ <li><%= link_to image_tag("cms/nav_dash#{'_on' if tab == :dashboard}.gif", :id => 'nav_dash_img'), cms.dashboard_path, :target => "_top" %></li>
+ <%= able_to?(:edit_content, :publish_content) do %><li><%= link_to image_tag("cms/nav_sitemap#{'_on' if tab == :sitemap}.gif", :id => 'nav_sitemap_img'), cms.sitemap_path, :target => "_top" %></li><% end %>
+ <%= able_to?(:edit_content, :publish_content) do %><li><%= link_to image_tag("cms/nav_content_library#{'_on' if tab == :content_library}.gif", :id => 'nav_content_library_img'), cms.content_library_path, :target => "_top" %></li><% end %>
+ <%= able_to?(:administrate) do %><li><%= link_to image_tag("cms/nav_admin#{'_on' if tab == :administration}.gif", :id => 'nav_admin_img'), cms.administration_path, :target => "_top" %></li><% end %>
</ul>
<ul id="userlinks">
- <li id="user_info"><a href="<%= current_user.able_to?(:administrate) ? edit_cms_user_path(current_user) : cms_user_path(current_user) %>" target="_top"><%= image_tag "cms/icons/user.png" %> <%= current_user.full_name %></a></li>
- <li><%= link_to "Logout", cms_logout_path, :class => "http_delete", :target => "_top" %></li>
+ <li id="user_info"><a href="<%= current_user.able_to?(:administrate) ? cms.edit_user_path(current_user) : cms.user_path(current_user) %>" target="_top"><%= image_tag "cms/icons/user.png" %> <%= current_user.full_name %></a></li>
+ <li><%= link_to "Logout", cms.logout_path, :class => "http_delete", :target => "_top" %></li>
</ul>
<% flash_class, flash_message = flash.to_a.first %>
<div id="flash" style="display: none">
View
12 app/views/layouts/_page_toolbar.html.erb
@@ -16,7 +16,7 @@
<div class="page_attribute_label">Section:</div>
<div class="page_attribute_value_container">
<%= image_tag "cms/page_toolbar/page_toolbar_inset_l.gif", :style => "float: left;" %>
- <div id="section_link" class="page_attribute_value"><%= link_to h(@page.section.name), cms_sections_path(:page_id => @page), :target => "_top" %></div>
+ <div id="section_link" class="page_attribute_value"><%= link_to h(@page.section.name), cms.sections_path(:page_id => @page), :target => "_top" %></div>
<%= image_tag "cms/page_toolbar/page_toolbar_inset_r.gif", :style => "float: left;" %>
</div>
</div>
@@ -48,19 +48,19 @@
<div class="buttons">
<%= link_to "<span>Publish</span>".html_safe,
- @page.live? ? '#' : publish_cms_page_path(@page),
+ @page.live? ? '#' : cms.publish_page_path(@page),
:id => "publish_button",
:class => "http_put button#{' disabled' if !current_user.able_to?(:publish_content) || !current_user.able_to_edit?(@page) || @page.version != @page.draft.version || @page.live?} left",
:target => "_top" %>
<%= link_to "<span>Assign</span>".html_safe,
- new_cms_page_task_path(@page),
+ cms.new_page_task_path(@page),
:id => "assign_button",
:class => "button#{ ' disabled' if @page.assigned_to == current_user || !current_user.able_to_edit?(@page) } middle",
:target => "_top" %>
<%= link_to "<span>Complete Task</span>".html_safe,
- @page.current_task ? complete_cms_task_path(@page.current_task) : '#',
+ @page.current_task ? cms.complete_task_path(@page.current_task) : '#',
:id => "complete_task_button",
:class => "http_put button#{ ' disabled' if @page.assigned_to != current_user || !current_user.able_to_edit?(@page) } right",
:target => "_top" %>
@@ -72,7 +72,7 @@
:target => "_top" %>
<%= link_to "<span>List Versions</span>".html_safe,
- versions_cms_page_path(@page),
+ cms.versions_page_path(@page),
:class => "spacer button#{ ' disabled' unless current_user.able_to_edit?(@page) }",
:target => "_top" %>
@@ -86,7 +86,7 @@
:class => "spacer button confirm_with_title http_delete#{ ' disabled' unless current_user.able_to_publish?(@page) }" %>
<% else %>
<%= link_to "<span>Revert to this Version</span>".html_safe,
- revert_to_cms_page_path(@page, @page.version),
+ cms.revert_to_page_path(@page, @page.version),
:id => "revert_button",
:class => "button http_put",
:target => "_top" %>
View
14 app/views/layouts/browsercms/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Browsercms</title>
+ <%= stylesheet_link_tag "browsercms/application" %>
+ <%= javascript_include_tag "browsercms/application" %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
View
4 app/views/portlets/login/render.html.erb
@@ -2,11 +2,11 @@
<% if logged_in? %>
<p>Welcome, <%= current_user.login %></p>
<p><%= link_to "Logout", '' %></p>
- <p><%#= link_to "Logout", cms_logout_path %></p>
+ <p><%#= link_to "Logout", cms.logout_path %></p>
<% else %>
<div class="error"><%= flash[:login_error] %></div>
<%= form_tag '' do %>
- <%#= form_tag cms_login_path do %>
+ <%#= form_tag cms.login_path do %>
<%= hidden_field_tag :success_url, @success_url %>
<%= hidden_field_tag :failure_url, @failure_url %>
<p>
View
2  app/views/portlets/portlets/_form.html.erb
@@ -9,7 +9,7 @@
link_params["#{portlet_type.underscore}[connect_to_container]"] = params[:portlet][:connect_to_container]
end
%>
- <%= link_to h(portlet_type.titleize), new_cms_portlet_path(link_params) %>
+ <%= link_to h(portlet_type.titleize), new_portlet_path(link_params) %>
</div>
<% end %>
<% @hide_buttons = true %>
View
2  bin/bcms
@@ -104,7 +104,7 @@ CODE
gem 'browsercms', :version=>::Cms::VERSION
generate :jdbc if defined?(JRUBY_VERSION)
- route "routes_for_browser_cms"
+ route "mount_browsercms"
generate "browser_cms:cms"
environment 'SITE_DOMAIN="localhost:3000"', :env => "development"
View
2  bin/bcms-upgrade