Skip to content
Browse files

Merge branch 'master' of git://github.com/resolve/refinerycms

  • Loading branch information...
2 parents f70cd16 + e82c7f5 commit a4ed7d928661c636315c6bc7d16ab1c462415e5b @bofrede bofrede committed
Showing with 593 additions and 298 deletions.
  1. +4 −0 .gitignore
  2. +11 −2 Gemfile
  3. +19 −17 Gemfile.lock
  4. +1 −2 bin/refinerycms
  5. +59 −2 changelog.md
  6. +13 −3 refinerycms.gemspec
  7. +8 −36 todo.md
  8. +2 −2 vendor/refinerycms/authentication/config/locales/en.yml
  9. +4 −4 vendor/refinerycms/authentication/config/locales/zh-CN.yml
  10. +2 −2 vendor/refinerycms/authentication/features/manage_users.feature
  11. +22 −12 vendor/refinerycms/core/app/views/layouts/application.html.erb
  12. +3 −3 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
  13. +2 −2 vendor/refinerycms/core/app/views/shared/_draft_page_message.html.erb
  14. +1 −3 vendor/refinerycms/core/app/views/shared/_footer.html.erb
  15. +1 −1 vendor/refinerycms/core/app/views/shared/_google_analytics.html.erb
  16. +5 −7 vendor/refinerycms/core/app/views/shared/_head.html.erb
  17. +1 −3 vendor/refinerycms/core/app/views/shared/_header.html.erb
  18. +10 −4 vendor/refinerycms/core/app/views/shared/_html5_for_ie.js.erb
  19. +7 −3 vendor/refinerycms/core/app/views/shared/_menu.html.erb
  20. +6 −6 vendor/refinerycms/core/app/views/shared/_menu_branch.html.erb
  21. +5 −5 vendor/refinerycms/core/config/locales/en.yml
  22. +2 −2 vendor/refinerycms/core/config/locales/zh-CN.yml
  23. +21 −16 vendor/refinerycms/core/engines.md
  24. +3 −0 vendor/refinerycms/core/features/search.feature
  25. +1 −1 vendor/refinerycms/core/features/step_definitions/core_steps.rb
  26. +76 −0 vendor/refinerycms/core/lib/core.rb
  27. +5 −50 vendor/refinerycms/core/lib/generators/refinery_engine/refinery_engine_generator.rb
  28. +2 −2 ...cms/core/lib/generators/refinery_engine/templates/app/controllers/admin/plural_name_controller.rb
  29. +1 −3 ...or/refinerycms/core/lib/generators/refinery_engine/templates/app/views/plural_name/index.html.erb
  30. +2 −6 vendor/refinerycms/core/lib/generators/refinery_engine/templates/app/views/plural_name/show.html.erb
  31. +4 −0 vendor/refinerycms/core/lib/generators/refinery_engine/templates/config/locales/en.yml
  32. 0 ...nery_engine/templates/db/migrate/{migration_number_create_plural_name.rb → create_plural_name.rb}
  33. +2 −2 vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
  34. +6 −0 ...core/lib/generators/refinery_engine/templates/lib/generators/refinerycms_plural_name_generator.rb
  35. +4 −0 vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/plural_name.rb
  36. +13 −0 vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/tasks/plural_name.rake
  37. 0 vendor/refinerycms/core/lib/generators/refinery_engine/templates/public/.gitkeep
  38. +10 −0 vendor/refinerycms/core/lib/generators/refinery_engine/templates/readme.md
  39. +9 −1 vendor/refinerycms/core/lib/refinery/crud.rb
  40. +5 −4 vendor/refinerycms/core/lib/refinery/helpers/image_helper.rb
  41. +1 −1 vendor/refinerycms/core/lib/refinery/helpers/site_bar_helper.rb
  42. +1 −1 vendor/refinerycms/core/public/javascripts/refinery/admin.js
  43. +17 −8 vendor/refinerycms/core/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
  44. +2 −2 vendor/refinerycms/core/public/stylesheets/refinery/application.css
  45. +3 −3 vendor/refinerycms/core/public/stylesheets/refinery/formatting.css
  46. +2 −2 vendor/refinerycms/core/public/stylesheets/refinery/refinery.css
  47. +1 −1 vendor/refinerycms/dashboard/config/locales/en.yml
  48. +1 −1 vendor/refinerycms/dashboard/config/locales/zh-CN.yml
  49. +1 −1 vendor/refinerycms/dashboard/features/dashboard.feature
  50. +1 −1 vendor/refinerycms/images/app/controllers/admin/images_controller.rb
  51. +2 −2 vendor/refinerycms/images/config/locales/en.yml
  52. +2 −2 vendor/refinerycms/images/config/locales/zh-CN.yml
  53. +4 −4 vendor/refinerycms/images/features/manage_images.feature
  54. +23 −0 vendor/refinerycms/images/lib/images.rb
  55. +2 −1 vendor/refinerycms/pages/app/models/page.rb
  56. +6 −0 vendor/refinerycms/pages/app/views/admin/pages/_form.html.erb
  57. +1 −0 vendor/refinerycms/pages/app/views/admin/pages/_form_fields_after_title.html.erb
  58. +3 −3 vendor/refinerycms/pages/config/locales/en.yml
  59. +4 −4 vendor/refinerycms/pages/config/locales/ru.yml
  60. +2 −2 vendor/refinerycms/pages/config/locales/zh-CN.yml
  61. +7 −10 vendor/refinerycms/pages/config/routes.rb
  62. +5 −5 vendor/refinerycms/pages/features/manage_pages.feature
  63. +1 −0 vendor/refinerycms/pages/features/step_definitions/page_steps.rb
  64. +39 −5 vendor/refinerycms/pages/spec/models/page_spec.rb
  65. +6 −5 vendor/refinerycms/refinery.rb
  66. +1 −1 vendor/refinerycms/resources/features/manage_files.feature
  67. +23 −0 vendor/refinerycms/resources/lib/resources.rb
  68. +16 −12 vendor/refinerycms/settings/app/controllers/admin/refinery_settings_controller.rb
  69. +3 −0 vendor/refinerycms/settings/app/models/refinery_setting.rb
  70. +37 −14 vendor/refinerycms/settings/app/views/admin/refinery_settings/index.html.erb
  71. +1 −1 vendor/refinerycms/settings/config/locales/en.yml
  72. +9 −0 vendor/refinerycms/settings/features/step_definitions/setting_steps.rb
  73. +14 −0 vendor/refinerycms/settings/features/support/paths.rb
View
4 .gitignore
@@ -71,3 +71,7 @@ config/amazon_s3.yml
config/rackspace_cloudfiles.yml
# END REFINERY CMS DEVELOPMENT =================================================
+
+# sass
+.sass-cache
+.sass-cache/*
View
13 Gemfile
@@ -36,13 +36,13 @@ gem 'mysql', '2.8.1'
gem 'refinerycms', :path => '.'
# Specify additional Refinery CMS Engines here (all optional):
-gem 'refinerycms-inquiries', '~> 0.9.8.7'
+gem 'refinerycms-inquiries', '~> 0.9.8.8'
# gem 'refinerycms-news', '~> 0.9.9'
# gem 'refinerycms-portfolio', '~> 0.9.8'
# gem 'refinerycms-theming', '~> 0.9.8'
# Add i18n support (optional, you can remove this if you really want to).
-gem 'refinerycms-i18n', '~> 0.9.8.6', :require => 'refinery/i18n'
+gem 'refinerycms-i18n', '~> 0.9.8.7'
# Figure out how to get RMagick:
rmagick_options = {:require => false}
@@ -86,4 +86,13 @@ group :test do
gem 'autotest-notification'
end
+#===REFINERY END OF REQUIRED GEMS===
+
+#===REQUIRED FOR REFINERY GEM INSTALL===
+# Leave the gem below disabled (commented out) if you're not using the gem install method.
+# gem 'refinerycms', '~> 0.9.7.12'
+#===END OF REFINERY GEM INSTALL REQUIREMENTS===
+
+# Bundle gems for certain environments:
+
# END REFINERY CMS DEVELOPMENT =================================================
View
36 Gemfile.lock
@@ -8,7 +8,7 @@ GIT
PATH
remote: .
specs:
- refinerycms (0.9.8.3)
+ refinerycms (0.9.8.5)
acts_as_indexed (~> 0.6.6)
authlogic (~> 2.1.6)
bundler (~> 1.0.0)
@@ -89,7 +89,7 @@ GEM
factory_girl (1.3.2)
ffi (0.6.3)
rake (>= 0.8.7)
- filters_spam (0.2)
+ filters_spam (0.3)
friendly_id (3.1.6)
babosa (~> 0.2.0)
gherkin (2.1.5)
@@ -99,7 +99,7 @@ GEM
launchy (0.3.7)
configuration (>= 0.0.5)
rake (>= 0.8.1)
- mail (2.2.5)
+ mail (2.2.6.1)
activesupport (>= 2.3.6)
mime-types
treetop (>= 1.4.5)
@@ -128,24 +128,26 @@ GEM
rake (>= 0.8.4)
thor (~> 0.14.0)
rake (0.8.7)
- refinerycms-i18n (0.9.8.6)
- refinerycms (~> 0.9.8)
+ refinerycms-i18n (0.9.8.7)
+ refinerycms (>= 0.9.8)
routing-filter (~> 0.1.6)
- refinerycms-inquiries (0.9.8.7)
+ refinerycms-inquiries (0.9.8.8)
filters_spam (~> 0.2)
rmagick (2.12.2)
routing-filter (0.1.6)
actionpack
- rspec (2.0.0.beta.20)
- rspec-core (= 2.0.0.beta.20)
- rspec-expectations (= 2.0.0.beta.20)
- rspec-mocks (= 2.0.0.beta.20)
- rspec-core (2.0.0.beta.20)
- rspec-expectations (2.0.0.beta.20)
+ rspec (2.0.0.beta.22)
+ rspec-core (= 2.0.0.beta.22)
+ rspec-expectations (= 2.0.0.beta.22)
+ rspec-mocks (= 2.0.0.beta.22)
+ rspec-core (2.0.0.beta.22)
+ rspec-expectations (2.0.0.beta.22)
diff-lcs (>= 1.1.2)
- rspec-mocks (2.0.0.beta.20)
- rspec-rails (2.0.0.beta.20)
- rspec (= 2.0.0.beta.20)
+ rspec-mocks (2.0.0.beta.22)
+ rspec-core (= 2.0.0.beta.22)
+ rspec-expectations (= 2.0.0.beta.22)
+ rspec-rails (2.0.0.beta.22)
+ rspec (= 2.0.0.beta.22)
ruby-prof (0.9.2)
rubyzip (0.9.4)
selenium-webdriver (0.0.28)
@@ -182,8 +184,8 @@ DEPENDENCIES
rack-test!
rails (~> 3.0.0)
refinerycms!
- refinerycms-i18n (~> 0.9.8.6)
- refinerycms-inquiries (~> 0.9.8.7)
+ refinerycms-i18n (~> 0.9.8.7)
+ refinerycms-inquiries (~> 0.9.8.8)
rmagick (~> 2.12.0)
rspec (~> 2.0.0.beta)
rspec-core (~> 2.0.0.beta)
View
3 bin/refinerycms
@@ -14,7 +14,6 @@ end
require 'pathname'
require 'fileutils'
require 'optparse'
-require 'rbconfig'
# Load refinerycms
require Pathname.new(File.expand_path(File.dirname(__FILE__) << "/..")).join('vendor', 'refinerycms', 'refinery.rb')
@@ -241,7 +240,7 @@ module Refinery
to_run << "cd \"#{@app_path}\" &&" if options[:cd]
to_run << command
- if RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
+ if Refinery::WINDOWS
to_run = %w(cmd /c) | to_run.map{|c| c.gsub(/\//m, '\\')}
end
View
61 changelog.md
@@ -1,8 +1,65 @@
+## 0.9.8.5 [21 September 2010](http://github.com/parndt)
+* Fixed an issue with the engine generator that was putting a comma in the wrong place breaking the call to ``crudify``. [Maarten Hoogendoorn](http://github.com/moretea)
+* Made the delete messages consistent. [Uģis Ozols](http://github.com/ugisozols)
+* ``zh-CN`` was overriding en locale in core locale file, fixed. [Philip Arndt](http://github.com/parndt)
+* Changed verbiage from created to added, create to add as it describes it better for things like images. [Philip Arndt](http://github.com/parndt)
+* ``image_fu`` no longer gives you the width and height of the image due to performance problems. [Philip Arndt](http://github.com/parndt) and [David Jones](http://github.com/djones)
+* Implemented a standardised API for the engine generator. The core now includes a standard engine install generator. Engines generate a readme file explaining how to build an engine as a gem. [David Jones](http://github.com/djones)
+* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8.4...0.9.8.5)
+
+## 0.9.8.4 [17 September 2010]
+* Recursive deletion of page parts. [primerano](http://github.com/primerano)
+* Move around the default pages. [Philip Arndt](http://github.com/parndt)
+* Extraction of windows check to ``Refinery::WINDOWS``. [Steven Heidel](http://github.com/stevenheidel)
+* Updated the changelog for several previous releases. [Steven Heidel](http://github.com/stevenheidel)
+* Made the menu more flexible so that it can be used in many places in your layout without caching over the top of itself. [Philip Arndt](http://github.com/parndt)
+* Added search feature to Refinery Settings. [Matt McMahand](http://github.com/invalidusrname)
+* Ensure that in ``crudify`` that we use ``:per_page`` properly for ``will_paginate``. [Philip Arndt](http://github.com/parndt)
+* Reduce the number of routes that we respond to in the ``pages`` engine as they were unused. [Philip Arndt](http://github.com/parndt)
+* Fixed a case where page links weren't generating properly when inside an engine such as the news engine which made use of ``params[:id]``. Took a lot of perserverance on the part of Hez - thank you very much Hez! [Hez Ronningen](http://github.com/hez) and [Philip Arndt](http://github.com/parndt)
+* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8.3...0.9.8.4)
+
+## 0.9.8.3 [14 September 2010]
+* German translation improvements. [Andre Lohan](http://github.com/dc5ala)
+* Fix bug with ``bin/refinerycms`` and windows commands. [Philip Arndt](http://github.com/parndt)
+* DRY up ``crudify`` and also switch to ARel. [Philip Arndt](http://github.com/parndt)
+* Several fixes to make things much easier on windows. [Philip Arndt](http://github.com/parndt)
+* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8.2...0.9.8.3)
+
+## 0.9.8.2 [13 September 2010]
+* Update ``readme.md`` [David Jones](http://github.com/djones)
+* Speed improvements to menu with nested_set. [Maarten Hoogendoorn](http://github.com/moretea)
+* More speed improvements by optimising slugs. [Philip Arndt](http://github.com/parndt)
+* Fix ``-h`` flag on ``bin/refinerycms`` to display the help. [Steven Heidel](http://github.com/stevenheidel)
+* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8.1...0.9.8.2)
+
+## 0.9.8.1 [9 September 2010]
+* Convert to ``awesome_nested_set``. [Maarten Hoogendoorn](http://github.com/moretea) and [Philip Arndt](http://github.com/parndt)
+* Allow passing ``-g`` to the bin task for extra gems. [Tomás Senart](http://github.com/tsenart)
+* Update documentation for engines, not plugins. [David Jones](http://github.com/djones)
+* Several more documentation fixes. [Steven Heidel](http://github.com/stevenheidel)
+* Better use of dragonfly resizing. [Philip Arndt](http://github.com/parndt)
+* Partial Latvian translation. [Uģis Ozols](http://github.com/ugisozols)
+* Review Portugese translation. [Kivanio Barbosa](http://github.com/kivanio)
+* Bugfix with wymeditor in the engine generator. [Karmen Blake](http://github.com/kblake)
+* Split ``application_helper`` into smaller, more usable files. [Philip Arndt](http://github.com/parndt)
+* Move features and specs to each engine directory. [Philip Arndt](http://github.com/parndt)
+* Bugfixes to ensure that reordering works under ``awesome_nested_set``. [Maarten Hoogendoorn](http://github.com/moretea) and [Philip Arndt](http://github.com/parndt)
+* Update engines to not have a special :require in the Gemfile. [Johan Bruning](http://github.com/GidoGeek)
+* Make cache sweepers work. [Philip Arndt](http://github.com/parndt)
+* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8...0.9.8.1)
+
## 0.9.8 [30 August 2010]
-* Rails 3 support.
-* [See full list](http://github.com/resolve/refinerycms/compare/0.9.7.13...0.9.8)
+* Rails 3 support!
+ - [Philip Arndt](http://github.com/parndt)
+ - [Alex Coles](http://github.com/myabc)
+ - [Steven Heidel](http://github.com/stevenheidel)
+ - [David Jones](http://github.com/djones)
+ - [Uģis Ozols](http://github.com/ugisozols)
+ - [Maarten Hoogendoorn](http://github.com/moretea)
* [See our blog post](http://refinerycms.com/blog/refinery-cms-supports-rails-3)
+* [See full list](http://github.com/resolve/refinerycms/compare/0.9.7.13...0.9.8)
## 0.9.7.13 [23 August 2010]
View
16 refinerycms.gemspec
@@ -2,9 +2,9 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms}
- s.version = %q{0.9.8.3}
+ s.version = %q{0.9.8.5}
s.description = %q{A Ruby on Rails CMS that supports Rails 3. It's easy to extend and sticks to 'the Rails way' where possible.}
- s.date = %q{2010-09-15}
+ s.date = %q{2010-09-21}
s.summary = %q{A Ruby on Rails CMS that supports Rails 3}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
@@ -277,11 +277,17 @@ Gem::Specification.new do |s|
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/config/routes.rb',
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/db',
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/migrate',
- 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/migrate/migration_number_create_plural_name.rb',
+ 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/migrate/create_plural_name.rb',
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds',
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb',
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib',
+ 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/generators',
+ 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/generators/refinerycms_plural_name_generator.rb',
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/plural_name.rb',
+ 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/tasks',
+ 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/tasks/plural_name.rake',
+ 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/public',
+ 'vendor/refinerycms/core/lib/generators/refinery_engine/templates/readme.md',
'vendor/refinerycms/core/lib/generators/refinery_engine/templates/refinerycms-plural_name.gemspec',
'vendor/refinerycms/core/lib/refinery',
'vendor/refinerycms/core/lib/refinery/activity.rb',
@@ -876,6 +882,7 @@ Gem::Specification.new do |s|
'vendor/refinerycms/pages/app/views/admin/pages/_form.html.erb',
'vendor/refinerycms/pages/app/views/admin/pages/_form_advanced_options.html.erb',
'vendor/refinerycms/pages/app/views/admin/pages/_form_advanced_options_seo.html.erb',
+ 'vendor/refinerycms/pages/app/views/admin/pages/_form_fields_after_title.html.erb',
'vendor/refinerycms/pages/app/views/admin/pages/_form_new_page_parts.html.erb',
'vendor/refinerycms/pages/app/views/admin/pages/_form_page_parts.html.erb',
'vendor/refinerycms/pages/app/views/admin/pages/_page.html.erb',
@@ -1001,6 +1008,9 @@ Gem::Specification.new do |s|
'vendor/refinerycms/settings/features',
'vendor/refinerycms/settings/features/manage_refinery_settings.feature',
'vendor/refinerycms/settings/features/step_definitions',
+ 'vendor/refinerycms/settings/features/step_definitions/setting_steps.rb',
+ 'vendor/refinerycms/settings/features/support',
+ 'vendor/refinerycms/settings/features/support/paths.rb',
'vendor/refinerycms/settings/lib',
'vendor/refinerycms/settings/lib/settings.rb',
'vendor/refinerycms/settings/readme.md'
View
44 todo.md
@@ -1,33 +1,14 @@
# Todos required for 0.9.9 release
-## Engine API
-
-Responsible person: ``djones``
-
-rails g refinery_engine does the following things:
-
-- Creates what it does now
-- Creates a gemspec with the gem name of "refinerycms-#{engine_name}"
-- Puts the gem in the Gemfile
-- Copies db files to the vendor/engines/engine_name/db folder ONLY
-- Creates a generator in lib/generators which will install the db to the right place
-- Creates a public, spec, and features empty folders
-- Creates lib/tasks as a template
-- Maybe some sort of README on how to release your gem open source
-
-Then the process will be:
-
-### To create a fully releasable engine
-
- rails g refinery_engine events name:string date:date picture:image
-
-### To install the plugin into your app
+## Solid Test Coverage
- rails g refinerycms_events
- bundle install
- rake db:migrate
+Responsible person: ``VGoff``, ``hubble``
-And then when it's released all new refinerycms- gems will have the same install process. Yippee!
+* Add more Cucumber features for the whole of Refinery.
+* Add RSpec for the whole of Refinery, particularly:
+ - User, User engine and User mailer
+ - Inquiry mailer
+ - Refinery settings
## Internet Explorer 7+ Support
@@ -35,19 +16,10 @@ Responsible person: ``parndt``
* WYMEditor and the dialogs are the weakest areas right now.
-Responsible person: ``stevenheidel``, ``djones``
+Responsible person: ``stevenheidel``, ``djones``, ``everyone``
* Finding and filing issues found in IE
-## Solid Test Coverage
-
-Responsible person: ``VGoff``
-
-* Add more Cucumber features for the whole of Refinery.
-* Add RSpec for the whole of Refinery, particularly:
- - User, User plugin and User mailer
- - Inquiry mailer and Inquiry setting
-
## I18n support
* Check all the views for missing translations
View
4 vendor/refinerycms/authentication/config/locales/en.yml
@@ -13,10 +13,10 @@ en:
blank_password_keeps_current: Leaving password blank keeps the current password
enable_all: enable all
index:
- create_new_user: Create New User
+ create_new_user: Add New User
user:
email_user: Email this user
- preview: (%{who}) created %{created_at}
+ preview: (%{who}) added %{created_at}
sessions:
login_successful: Logged in successfully
new:
View
8 vendor/refinerycms/authentication/config/locales/zh-CN.yml
@@ -10,14 +10,14 @@ zh-CN:
blank_password_keeps_current: Leaving password blank keeps the current password
enable_all: enable all
index:
- create_new_user: Create New User
- no_users_yet: There are no users yet. Click "Create New User" to add your first user.
+ create_new_user: Add New User
+ no_users_yet: There are no users yet. Click "Add New User" to add your first user.
user:
confirm_delete_message: "Are you sure you want to delete '%{who}'?"
confirm_delete_title: Remove this user forever
edit_user: Edit this user
email_user: Email this user
- preview: (%{who}) created %{created_at}
+ preview: (%{who}) added %{created_at}
sessions:
login_successful: Logged in successfully
login_failed: Sorry, your password or username was incorrect.
@@ -51,7 +51,7 @@ zh-CN:
please_activate: Please activate your new account
activated: Your account has been activated!
activated_email: "%{who}, your account has been activated. You may now start adding your plugins:"
- account_created: Your account has been created.
+ account_created: Your account has been added.
user_name: Username %{name}
password: Password %{password}
visit_url: "Visit this url to activate your account:"
View
4 vendor/refinerycms/authentication/features/manage_users.feature
@@ -34,14 +34,14 @@ Feature: Manage Users
Given I have a user named "resolve"
And I am a logged in refinery user
When I go to the list of users
- And I follow "Create New User"
+ And I follow "Add New User"
And I fill in "Login" with "cucumber"
And I fill in "Email" with "green@cucumber.com"
And I fill in "Password" with "greenandjuicy"
And I fill in "Password confirmation" with "greenandjuicy"
And I press "Save"
Then I should be on the list of users
- And I should see "cucumber was successfully created."
+ And I should see "cucumber was successfully added."
And I should see "cucumber (green@cucumber.com)"
Scenario: Edit User
View
34 vendor/refinerycms/core/app/views/layouts/application.html.erb
@@ -2,21 +2,31 @@
<html>
<% site_bar = render(:partial => "/shared/site_bar", :locals => {:head => true}) -%>
<%= render :partial => "/shared/head" %>
+<% if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
+ <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
+ <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
+ <!--[if IE 7 ]> <body class="ie7"> <![endif]-->
+ <!--[if IE 8 ]> <body class="ie8"> <![endif]-->
+ <!--[if IE 9 ]> <body class="ie9"> <![endif]-->
+ <!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->
+<% else -%>
<body>
+<% end -%>
<%= site_bar -%>
<%= render :partial => "/shared/ie6check" if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
- <div id='page_container'>
- <div id='page'>
- <div id='header'>
- <%= render :partial => "/shared/header" %>
- </div>
- <div id='body' class='clearfix'>
- <%= yield %>
- </div>
- <div id='footer'>
- <%= render :partial => "/shared/footer" %>
- </div>
- </div>
+ <div id="page_container">
+ <header id='header'>
+ <%= render :partial => "/shared/header" -%>
+ </header>
+ <section id='page'>
+ <%= yield %>
+ </section>
+ <footer id='footer'>
+ <%= render :partial => "/shared/footer" -%>
+ </footer>
</div>
+
+ <%= yield :head_libraries -%>
+ <%= yield :head -%>
</body>
</html>
View
6 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
@@ -24,7 +24,7 @@
unless section[:html].blank?
unless section[:title]
- section[:html] = "<div class='clearfix' id='#{dom_id}'>#{section[:html]}</div>"
+ section[:html] = "<section id='#{dom_id}'>#{section[:html]}</section>"
else
section[:html] = "<h1 id='#{dom_id}'>#{section[:html]}</h1>"
end
@@ -33,9 +33,9 @@
end
end
-%>
-<div id='body_content' class='clearfix<%= " #{css.join(' ')}" if css.any? %>'>
+<section id='body_content'<%= " class='#{css.join(' ')}'" if css.any? %>>
<% sections.each do |s| %>
<%= s[:html].to_s.html_safe %>
<% end %>
-</div>
+</section>
<%= render :partial => '/shared/draft_page_message' unless @page.nil? or @page.live? -%>
View
4 vendor/refinerycms/core/app/views/shared/_draft_page_message.html.erb
@@ -1,3 +1,3 @@
-<div class='page_not_live'>
+<aside class='page_not_live'>
<%= t('.not_live') %>
-</div>
+</aside>
View
4 vendor/refinerycms/core/app/views/shared/_footer.html.erb
@@ -1,5 +1,3 @@
-<div id='footer_content'>
<p>
<%= t('.copyright').html_safe -%> <%= Time.now.year -%> <%= RefinerySetting.get(:site_name) %>
- </p>
-</div>
+ </p>
View
2 vendor/refinerycms/core/app/views/shared/_google_analytics.html.erb
@@ -1,6 +1,6 @@
<% unless refinery_user? or
(page_code = RefinerySetting.get(:analytics_page_code).to_s.strip) =~ /^(UA-xxxxxx-x)?$/ -%>
- <script type="text/javascript">
+ <script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<%= page_code %>']);
_gaq.push(['_trackPageview']);
View
12 vendor/refinerycms/core/app/views/shared/_head.html.erb
@@ -1,17 +1,15 @@
-<% theme ||= false -%>
+<% theme ||= nil -%>
<head>
<title><%= browser_title(yield(:title)) %></title>
<link rel="shortcut icon" href="/favicon.ico" />
- <meta charset='<%= Refinery::Application.config.encoding %>' />
- <%= csrf_meta_tag %>
- <%= render(:partial => '/shared/html5_for_ie.js').html_safe if request.env['HTTP_USER_AGENT'] =~ /MSIE/ %>
+ <meta charset='<%= Rails::Application.config.encoding %>' />
+ <%= csrf_meta_tag -%>
+ <%= render(:partial => '/shared/html5_for_ie.js').html_safe if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
<%= render :partial => 'shared/google_analytics' unless local_request? %>
<%= stylesheet_link_tag "application", "formatting", :theme => theme %>
<%= stylesheet_link_tag "theme" %>
<%= stylesheet_link_tag "home", :theme => theme if home_page? %>
<%= "<!--[if IE 7]>#{stylesheet_link_tag 'ie7'}<![endif]-->".html_safe if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
- <%= "<meta name=\"keywords\" content=\"#{@meta.meta_keywords}\" />".html_safe if @meta.meta_keywords.present? %>
+ <%= "<meta name=\"keywords\" content=\"#{@meta.meta_keywords}\" />".html_safe if @meta.meta_keywords.present? -%>
<%= "<meta name=\"description\" content=\"#{@meta.meta_description}\" />".html_safe if @meta.meta_description.present? -%>
- <%= yield :head_libraries %>
- <%= yield :head %>
</head>
View
4 vendor/refinerycms/core/app/views/shared/_header.html.erb
@@ -1,8 +1,6 @@
-<div id='header_content'>
- <h1><%= link_to RefinerySetting.get(:site_name), root_url(:only_path => true) %></h1>
+ <h1 id='logo'><%= link_to RefinerySetting.get(:site_name), root_url(:only_path => true) %></h1>
<%= render :partial => "/shared/menu",
:locals => {
:dom_id => 'menu',
:css => 'menu'
} -%>
-</div>
View
14 vendor/refinerycms/core/app/views/shared/_html5_for_ie.js.erb
@@ -1,7 +1,13 @@
-<script type='text/javascript'>
-/* html5shiv MIT @rem remysharp.com/html5-enabling-script
- iepp v1.5.1 MIT @jon_neal iecss.com/print-protector */
+<!-- www.phpied.com/conditional-comments-block-downloads/ -->
+<!--[if IE]><![endif]-->
+
+<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
+<!--[if IE]>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<![endif]-->
+<script>
+/* html5shiv MIT @rem remysharp.com/html5-enabling-script iepp v1.5.1 MIT @jon_neal iecss.com/print-protector */
/*@cc_on(function(p,e){var q=e.createElement("div");q.innerHTML="<z>i</z>";q.childNodes.length!==1&&function(){function r(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=s[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;r(a,b)}}function t(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h<a.length;){b=a[h].media||b;t(a[h].imports,b);r(b,a[h].cssText.replace(c,d))}}for(var s=e.documentElement,i=e.createDocumentFragment(),g={},m="abbr article aside audio canvas details figcaption figure footer header hgroup mark meter nav output progress section summary time video".replace(/ /g, '|'),
n=m.split("|"),f=[],o=-1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforeprint",function(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=-1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=new RegExp("^\\s*<"+d+"(.*)\\/"+d+">\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");c=i.childNodes[0];c.className+=" iepp_"+
d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}t(e.styleSheets,"all")});p.attachEvent("onafterprint",function(){for(var a=-1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1]);for(b in g)s[l].removeChild(g[b]);g={};f=[]})}()})(this,document);@*/
-</script>
+</script>
View
10 vendor/refinerycms/core/app/views/shared/_menu.html.erb
@@ -3,10 +3,13 @@
css ||= 'menu'
hide_children = RefinerySetting.find_or_set(:menu_hide_children, false) unless defined?(hide_children)
cache_key = [Refinery.base_cache_key]
- cache_key << RefinerySetting.find_or_set(:refinery_menu_cache_action_suffix, "site_menu")
+ cache_key << (action_suffix ||= RefinerySetting.find_or_set(:refinery_menu_cache_action_suffix, "site_menu"))
+ cache_key << extra_suffix if defined?(extra_suffix) and extra_suffix.present?
cache_key << request.path
- cache(cache_key.join('_')) do
- roots = @menu_pages.select { |m| m.parent_id == nil } # Select top menu items
+ cache(cache_key.compact.join('_')) do
+ # Select top menu items unless 'roots' is passed in.
+ collection ||= @menu_pages
+ roots ||= collection.select { |m| m.parent_id == nil }
if roots.any?
sibling_count = roots.size - 1
-%>
@@ -17,6 +20,7 @@
:locals => {
:hide_children => hide_children,
:sibling_count => sibling_count,
+ :collection => collection,
:apply_css => true #if you don't care about class='first' class='last' or class='selected' set apply_css to false for speed.
}
-%>
View
12 vendor/refinerycms/core/app/views/shared/_menu_branch.html.erb
@@ -4,22 +4,22 @@
"class='#{classes.join(' ')}'"
end
dom_id = ("id='item_#{menu_branch_counter}'" if menu_branch.parent_id.nil? and menu_branch.title.present?)
-
+
hide_children = (defined?(hide_children) && hide_children)
- children = hide_children ? [] : @menu_pages.select { |p| p.parent_id == menu_branch.id && p.in_menu? }
+ children = hide_children ? [] : collection.select { |p| p.parent_id == menu_branch.id && p.in_menu? }
-%>
<li<%= ['', css, dom_id].join(' ').gsub(/\ *$/, '') %>>
- <%= link_to menu_branch.title, menu_branch.url %>
-
- <% if children.present? %>
+ <%= link_to menu_branch.title, menu_branch.url -%>
+ <% if children.present? -%>
<ul class='clearfix'>
<%=
render :partial => "/shared/menu_branch",
:collection => children,
:locals => {
:hide_children => hide_children,
+ :collection => collection,
:sibling_count => children.size - 1
} -%>
</ul>
- <% end %>
+ <% end -%>
</li>
View
10 vendor/refinerycms/core/config/locales/en.yml
@@ -21,9 +21,9 @@ en:
cancel: Cancel
refinery:
crudify:
- created: %{what} was successfully created.
+ created: %{what} was successfully added.
updated: %{what} was successfully updated.
- destroyed: %{what} was successfully destroyed.
+ destroyed: %{what} was successfully removed.
shared:
site_bar:
log_out: Log out
@@ -35,8 +35,8 @@ en:
form_actions:
save: Save
cancel: Cancel
- cancel_lose_changes: Cancelling will lose all changes you've made here
- delete: Delete
+ cancel_lose_changes: If you cancel you will lose any changes you have made here
+ delete: Remove
previous: Previous
next: Next
close: Close
@@ -57,7 +57,7 @@ en:
results_for: Search results for '%{query}'
no_results: Sorry, no results found
delete:
- message: Are you sure you want to delete '%{title}'?
+ message: Are you sure you want to remove '%{title}'?
error_messages:
problems_in_following_fields: There were problems with the following fields
help: help
View
4 vendor/refinerycms/core/config/locales/zh-CN.yml
@@ -1,4 +1,4 @@
-en:
+zh-CN:
welcome:
there_are_no_users: "There are no users yet, so we'll set you up first."
remember_admin_location: "Remember your Refinery admin area is at:"
@@ -16,7 +16,7 @@ en:
reorder: "Reorder %{what}"
reorder_done: "Done Reordering %{what}"
crudify:
- created: "%{what} was successfully created."
+ created: "%{what} was successfully added."
updated: "%{what} was successfully updated."
destroyed: "%{what} was successfully destroyed."
shared:
View
37 vendor/refinerycms/core/engines.md
@@ -1,10 +1,10 @@
-# Extending Refinery with Plugins
+# Extending Refinery with Engines
## Introduction
__Refinery is designed to be easily extended so you can quickly customise your Refinery site to manage new areas you want to add to your site. If you see something you want to customise, the chances are you can customise it.__
-The main way of extending Refinery is through adding new plugins to your app. By default you can edit pages in Refinery's backend, but how do you add a new section to manage like products?
+The main way of extending Refinery is through adding new engines to your app. By default you can edit pages in Refinery's backend, but how do you add a new section to manage like products?
## The Refinery Generator
@@ -30,10 +30,15 @@ This will output the help on how to use the generator. To generate the new secti
rails generate refinery_engine product title:string description:text image:image brochure:resource
-The generator will output a list of files it generated. You'll notice there is a new plugin that has been added in ``vendor/plugins/products``. This is where both the backend and front end files are held for this new products area.
+The generator will output a list of files it generated. You'll notice there is a new engine that has been added in ``vendor/engines/products``. This is where both the backend and front end files are held for this new products area.
-A new database migration has been added to add the products table in so run:
+Engines are treated like gems. When you generate a new engine it adds the gem dependency for this engine to the end of your ``Gemfile``. Because your ``Gemfile`` has changed you now need to run:
+ bundle install
+
+When the products engine was generated a products generator was also created. This installs any migrations and seeds into your Rails app. Here's how to finish off the install
+
+ rails generate refinerycms_products
rake db:migrate
Start up your app by running ``ruby script/server`` go to [http://localhost:3000](http://localhost:3000) and you'll see instantly a new menu item called "products". Click on that and you'll see there are no products yet.
@@ -42,11 +47,11 @@ Now go to the backend of your site by visiting [http://localhost:3000/refinery](
Now you have a fully managed products section in Refinery, nice.
-If you want to modify your generated plugin you need to understand the basic structure of how they work.
+If you want to modify your generated engine you need to understand the basic structure of how they work.
-## The Structure of a Plugin
+## The Structure of an Engine
-Think of a plugin in Refinery as a small Rails app or an "engine". Plugins have a structure that is extremely similar to a Rails app. Here's an example of Refinery's pages plugin (located in Refinery's ``vendor/plugins/pages/`` folder)
+Think of a engine in Refinery as a small Rails app. Engines have a structure that is extremely similar to a Rails app. Here's an example of Refinery's pages engine (located in Refinery's ``vendor/refinerycms/pages/`` folder)
pages
|- app
@@ -91,23 +96,23 @@ This bit is important. It's where all the controllers are held to manage pages i
end
-This single controller allows us to create, read, update and delete pages in the backend. With a little bit of Refinery magic we utilise the [crudify mixin](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery/crud.md) which gives us all of these regular features out of the box.
+This single controller allows us to create, read, update and delete pages in the backend. With a little bit of Refinery magic we utilise the [crudify mixin](http://github.com/resolve/refinerycms/blob/master/vendor/refinerycms/core/crud.md) which gives us all of these regular features out of the box.
-How crudify works is an entire topic of it's own. Checkout the [crudify documentation](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery/crud.md) to get an insight into how that works.
+How crudify works is an entire topic of it's own. Checkout the [crudify documentation](http://github.com/resolve/refinerycms/blob/master/vendor/refinerycms/core/crud.md) to get an insight into how that works.
### app/views and app/helpers
-Works exactly the same as ``app/views`` and ``app/helpers`` in a normal Rails app. You just put the views and helpers related to this plugin in here instead of in your actual main app directory.
+Works exactly the same as ``app/views`` and ``app/helpers`` in a normal Rails app. You just put the views and helpers related to this engine in here instead of in your actual main app directory.
### config/routes.rb
-Works exactly the same as ``config/routes.rb`` in your app except this routes file only loads the routes for this plugin.
+Works exactly the same as ``config/routes.rb`` in your app except this routes file only loads the routes for this engine.
### rails/init.rb
-This file runs when your site is started up. All is does is registers this plugin with Refinery so it knows that it exists, how to handle it in the Refinery admin menu and how to render recent activity on the Dashboard (see "Getting your Plugin to Report Activity in the Dashboard")
+This file runs when your site is started up. All is does is registers this engine with Refinery so it knows that it exists, how to handle it in the Refinery admin menu and how to render recent activity on the Dashboard (see "Getting your Engine to Report Activity in the Dashboard")
-NOTE: The latest version of Refinery requires that you only specify a plugin.name. plugin.title &amp; plugin.description will be looked up by the I18n system.
+NOTE: The latest version of Refinery requires that you only specify a engine.name. plugin.title &amp; plugin.description will be looked up by the I18n system.
# pages/lib/pages.rb
Refinery::Plugin.register do |plugin|
@@ -130,11 +135,11 @@ NOTE: The latest version of Refinery requires that you only specify a plugin.nam
title: Pages
description: Manage content pages
-## Getting your Plugin to Report Activity in the Dashboard
+## Getting your Engine to Report Activity in the Dashboard
-Recent activity reporting is built right in, so all you need to do is follow the convention below and your plugin will start showing up in the recent activity list of the Dashboard.
+Recent activity reporting is built right in, so all you need to do is follow the convention below and your engine will start showing up in the recent activity list of the Dashboard.
-In our example above we showed the use of ``plugin.activity`` for the pages plugin.
+In our example above we showed the use of ``plugin.activity`` for the pages engine.
Refinery::Plugin.register do |plugin|
plugin.name = "pages"
View
3 vendor/refinerycms/core/features/search.feature
@@ -20,6 +20,7 @@ Feature: Search
|page |testitem|pages |
|inquiry |testitem|inquiries |
|inquiry |testitem|spam inquiries|
+ |setting |testitem|settings |
# This will only run when resources engine is installed.
@search-file
@@ -54,3 +55,5 @@ Feature: Search
|files |files |
|inquiries|inquiries |
|inquiries|spam inquiries|
+ |settings |settings |
+
View
2 vendor/refinerycms/core/features/step_definitions/core_steps.rb
@@ -44,7 +44,7 @@
end
Then %r`be redirected to login$` do
- request.request_uri.should == login_path
+ request.fullpath.should == login_path
end
Then /^"([^\"]*)" can log in$/ do |name|
View
76 vendor/refinerycms/core/lib/core.rb
@@ -7,6 +7,8 @@
require 'friendly_id'
require 'truncate_html'
require 'will_paginate'
+require 'rails/generators'
+require 'rails/generators/migration'
module Refinery
autoload :Plugin, File.expand_path('../refinery/plugin', __FILE__)
@@ -73,4 +75,78 @@ def asset_file_path(path)
end
end
end
+
+ module Generators
+ # The core engine installer streamlines the installation of custom generated
+ # engines. It takes the migrations and seeds in your engine and moves them
+ # into the rails app db directory, ready to migrate.
+ class EngineInstaller < Rails::Generators::Base
+ include Rails::Generators::Migration
+
+ def self.engine_name(name = nil)
+ @engine_name = name unless name.nil?
+ @engine_name
+ end
+
+ # Implement the required interface for Rails::Generators::Migration.
+ # taken from http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
+ # can be removed once this issue is fixed:
+ # # https://rails.lighthouseapp.com/projects/8994/tickets/3820-make-railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-it-possible-to-use-it-in-custom-generators
+ def self.next_migration_number(dirname)
+ if ActiveRecord::Base.timestamped_migrations
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
+ else
+ "%.3d" % (current_migration_number(dirname) + 1)
+ end
+ end
+
+ def generate
+ Dir.glob(File.expand_path(File.join(self.class.source_root, '../db/**/**'))).each do |path|
+ unless File.directory?(path)
+ if path =~ /.*migrate.*/
+ migration_template path, Rails.root.join("db/migrate/create_#{self.class.engine_name}")
+ else
+ template path, Rails.root.join("db/seeds/#{self.class.engine_name}.rb")
+ end
+ end
+ end
+
+ puts "------------------------"
+ puts "Now run:"
+ puts "rake db:migrate"
+ puts "------------------------"
+ end
+ end
+ end
+
end
+
+
+
+
+# Below is a hack until this issue:
+# https://rails.lighthouseapp.com/projects/8994/tickets/3820-make-railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-it-possible-to-use-it-in-custom-generators
+# is fixed on the Rails project.
+
+require 'rails/generators/named_base'
+require 'rails/generators/migration'
+require 'rails/generators/active_model'
+require 'active_record'
+
+module ActiveRecord
+ module Generators
+ class Base < Rails::Generators::NamedBase #:nodoc:
+ include Rails::Generators::Migration
+
+ # Implement the required interface for Rails::Generators::Migration.
+ def self.next_migration_number(dirname) #:nodoc:
+ next_migration_number = current_migration_number(dirname) + 1
+ if ActiveRecord::Base.timestamped_migrations
+ [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
+ else
+ "%.3d" % next_migration_number
+ end
+ end
+ end
+ end
+end
View
55 vendor/refinerycms/core/lib/generators/refinery_engine/refinery_engine_generator.rb
@@ -9,7 +9,8 @@ class RefineryEngineGenerator < Rails::Generators::NamedBase
def generate
unless attributes.empty?
- Dir.glob(File.expand_path('../templates/**/**', __FILE__)).each do |path|
+ Dir.glob(File.expand_path('../templates/**/**', __FILE__), File::FNM_DOTMATCH).each do |path|
+ # ignore directories which are created automatically by template()
unless File.directory?(path)
template path, plugin_path_for(path)
end
@@ -24,6 +25,7 @@ def generate
puts "------------------------"
puts "Now run:"
puts "bundle install"
+ puts "rails generate refinerycms_#{plural_name}"
puts "rake db:migrate"
puts "------------------------"
elsif self.behavior == :revoke
@@ -39,56 +41,9 @@ def generate
def plugin_path_for(path)
path = path.gsub(File.dirname(__FILE__) + "/templates/", "vendor/engines/#{plural_name}/")
+
path = path.gsub("plural_name", plural_name)
path = path.gsub("singular_name", singular_name)
- path = path.gsub(".migration", '')
-
- # hack can be removed after issue is fixed
- unless self.behavior == :revoke
- next_migration_number = ActiveRecord::Generators::Base.next_migration_number(File.dirname(__FILE__))
- else
- if (migrations = Dir[Rails.root.join('db', 'migrate', "*create_#{plural_name}*.rb").to_s]).any?
- next_migration_number = migrations.first.split('/').last.split('_').first
- else
- next_migration_number = ''
- end
- end
- path = path.gsub("migration_number", next_migration_number.to_s)
-
- # replace our local db path with the app one instead.
- path = path.gsub("/db/", "/../../../db/")
end
-end
-
-
-
-
-
-
-# Below is a hack until this issue:
-# https://rails.lighthouseapp.com/projects/8994/tickets/3820-make-railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-it-possible-to-use-it-in-custom-generators
-# is fixed on the Rails project.
-
-require 'rails/generators/named_base'
-require 'rails/generators/migration'
-require 'rails/generators/active_model'
-require 'active_record'
-
-module ActiveRecord
- module Generators
- class Base < Rails::Generators::NamedBase #:nodoc:
- include Rails::Generators::Migration
-
- # Implement the required interface for Rails::Generators::Migration.
- def self.next_migration_number(dirname) #:nodoc:
- next_migration_number = current_migration_number(dirname) + 1
- if ActiveRecord::Base.timestamped_migrations
- [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
- else
- "%.3d" % next_migration_number
- end
- end
- end
- end
-end
+end
View
4 .../lib/generators/refinery_engine/templates/app/controllers/admin/plural_name_controller.rb
@@ -1,7 +1,7 @@
class Admin::<%= class_name.pluralize %>Controller < Admin::BaseController
- crudify :<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>
- , :title_attribute => '<%= title.name %>'
+ crudify :<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
+ :title_attribute => '<%= title.name %>'
<% end %>
end
View
4 ...erycms/core/lib/generators/refinery_engine/templates/app/views/plural_name/index.html.erb
@@ -2,9 +2,7 @@
<ul id="<%= plural_name %>">
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
<li>
- <%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
- .<%= title.name %>
- <% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
+ <%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
</li>
<%% end %>
</ul>
View
8 ...nerycms/core/lib/generators/refinery_engine/templates/app/views/plural_name/show.html.erb
@@ -1,7 +1,5 @@
<%% content_for :body_content_title do %>
- <%%= @<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
- .<%= title.name %>
-<% end %> %>
+ <%%= @<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% end %> %>
<%% end %>
<%% content_for :body_content_left do %>
@@ -24,9 +22,7 @@
<ul id="<%= plural_name %>">
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
<li>
- <%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
- .<%= title.name %>
- <% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
+ <%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
</li>
<%% end %>
</ul>
View
4 vendor/refinerycms/core/lib/generators/refinery_engine/templates/config/locales/en.yml
@@ -1,4 +1,8 @@
en:
+ shared:
+ admin:
+ image_picker:
+ image: image
plugins:
<%= class_name.pluralize.underscore.downcase %>:
title: <%= plural_name.titleize %>
View
0 ...te/migration_number_create_plural_name.rb → ...emplates/db/migrate/create_plural_name.rb
File renamed without changes.
View
4 vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
@@ -10,6 +10,6 @@
:position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
:menu_match => "^/<%= plural_name %>(\/|\/.+?|)$"
)
-RefinerySetting.find_or_set(:default_page_parts, ["Body", "Side Body"]).each do |default_page_part|
+Page.default_parts.each do |default_page_part|
page.parts.create(:title => default_page_part, :body => nil)
-end
+end
View
6 .../generators/refinery_engine/templates/lib/generators/refinerycms_plural_name_generator.rb
@@ -0,0 +1,6 @@
+class Refinerycms<%= class_name.pluralize %> < Refinery::Generators::EngineInstaller
+
+ source_root File.expand_path('../../', __FILE__)
+ engine_name "<%= plural_name %>"
+
+end
View
4 vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/plural_name.rb
@@ -3,6 +3,10 @@
module Refinery
module <%= class_name.pluralize %>
class Engine < Rails::Engine
+ initializer "static assets" do |app|
+ app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
+ end
+
config.after_initialize do
Refinery::Plugin.register do |plugin|
plugin.name = "<%= class_name.pluralize.underscore.downcase %>"
View
13 vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/tasks/plural_name.rake
@@ -0,0 +1,13 @@
+namespace :refinery do
+
+ namespace :<%= plural_name %> do
+
+ # call this task my running: rake refinery:<%= plural_name %>:my_task
+ # desc "Description of my task below"
+ # task :my_task => :environment do
+ # # add your logic here
+ # end
+
+ end
+
+end
View
0 vendor/refinerycms/core/lib/generators/refinery_engine/templates/public/.gitkeep
No changes.
View
10 vendor/refinerycms/core/lib/generators/refinery_engine/templates/readme.md
@@ -0,0 +1,10 @@
+# <%= plural_name.titleize %> engine for Refinery CMS.
+
+## How to build this engine as a gem
+
+ cd vendor/engines/<%= plural_name %>
+ gem build refinerycms-<%= plural_name %>.gempspec
+ gem install refinerycms-<%= plural_name %>.gem
+
+ # Sign up for a http://rubygems.org/ account and publish the gem
+ gem push refinerycms-<%= plural_name %>.gem
View
10 vendor/refinerycms/core/lib/refinery/crud.rb
@@ -126,6 +126,7 @@ def destroy
flash.notice = t('refinery.crudify.destroyed',
:what => "'\#{@#{singular_name}.#{options[:title_attribute]}}'")
end
+
redirect_to #{options[:redirect_to_url]}
end
@@ -149,7 +150,14 @@ def paginate_all_#{plural_name}
# If we have already found a set then we don't need to again
find_all_#{plural_name} if @#{plural_name}.nil?
- @#{plural_name} = @#{plural_name}.paginate(:page => params[:page])
+ paging_options = {:page => params[:page]}
+
+ # Seems will_paginate doesn't always use the implicit method.
+ if #{class_name}.methods.map(&:to_sym).include?(:per_page)
+ paging_options.update({:per_page => #{class_name}.per_page})
+ end
+
+ @#{plural_name} = @#{plural_name}.paginate(paging_options)
end
# Returns a weighted set of results based on the query specified by the user.
View
9 vendor/refinerycms/core/lib/refinery/helpers/image_helper.rb
@@ -22,12 +22,13 @@ def content_fu(content, thumbnail)
# <%= image_fu @model.image, '200x200' %> or with no thumbnail: <%= image_fu @model.image %>
def image_fu(image, geometry = nil, options={})
if image.present?
- # call rails' image tag function with default alt, width and height options.
+ # call rails' image tag function with default alt tag.
# if any other options were supplied these are merged in and can replace the defaults.
- image_tag((thumbnail = image.thumbnail(geometry)).url, {
+ # if the geomtry is nil, then we know the image height and width already.
+ image_tag(image.thumbnail(geometry).url, {
:alt => image.respond_to?(:title) ? image.title : image.image_name,
- :width => thumbnail.width,
- :height => thumbnail.height
+ :width => (image.image_width if geometry.nil?),
+ :height => (image.image_height if geometry.nil?)
}.merge(options))
end
end
View
2 vendor/refinerycms/core/lib/refinery/helpers/site_bar_helper.rb
@@ -16,7 +16,7 @@ def site_bar_switch_link
elsif defined?(@page) and @page.present? and !@page.home?
edit_admin_page_url(@page, :only_path => true)
else
- (request.fullpath.to_s == '/') ? admin_root_url(:only_path => true) : "/admin#{request.request_uri}/edit"
+ (request.fullpath.to_s == '/') ? admin_root_url(:only_path => true) : "/admin#{request.fullpath}/edit"
end rescue admin_root_url(:only_path => true))
end
end
View
2 vendor/refinerycms/core/public/javascripts/refinery/admin.js
@@ -307,7 +307,7 @@ init_tooltips = function(args){
$(element).attr('tooltip', $(element).attr('title'));
}
// wipe clean the title on any children too.
- $(element).add($(element).children('img')).attr('title', null);
+ $(element).add($(element).children('img')).removeAttr('title');
});
}
View
25 vendor/refinerycms/core/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
@@ -1212,6 +1212,7 @@ WYMeditor.editor.prototype.update = function() {
* @description Opens a dialog box
*/
WYMeditor.editor.prototype.dialog = function( dialogType ) {
+ this.update();
var path = this._wym._options.dialogPath + dialogType;
this._current_unique_stamp = this.uniqueStamp();
@@ -1261,22 +1262,30 @@ WYMeditor.editor.prototype.dialog = function( dialogType ) {
// wrap the current selection with a funky span.
if (this._selected_image == null)
{
- if ((selected == null || selected.tagName.toLowerCase() == WYMeditor.P) && wym._iframe.contentWindow.getSelection) {
+ if (selected != null && selected.tagName.toLowerCase() != WYMeditor.A && wym._iframe.contentWindow.getSelection) {
// Fixes webkit issue where it would not paste at cursor.
selection = wym._iframe.contentWindow.getSelection();
- selected_html = $(selected).html();
+ selected_html = $(selected).html().replace('&nbsp;', ' ');
- if ((selection.focusOffset - selection.anchorOffset) > 1) {
- new_html = selected_html.substring(0, selection.anchorOffset)
+ if ((offset = selected_html.indexOf(selection.focusNode.textContent)) == -1) {
+ offset = 0;
+ }
+ focus = offset + selection.focusOffset;
+ anchor = offset + selection.anchorOffset;
+ length = (focus - anchor);
+
+ if (length > 1) {
+ new_html = selected_html.substring(0, anchor)
+ "<span id='replace_me_with_" + this._current_unique_stamp + "'>"
- + selected_html.substring(selection.anchorOffset, selection.focusOffset)
+ + selected_html.substring(anchor, focus)
+ "</span>"
- + selected_html.substring(selection.focusOffset);
+ + selected_html.substring(focus);
} else {
- new_html = selected_html.substring(0, selection.focusOffset)
+ new_html = selected_html.substring(0, focus)
+ "<span id='replace_me_with_" + this._current_unique_stamp + "'></span>"
- + selected_html.substring(selection.focusOffset);
+ + selected_html.substring(focus);
}
+ new_html = new_html.replace(' ', '&nbsp;');
$(selected).html(new_html);
} else {
View
4 vendor/refinerycms/core/public/stylesheets/refinery/application.css
@@ -1,11 +1,11 @@
body {
margin: 0px;
}
-#page, #site_bar_content {
+#page_container, #site_bar_content, footer, header {
width: 1000px;
margin: 0px auto;
}
-#page {
+#page_container {
padding: 20px;
}
#body_content_left {
View
6 vendor/refinerycms/core/public/stylesheets/refinery/formatting.css
@@ -39,19 +39,19 @@ Clearfix docs
- Main docs: http://positioniseverything.net/easyclearing.html
- IE7 change: http://www.456bereastreet.com/archive/200603/new_clearing_method_needed_for_ie7/
*/
-.clearfix:after {
+.clearfix:after, section:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
-.clearfix {
+.clearfix, section {
display: inline-block;
}
/* Hide from IE Mac \*/
-.clearfix {
+.clearfix, section {
display:block;
}
/* End hide from IE Mac */
View
4 vendor/refinerycms/core/public/stylesheets/refinery/refinery.css
@@ -543,12 +543,12 @@ header p {
font-style: normal;
padding: 0px 6px;
}
-.pagination a, #content .pagination a, .pagination .current, .disabled {
+.pagination a, #content .pagination a, .pagination .current, .disabled, .pagination em {
padding: 7px;
line-height: 20px;
border-bottom: 0px none;
}
-.pagination .current, .pagination a:hover {
+.pagination .current, .pagination a:hover, .pagination em {
background: #A8B9C1;
}
#dialog-form-actions .pagination {
View
2 vendor/refinerycms/dashboard/config/locales/en.yml
@@ -21,4 +21,4 @@ en:
updated:
'with_article "the"': updated
created:
- 'with_article "the"': created
+ 'with_article "the"': added
View
2 vendor/refinerycms/dashboard/config/locales/zh-CN.yml
@@ -20,4 +20,4 @@ zh-CN:
updated:
'with_article "the"': updated
created:
- 'with_article "the"': created
+ 'with_article "the"': added
View
2 vendor/refinerycms/dashboard/features/dashboard.feature
@@ -16,7 +16,7 @@ Feature: Dashboard
When I fill in "Title" with "Page test from Dashboard"
And I press "Save"
Then I should be on the Dashboard
- And I should see "'Page test from Dashboard' was successfully created."
+ And I should see "'Page test from Dashboard' was successfully added."
And I should have 1 page
Scenario: Update a Page Button
View
2 vendor/refinerycms/images/app/controllers/admin/images_controller.rb
@@ -11,7 +11,7 @@ class Admin::ImagesController < Admin::BaseController
def index
search_all_images if searching?
paginate_all_images
-
+
if RefinerySetting.find_or_set(:group_images_by_date_uploaded, true)
@grouped_images = group_by_date(@images)
end
View
4 vendor/refinerycms/images/config/locales/en.yml
@@ -18,8 +18,8 @@ en:
current_image: Current Image
maximum_image_size: The maximum image size is %{megabytes} megabytes.
index:
- create_new_image: Create New Image
- no_images_yet: There are no images yet. Click "Create New Image" to add your first image.
+ create_new_image: Add New Image
+ no_images_yet: There are no images yet. Click "Add New Image" to add your first image.
view:
switch_to: Switch to %{view_name} view
list: list
View
4 vendor/refinerycms/images/config/locales/zh-CN.yml
@@ -15,8 +15,8 @@ zh-CN:
current_image: Current Image
maximum_image_size: The maximum image size is %{megabytes} megabytes.
index:
- create_new_image: Create New Image
- no_images_yet: There are no images yet. Click "Create New Image" to add your first image.
+ create_new_image: Add New Image
+ no_images_yet: There are no images yet. Click "Add New Image" to add your first image.
view:
switch_to: Switch to %{view_name} view
list: list
View
8 vendor/refinerycms/images/features/manage_images.feature
@@ -11,7 +11,7 @@ Feature: Manage Images
@images-create
Scenario: Create Valid Image
When I go to the list of images
- And I follow "Create New Image"
+ And I follow "Add New Image"
And I attach the image at "beach.jpeg"
And I press "Save"
Then the image "beach.jpeg" should have uploaded successfully
@@ -23,10 +23,10 @@ Feature: Manage Images
Scenario: Create Invalid Image (format)
When I go to the list of images
- And I follow "Create New Image"
+ And I follow "Add New Image"
And I attach the image at "refinery_is_awesome.txt"
And I press "Save"
- Then I should not see "successfully created"
+ Then I should not see "successfully added"
And I should have 0 images
@images-edit
@@ -44,5 +44,5 @@ Feature: Manage Images
When I upload the image at "beach.jpeg"
When I go to the list of images
And I follow "Remove this image forever"
- Then I should see "'Beach' was successfully destroyed. "
+ Then I should see "'Beach' was successfully removed."
And I should have 0 images
View
23 vendor/refinerycms/images/lib/images.rb
@@ -5,6 +5,29 @@
module Refinery
module Images
class Engine < Rails::Engine
+ initializer 'fix-tempfile-not-closing-with-dragonfly-images' do |app|
+ # see http://github.com/markevans/dragonfly/issues#issue/18/comment/415807
+ require 'tempfile'
+ class Tempfile
+
+ def unlink
+ # keep this order for thread safeness
+ begin
+ if File.exist?(@tmpname)
+ closed? or close
+ File.unlink(@tmpname)
+ end
+ @@cleanlist.delete(@tmpname)
+ @data = @tmpname = nil
+ ObjectSpace.undefine_finalizer(self)
+ rescue Errno::EACCES
+ # may not be able to unlink on Windows; just ignore
+ end
+ end
+
+ end
+ end
+
initializer 'images-with-dragonfly' do |app|
app_images = Dragonfly[:images]
app_images.configure_with(:rmagick)
View
3 vendor/refinerycms/pages/app/models/page.rb
@@ -118,7 +118,8 @@ def link_url_localised?
end
def url_marketable
- {:controller => "/pages", :action => "show", :path => self.nested_url}
+ # :id => nil is important to prevent any other params[:id] from interfering with this route.
+ {:controller => "/pages", :action => "show", :path => self.nested_url, :id => nil}
end
def url_normal
View
6 vendor/refinerycms/pages/app/views/admin/pages/_form.html.erb
@@ -11,6 +11,12 @@
<%= f.label :title %>
<%= f.text_field :title, :class => "larger widest" %>
</div>
+
+ <%= render :partial => "form_fields_after_title",
+ :locals => {
+ :f => f
+ } %>
+
<div class='field'>
<%= render :partial => "form_page_parts",
:locals => {
View
1 vendor/refinerycms/pages/app/views/admin/pages/_form_fields_after_title.html.erb
@@ -0,0 +1 @@
+<%# Intentionally empty, useful override point to add extra fields. %>
View
6 vendor/refinerycms/pages/config/locales/en.yml
@@ -40,7 +40,7 @@ en:
form_new_page_parts:
title: Title
form_page_parts:
- create_content_section: Create content section
+ create_content_section: Add content section
delete_content_section: Delete content section
form_advanced_options:
toggle_advanced_options: Click to access meta tag settings and menu options
@@ -71,10 +71,10 @@ en:
meta_description_title: Meta description
meta_description_help: Enter a concise two or three sentences describing what this page is about.
index:
- create_new_page: Create New Page
+ create_new_page: Add New Page
reorder_pages: Reorder Pages
reorder_pages_done: Done Reordering Pages
- no_pages_yet: There are no pages yet. Click "Create New Page" to add your first page.
+ no_pages_yet: There are no pages yet. Click "Add New Page" to add your first page.
activerecord:
models:
page: page
View
8 vendor/refinerycms/pages/config/locales/ru.yml
@@ -43,7 +43,7 @@ ru:
toggle_advanced_options: Click to access meta tag settings and menu options
parent_page: Родительская страница
title: Заголовок
- create_content_section: Create content section
+ create_content_section: Add content section
delete_content_section: Delete content section
advanced_options: Дополнительная настройка
explain_page_different_title: "Если вы хотите, чтобы страница имела заголовок, отличный от того, что в меню или в заголовке браузера, введите его здесь."
@@ -55,7 +55,7 @@ ru:
text: Текст
image: Изображение
custom_url: Custom URL
- custom_url_explanation: "Enter a URL if this page links to an external site or to a pre-existing resource e.g. a contact page. <br/> Note: This URL must point to a location that exists; a new one will not be created."
+ custom_url_explanation: "Enter a URL if this page links to an external site or to a pre-existing resource e.g. a contact page. <br/> Note: This URL must point to a location that exists; a new one will not be added."
draft: Черновик
show_in_menu_title: Показ в меню
show_in_menu_description: Отображать эту страницу в меню сайта
@@ -81,7 +81,7 @@ ru:
meta_description_help: "Введите два-три коротких предложения, описывающих страницу."
js:
content_section:
- create: Create Content Section
+ create: Add Content Section
already_exists: "A content section with that title already exists, please choose another."
title_empty: "You have not entered a title for the content section, please enter one."
confirm_delete: "This will remove the content section {{section_name}} when the page is saved and erase all content that has been entered into it, Are you sure?"
@@ -90,7 +90,7 @@ ru:
reorder_pages: Изменить порядок страниц
reorder_pages_done: Сохранить такой порядок страниц
sorry_no_results: Sorry! There are no results found.
- no_pages_yet: There are no pages yet. Click "Create New Page" to add your first page.
+ no_pages_yet: There are no pages yet. Click "Add New Page" to add your first page.
activerecord:
attributes:
page:
View
4 vendor/refinerycms/pages/config/locales/zh-CN.yml
@@ -36,7 +36,7 @@ zh-CN:
form_new_page_parts:
title: Title
form_page_parts:
- create_content_section: Create content section
+ create_content_section: Add content section
delete_content_section: Delete content section
form_advanced_options:
toggle_advanced_options: Click to access meta tag settings and menu options
@@ -69,7 +69,7 @@ zh-CN:
create_new_page: ������ҳ��
reorder_pages: Reorder Pages
reorder_pages_done: Done Reordering Pages
- no_pages_yet: There are no pages yet. Click "Create New Page" to add your first page.
+ no_pages_yet: There are no pages yet. Click "Add New Page" to add your first page.
activerecord:
models:
page: page
View
17 vendor/refinerycms/pages/config/routes.rb
@@ -1,5 +1,5 @@
Refinery::Application.routes.draw do
- resources :pages
+ get '/pages/:id', :to => 'pages#show', :as => :page
scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
resources :pages do
@@ -8,17 +8,14 @@
end
end
- resources :page_parts
-
- resource :pages do
- resources :dialogs, :controller => :pages_dialogs do
- collection do
- get :link_to
- get :test_url
- get :test_email
- end
+ resources :pages_dialogs, :only => [] do
+ collection do
+ get :link_to
+ get :test_url
+ get :test_email
end
end
+ resources :page_parts, :only => [:new, :create, :destroy]
end
end
View
10 vendor/refinerycms/pages/features/manage_pages.feature
@@ -16,15 +16,15 @@ Feature: Manage Pages
Scenario: Create Valid Page
When I go to the list of pages
- And I follow "Create New Page"
+ And I follow "Add New Page"
And I fill in "Title" with "Pickles are Cucumbers Soaked in Evil"
And I press "Save"
- Then I should see "'Pickles are Cucumbers Soaked in Evil' was successfully created."
+ Then I should see "'Pickles are Cucumbers Soaked in Evil' was successfully added."
And I should have 1 page
Scenario: Create Invalid Page (without title)
When I go to the list of pages
- And I follow "Create New Page"
+ And I follow "Add New Page"
And I press "Save"
Then I should see "Title can't be blank"
And I should have 0 pages
@@ -32,7 +32,7 @@ Feature: Manage Pages
Scenario: Create Duplicate Page
Given I only have pages titled Home, About
When I go to the list of pages
- And I follow "Create New Page"
+ And I follow "Add New Page"
And I fill in "Title" with "About"
And I press "Save"
Then I should have 3 pages
@@ -42,6 +42,6 @@ Feature: Manage Pages
Given I only have a page titled "test"
When I go to the list of pages
And I follow "Remove this page forever"
- Then I should see "'test' was successfully destroyed."
+ Then I should see "'test' was successfully removed."
And I should have 0 pages
And I should have 0 page_parts
View
1 vendor/refinerycms/pages/features/step_definitions/page_steps.rb
@@ -18,6 +18,7 @@
Given /^I (only )?have a page titled "([^"]*)"$/ do |only, title|
Page.delete_all if only
+ PagePart.delete_all if only
page = Page.create(:title => title)
page.parts << PagePart.new(:title => 'testing', :position => 0)
page
View
44 vendor/refinerycms/pages/spec/models/page_spec.rb
@@ -1,13 +1,47 @@
require 'spec_helper'
describe Page do
- before(:each) do
+
+ def reset_page(options = {})
@valid_attributes = {
- :title => "RSpec is great for testing too"
+ :title => "RSpec is great for testing too",
+ :deletable => true
}
+ @page = Page.create!(@valid_attributes)
+ @page.update_attributes(options)
end
-
- it "should create a new instance given valid attributes" do
- Page.create!(@valid_attributes)
+
+ def page_cannot_be_destroyed
+ @page.destroy.should == false
+ end
+
+ before(:each) do
+ reset_page
+ end
+
+ context "a page cannot delete under certain rules" do
+ it "shouldn't allow me to destroy pages that are links" do
+ reset_page({:link_url => '/plugin-name'})
+ page_cannot_be_destroyed
+ end
+
+
+ it "cannot be deleted if refinery team deems it so" do
+ reset_page({:deletable => false})
+ page_cannot_be_destroyed
+ end
+
+ it "cannot be destroyed if have menu_match is filled out" do
+ reset_page({:menu_match => '^/RSpec is great for testing too.*$'})
+ page_cannot_be_destroyed
+ end
+
+ it "will destroy if you really want it to! >:]" do
+ reset_page
+ @page.destroy!
+ end
end
+
+
end
+
View
11 vendor/refinerycms/refinery.rb
@@ -1,10 +1,11 @@
+require 'rbconfig'
+
module Refinery
+ WINDOWS = !!(RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!)
+
class << self
- attr_accessor :is_a_gem, :root, :s3_backend, :base_cache_key
- def is_a_gem
- @is_a_gem ||= false
- end
+ attr_accessor :root, :s3_backend, :base_cache_key
def root
@root ||= Pathname.new(File.expand_path(__FILE__).split('vendor').first.to_s)
@@ -27,7 +28,7 @@ class Version
@major = 0
@minor = 9
@tiny = 8
- @build = 3
+ @build = 5
class << self
attr_reader :major, :minor, :tiny, :build
View
2 vendor/refinerycms/resources/features/manage_files.feature
@@ -35,5 +35,5 @@ Feature: Manage Files
When I upload the file at "refinery_is_awesome.txt"
And I go to the list of files
And I follow "Remove this file forever"
- Then I should see "'Refinery Is Awesome' was successfully destroyed."
+ Then I should see "'Refinery Is Awesome' was successfully removed."
And I should have 0 files
View
23 vendor/refinerycms/resources/lib/resources.rb
@@ -5,6 +5,29 @@