Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged resolve.

  • Loading branch information...
commit e1ca9166bf38dad892c76fb8bab18b299ffdd3f2 2 parents eefbbdf + edd1d33
@bofrede bofrede authored
Showing with 520 additions and 390 deletions.
  1. +5 −6 Gemfile
  2. +19 −21 Gemfile.lock
  3. +5 −4 bin/refinerycms
  4. +20 −0 changelog.md
  5. +3 −0  config/environments/development.rb
  6. +3 −5 lib/gemspec.rb
  7. +17 −6 refinerycms.gemspec
  8. +11 −0 spec/spec_helper.rb
  9. +3 −9 vendor/refinerycms/authentication/app/mailers/user_mailer.rb
  10. +7 −7 vendor/refinerycms/authentication/app/views/admin/users/index.html.erb
  11. +1 −0  vendor/refinerycms/authentication/features/lost_password.feature
  12. +1 −1  vendor/refinerycms/authentication/features/manage_users.feature
  13. +4 −4 vendor/refinerycms/core/app/views/shared/_menu_branch.html.erb
  14. +3 −2 vendor/refinerycms/core/app/views/shared/admin/_make_sortable.html.erb
  15. +4 −4 vendor/refinerycms/core/config/locales/da.yml
  16. +4 −4 vendor/refinerycms/core/config/locales/it.yml
  17. +4 −4 vendor/refinerycms/core/config/locales/nb.yml
  18. +5 −5 vendor/refinerycms/core/config/locales/ru.yml
  19. +1 −1  vendor/refinerycms/core/features/engine_generator.feature
  20. +1 −1  vendor/refinerycms/core/features/search.feature
  21. +1 −1  vendor/refinerycms/core/features/site_bar.feature
  22. +26 −33 vendor/refinerycms/core/lib/generators/refinery_engine/templates/app/views/admin/plural_name/index.html.erb
  23. +89 −85 vendor/refinerycms/core/lib/refinery/application_controller.rb
  24. +13 −4 vendor/refinerycms/core/lib/refinery/helpers/menu_helper.rb
  25. +1 −1  vendor/refinerycms/core/lib/refinery/plugin.rb
  26. +10 −0 vendor/refinerycms/core/public/javascripts/refinery/admin.js
  27. +29 −7 vendor/refinerycms/core/public/stylesheets/refinery/application.css
  28. +13 −0 vendor/refinerycms/core/public/stylesheets/refinery/refinery.css
  29. +1 −0  vendor/refinerycms/dashboard/app/views/admin/dashboard/_additional_dashboard_menu_items.html.erb
  30. +3 −2 vendor/refinerycms/dashboard/app/views/admin/dashboard/index.html.erb
  31. +1 −1  vendor/refinerycms/dashboard/features/dashboard.feature
  32. 0  vendor/refinerycms/dashboard/features/step_definitions/.gitkeep
  33. +21 −19 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
  34. +7 −2 vendor/refinerycms/images/app/views/admin/images/_existing_image.html.erb
  35. +18 −20 vendor/refinerycms/images/app/views/admin/images/_form.html.erb
  36. +22 −27 vendor/refinerycms/images/app/views/admin/images/index.html.erb
  37. +1 −1  vendor/refinerycms/images/features/manage_images.feature
  38. +4 −9 vendor/refinerycms/images/lib/images.rb
  39. +5 −10 vendor/refinerycms/pages/app/controllers/pages_controller.rb
  40. +2 −3 vendor/refinerycms/pages/app/models/page.rb
  41. +15 −5 vendor/refinerycms/pages/app/views/admin/pages/_form_page_parts.html.erb
  42. +2 −1  vendor/refinerycms/pages/app/views/admin/pages/_sortable_list.html.erb
  43. +27 −22 vendor/refinerycms/pages/app/views/admin/pages/index.html.erb
  44. +1 −1  vendor/refinerycms/pages/features/manage_pages.feature
  45. +5 −0 vendor/refinerycms/pages/lib/pages.rb
  46. +30 −0 vendor/refinerycms/pages/lib/pages/tabs.rb
  47. +8 −1 vendor/refinerycms/pages/spec/models/page_spec.rb
  48. +32 −33 vendor/refinerycms/resources/app/views/admin/resources/index.html.erb
  49. +1 −1  vendor/refinerycms/resources/features/manage_files.feature
  50. +7 −12 vendor/refinerycms/resources/lib/resources.rb
  51. +1 −1  vendor/refinerycms/settings/app/models/refinery_setting.rb
  52. +2 −3 vendor/refinerycms/settings/app/views/admin/refinery_settings/index.html.erb
  53. +1 −1  vendor/refinerycms/settings/features/manage_refinery_settings.feature
View
11 Gemfile
@@ -36,10 +36,11 @@ gem 'mysql', '2.8.1'
gem 'refinerycms', :path => '.'
# Specify additional Refinery CMS Engines here (all optional):
-gem 'refinerycms-inquiries', '~> 0.9.8.9'
+gem 'refinerycms-inquiries', '~> 0.9.8.10'
# gem 'refinerycms-news', '~> 0.9.9'
# gem 'refinerycms-portfolio', '~> 0.9.8'
# gem 'refinerycms-theming', '~> 0.9.8.1'
+# gem 'refinerycms-search', '~> 0.9.8'
# Add i18n support (optional, you can remove this if you really want to).
gem 'refinerycms-i18n', '~> 0.9.8.7'
@@ -54,10 +55,6 @@ rmagick_options.update({
# Specify a version of RMagick that works in your environment:
gem 'rmagick', '~> 2.12.0', rmagick_options
-# END REFINERY CMS ============================================================
-
-# REFINERY CMS DEVELOPMENT ====================================================
-
group :test do
# RSpec
gem 'rspec', (RSPEC_VERSION = '~> 2.0.0.beta')
@@ -85,7 +82,9 @@ group :test do
gem 'autotest-notification'
end
-#===REFINERY END OF REQUIRED GEMS===
+# END REFINERY CMS ============================================================
+
+# REFINERY CMS DEVELOPMENT ====================================================
# Bundle gems for certain environments:
View
40 Gemfile.lock
@@ -49,7 +49,7 @@ GEM
activesupport (~> 3.0.0)
authlogic (2.1.6)
activesupport
- autotest (4.3.2)
+ autotest (4.4.1)
autotest-notification (2.3.1)
autotest (~> 4.3)
autotest-rails (4.1.0)
@@ -64,10 +64,10 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (>= 0.0.3)
configuration (1.1.0)
- cucumber (0.9.0)
+ cucumber (0.9.2)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
- gherkin (~> 2.2.2)
+ gherkin (~> 2.2.5)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
cucumber-rails (0.3.2)
@@ -85,10 +85,9 @@ GEM
filters_spam (0.3)
friendly_id (3.1.7)
babosa (~> 0.2.0)
- gherkin (2.2.4)
+ gherkin (2.2.8)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
- trollop (~> 1.16.2)
i18n (0.4.1)
json (1.4.6)
json_pure (1.4.6)
@@ -129,23 +128,23 @@ GEM
refinerycms-i18n (0.9.8.7)
refinerycms (>= 0.9.8)
routing-filter (~> 0.1.6)
- refinerycms-inquiries (0.9.8.9)
+ refinerycms-inquiries (0.9.8.10)
filters_spam (~> 0.2)
rmagick (2.12.2)
- routing-filter (0.1.6)
+ routing-filter (0.1.7)
actionpack
- 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)
+ rspec (2.0.0.rc)
+ rspec-core (= 2.0.0.rc)
+ rspec-expectations (= 2.0.0.rc)
+ rspec-mocks (= 2.0.0.rc)
+ rspec-core (2.0.0.rc)
+ rspec-expectations (2.0.0.rc)
diff-lcs (>= 1.1.2)
- 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)
+ rspec-mocks (2.0.0.rc)
+ rspec-core (= 2.0.0.rc)
+ rspec-expectations (= 2.0.0.rc)
+ rspec-rails (2.0.0.rc)
+ rspec (= 2.0.0.rc)
ruby-prof (0.9.2)
rubyzip (0.9.4)
selenium-webdriver (0.0.28)
@@ -154,10 +153,9 @@ GEM
rubyzip
spork (0.8.4)
term-ansicolor (1.0.5)
- thor (0.14.1)
+ thor (0.14.3)
treetop (1.4.8)
polyglot (>= 0.3.1)
- trollop (1.16.2)
truncate_html (0.4.0)
tzinfo (0.3.23)
will_paginate (3.0.pre2)
@@ -183,7 +181,7 @@ DEPENDENCIES
rails (~> 3.0.0)
refinerycms!
refinerycms-i18n (~> 0.9.8.7)
- refinerycms-inquiries (~> 0.9.8.9)
+ refinerycms-inquiries (~> 0.9.8.10)
rmagick (~> 2.12.0)
rspec (~> 2.0.0.beta)
rspec-core (~> 2.0.0.beta)
View
9 bin/refinerycms
@@ -128,14 +128,15 @@ module Refinery
def refine!
# Overwrite rails defaults with refinery defaults
- %w(app db).each do |folder|
+ %w(app db features spec).each do |folder|
FileUtils::cp_r Refinery.root.join(folder), @app_path, :verbose => false
end
# Copy in important files to the Rails app.
- %w(.gitignore readme.md license.md config/routes.rb config/settings.rb config/environments/production.rb
- config/initializers/acts_as_indexed_config.rb config/initializers/field_with_error_fix.rb
- config/initializers/fix_rack.rb).each do |file|
+ %w(.gitignore readme.md license.md config/routes.rb config/settings.rb config/cucumber.yml
+ lib/tasks/cucumber.rake lib/tasks/rspec.rake config/initializers/fix_rack.rb
+ config/environments/development.rb config/environments/test.rb config/environments/production.rb
+ config/initializers/acts_as_indexed_config.rb config/initializers/field_with_error_fix.rb).each do |file|
FileUtils::cp_r Refinery.root.join(file), @app_path.join(file), :verbose => false if Refinery.root.join(file).exist?
end
View
20 changelog.md
@@ -1,3 +1,23 @@
+## 0.9.9 [Unreleased]
+
+* Better, more semantic HTML5. [Joe Sak](http://github.com/joemsak)
+* Added ``role`` selection for ``admin/users#edit`` [Hez Ronningen](http://github.com/hez)
+* Fixed WYMeditor bug regarding adding links, helped with persistent testing by [Marko Hriberšek](http://github.com/markoh). [Philip Arndt](http://github.com/parndt)
+* Better ``RSpec`` coverage [Joe Sak](http://github.com/joemsak) and [Philip Arndt](http://github.com/parndt)
+* Superusers now get access to all backend tabs by default. [Philip Arndt](http://github.com/parndt)
+* Introduced LOLcat translation (yes, seriously) as an easter egg. [Steven Heidel](http://github.com/stevenheidel)
+* Fixed several missing translations. [Johan Bruning](http://github.com/GidoGeek)
+* Solved several i18n inconsistencies [Jonas Hartmann](http://github.com/ionas)
+* Made ``UserPlugin`` dependent on ``User`` which solves a data redundancy problem [Maarten Hoogendoorn](http://github.com/moretea)
+* Fixed issue with finding where engines are located on the disk using ``Plugin::pathname`` [Lele](http://github.com/leleintercom)
+* Add ``rescue_not_found`` option to turn on/off 404 rendering. [Ryan Bigg](http://github.com/radar)
+* Full review of the French translations [Jérémie Horhant](http://github.com/Titinux)
+* Now using ``mail()`` to send emails. [J. Edward Dewyea](http://github.com/commuter)
+* Refactored backend HTML & CSS, reduced complexity and added a loading animation when you click Save on forms. [Philip Arndt](http://github.com/parndt)
+* Improved the speed of the menu especially related to scaling through reusing collections rather then revisiting the database. [Amanda Wagener](http://github.com/awagener)
+* Implemented an API for the ``pages`` form's tabs. [David Jones](http://github.com/djones)
+* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8.5...0.9.9)
+
## 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)
View
3  config/environments/development.rb
@@ -22,6 +22,9 @@
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
end
# Don't handle some exceptions with the 404 page.
View
8 lib/gemspec.rb
@@ -1,20 +1,18 @@
#!/usr/bin/env ruby
require File.expand_path('../../vendor/refinerycms/refinery.rb', __FILE__)
files = %w( .gitignore .yardopts Gemfile *.md ).map { |file| Dir[file] }.flatten
-%w(app bin config db features lib public script test themes vendor).sort.each do |dir|
+%w(app bin config db features lib public script spec test themes vendor).sort.each do |dir|
files += Dir.glob("#{dir}/**/*")
end
rejection_patterns = [
"public\/system",
"^config\/(application|boot|environment).rb$",
"^config\/initializers\/(backtrace_silencers|inflections|mime_types|secret_token|session_store).rb$",
- "^config\/(cucumber|database|i18n\-js).yml$",
+ "^config\/(database|i18n\-js).yml$",
"^public\/",
"^lib\/gemspec\.rb",
- "^lib\/tasks",
".*\/cache\/",
"^db\/.*\.sqlite3?(-journal)?$",
- "^features\/?",
"^script\/*",
"^vendor\/plugins\/?$",
"\.log$",
@@ -22,7 +20,7 @@
]
files.reject! do |f|
- !File.exist?(f) or f =~ %r{(#{rejection_patterns.join(')|(')})}
+ !File.exist?(f) or f =~ %r{(#{rejection_patterns.join(')|(')})} or (File.directory?(f) and Dir[File.join(f, "*")].empty?)
end
gemspec = <<EOF
View
23 refinerycms.gemspec
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
s.name = %q{refinerycms}
s.version = %q{0.9.9.pre}
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-28}
+ s.date = %q{2010-10-06}
s.summary = %q{A Ruby on Rails CMS that supports Rails 3}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
@@ -36,11 +36,9 @@ Gem::Specification.new do |s|
'app/controllers/application_controller.rb',
'app/helpers',
'app/helpers/application_helper.rb',
- 'app/mailers',
- 'app/models',
- 'app/views',
'bin/refinerycms',
'changelog.md',
+ 'config/cucumber.yml',
'config/database.yml.mysql',
'config/database.yml.postgresql',
'config/database.yml.sqlite3',
@@ -89,14 +87,27 @@ Gem::Specification.new do |s|
'db/migrate/20100826232810_move_inquiry_settings_to_refinery_settings.rb',
'db/migrate/20100831122919_move_page_to_nested_set.rb',
'db/migrate/20100913234704_add_cached_slug_to_pages.rb',
+ 'db/migrate/20100929035252_add_missing_indexes_to_roles_users.rb',
'db/schema.rb',
'db/seeds',
'db/seeds.rb',
'db/seeds/inquiry_settings.rb',
'db/seeds/pages.rb',
'db/seeds/refinery_settings.rb',
+ 'features/step_definitions',
+ 'features/step_definitions/web_steps.rb',
+ 'features/support',
+ 'features/support/env.rb',
+ 'features/support/factories.rb',
+ 'features/support/negative_expectations_helper.rb',
+ 'features/support/paths.rb',
+ 'lib/tasks',
+ 'lib/tasks/cucumber.rake',
+ 'lib/tasks/rspec.rake',
'license.md',
'readme.md',
+ 'spec/rcov.opts',
+ 'spec/spec_helper.rb',
'todo.md',
'vendor/refinerycms',
'vendor/refinerycms/authentication',
@@ -289,7 +300,6 @@ Gem::Specification.new do |s|
'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',
@@ -783,6 +793,7 @@ Gem::Specification.new do |s|
'vendor/refinerycms/dashboard/app/views',
'vendor/refinerycms/dashboard/app/views/admin',
'vendor/refinerycms/dashboard/app/views/admin/dashboard',
+ 'vendor/refinerycms/dashboard/app/views/admin/dashboard/_additional_dashboard_menu_items.html.erb',
'vendor/refinerycms/dashboard/app/views/admin/dashboard/_recent_activity.html.erb',
'vendor/refinerycms/dashboard/app/views/admin/dashboard/_recent_inquiries.html.erb',
'vendor/refinerycms/dashboard/app/views/admin/dashboard/index.html.erb',
@@ -806,7 +817,6 @@ Gem::Specification.new do |s|
'vendor/refinerycms/dashboard/config/routes.rb',
'vendor/refinerycms/dashboard/features',
'vendor/refinerycms/dashboard/features/dashboard.feature',
- 'vendor/refinerycms/dashboard/features/step_definitions',
'vendor/refinerycms/dashboard/features/support',
'vendor/refinerycms/dashboard/features/support/paths.rb',
'vendor/refinerycms/dashboard/lib',
@@ -929,6 +939,7 @@ Gem::Specification.new do |s|
'vendor/refinerycms/pages/lib/pages',
'vendor/refinerycms/pages/lib/pages.rb',
'vendor/refinerycms/pages/lib/pages/marketable_routes.rb',
+ 'vendor/refinerycms/pages/lib/pages/tabs.rb',
'vendor/refinerycms/pages/readme.md',
'vendor/refinerycms/pages/spec',
'vendor/refinerycms/pages/spec/models',
View
11 spec/spec_helper.rb
@@ -63,3 +63,14 @@ def each_run
setup_environment
each_run
end
+
+def capture_stdout(&block)
+ original_stdout = $stdout
+ $stdout = fake = StringIO.new
+ begin
+ yield
+ ensure
+ $stdout = original_stdout
+ end
+ fake.string
+end
View
12 vendor/refinerycms/authentication/app/mailers/user_mailer.rb
@@ -1,10 +1,11 @@
class UserMailer < ActionMailer::Base
def reset_notification(user, request)
- setup_email(user)
- subject I18n.translate('user_mailer.link_to_reset_your_password')
+ @user = user
@url = reset_users_url(:host => request.host_with_port,
:reset_code => user.perishable_token)
+ mail(:to => user.email,
+ :subject => I18n.translate('user_mailer.link_to_reset_your_password'))
end
protected
@@ -12,11 +13,4 @@ def reset_notification(user, request)
def url_prefix(request)
"#{request.protocol}#{request.host_with_port}"
end
-
- def setup_email(user)
- recipients user.email
- sent_on Time.now
- @user = user
- end
-
end
View
14 vendor/refinerycms/authentication/app/views/admin/users/index.html.erb
@@ -1,10 +1,3 @@
-<div id='actions'>
- <ul>
- <li>
- <%= link_to t('.create_new_user'), new_admin_user_url, :class => "add_icon" %>
- </li>
- </ul>
-</div>
<div id='records'>
<%= will_paginate @users, :previous_label => '&laquo;', :next_label => '&raquo;' %>
<ul>
@@ -12,3 +5,10 @@
</ul>
<%= will_paginate @users, :previous_label => '&laquo;', :next_label => '&raquo;' %>
</div>
+<div id='actions'>
+ <ul>
+ <li>
+ <%= link_to t('.create_new_user'), new_admin_user_url, :class => "add_icon" %>
+ </li>
+ </ul>
+</div>
View
1  vendor/refinerycms/authentication/features/lost_password.feature
@@ -1,3 +1,4 @@
+@refinerycms @users @users-password
Feature: Lost Password
In order to restore my password
As a lost soul
View
2  vendor/refinerycms/authentication/features/manage_users.feature
@@ -1,4 +1,4 @@
-@users @users-manage
+@refinerycms @users @users-manage
Feature: Manage Users
In order to control who can access my website's backend
As an administrator
View
8 vendor/refinerycms/core/app/views/shared/_menu_branch.html.erb
@@ -1,14 +1,14 @@
<%
- css = if ((defined?(apply_css) && apply_css) || !defined?(apply_css)) and
- (classes = css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count||=nil)).any?
- "class='#{classes.join(' ')}'"
+ apply_css = true unless defined?(apply_css)
+ if apply_css and (classes = css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count||=nil, collection)).any?
+ css = "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 ? [] : collection.select { |p| p.parent_id == menu_branch.id && p.in_menu? }
-%>
-<li<%= ['', css, dom_id].join(' ').gsub(/\ *$/, '') %>>
+<li<%= ['', css, dom_id].compact.join(' ').gsub(/\ *$/, '') %>>
<%= link_to menu_branch.title, menu_branch.url -%>
<% if children.present? -%>
<ul class='clearfix'>
View
5 vendor/refinerycms/core/app/views/shared/admin/_make_sortable.html.erb
@@ -1,5 +1,6 @@
-<% content_for :head_after_javascript_libraries, javascript_include_tag('refinery/nestedsortables.js') if (tree ||= false) %>
-<% content_for :head_after_javascript_libraries, javascript_include_tag('refinery/serializelist.js') %>
+<% content_for :head_after_javascript_libraries,
+ javascript_include_tag('refinery/nestedsortables.js',
+ 'refinery/serializelist.js') -%>
<% content_for :head do %>
<script type='text/javascript'>
$(document).ready(function(){
View
8 vendor/refinerycms/core/config/locales/da.yml
@@ -8,10 +8,6 @@ da:
menu:
reorder_menu: Omorganisér menuen
reorder_menu_done: "Jeg er færdig med omorganiseringen"
- search: Søg
- search_submit: Søg
- search_results_for: "Søgeresultat for '%{query}'"
- search_no_results: "Desværre, din søgning gav ingen resultater"
refinery:
other: "Anden %{what}"
reorder: "Redigér rækkefølgen af %{what}"
@@ -51,6 +47,10 @@ da:
opens_in_new_window: "Åbner i nyt vindue"
remove_current: "Fjern nuværende %{what}"
resource: fil
+ search:
+ button_text: Søg
+ results_for: "Søgeresultat for '%{query}'"
+ no_results: "Desværre, din søgning gav ingen resultater"
message:
close: Luk
activerecord:
View
8 vendor/refinerycms/core/config/locales/it.yml
@@ -8,10 +8,6 @@ it:
menu:
reorder_menu: Riordina menu
reorder_menu_done: "Ho finito riordino del menu"
- search: Cerca
- search_submit: Andare
- search_results_for: "Risultati della ricerca per '%{query}'"
- search_no_results: "Spiacenti, nessun risultato trovato"
refinery:
other: "Altro %{what}"
reorder: "Riordina %{what}"
@@ -51,6 +47,10 @@ it:
opens_in_new_window: Apre in una nuova finestra
remove_current: "Togliere corrente %{what}"
resource: risorsa
+ search:
+ button_text: Cerca
+ results_for: "Risultati della ricerca per '%{query}'"
+ no_results: "Spiacenti, nessun risultato trovato"
message:
close: Fine
View
8 vendor/refinerycms/core/config/locales/nb.yml
@@ -8,10 +8,6 @@ nb:
menu:
reorder_menu: Endre rekkefølgen på menyen
reorder_menu_done: "Jeg er ferdig å endre rekkefølgen på menyen"
- search: Søk
- search_submit: Søk
- search_results_for: "Søkeresultater for '%{query}'"
- search_no_results: "Beklager, ditt søk returnerte ingen resultater"
images:
existing_image:
submit_insert: Sett Inn
@@ -56,6 +52,10 @@ nb:
opens_in_new_window: Åpner i et nytt vindu
remove_current: "Fjern gjeldende %{what}"
resource: ressurs
+ search:
+ button_text: Søk
+ results_for: "Søkeresultater for '%{query}'"
+ no_results: "Beklager, ditt søk returnerte ingen resultater"
message:
close: Lukk
close_this_message: Lukk denne meldingen
View
10 vendor/refinerycms/core/config/locales/ru.yml
@@ -8,10 +8,6 @@ ru:
menu:
reorder_menu: Изменить порядок в меню
reorder_menu_done: Сохранить такой порядок в меню
- search: Поиск
- search_submit: Далее
- search_results_for: "Результаты поиска для &laquo;{{query}}&raquo;"
- search_no_results: Ничего не найдено
images:
existing_image:
submit_insert: Вставить
@@ -55,7 +51,11 @@ ru:
download_current: "Download current {{what}}"
opens_in_new_window: Opens in a new window
remove_current: "Remove current {{what}}"
- resource: resource
+ resource: resource
+ search:
+ button_text: Поиск
+ results_for: "Результаты поиска для &laquo;{{query}}&raquo;"
+ no_results: Ничего не найдено
message:
close: Закрыть
close_this_message: Закрыть это сообщение
View
2  vendor/refinerycms/core/features/engine_generator.feature
@@ -1,4 +1,4 @@
-@engine-generator @generator
+@refinerycms @engine-generator @generator
Feature: Engine generation
In order to create my own engine
As a refinery user
View
2  vendor/refinerycms/core/features/search.feature
@@ -1,4 +1,4 @@
-@search
+@refinerycms @search
Feature: Search
In order find content more quickly
As an administrator
View
2  vendor/refinerycms/core/features/site_bar.feature
@@ -1,4 +1,4 @@
-@site_bar
+@refinerycms @site_bar
Feature: Site Bar
In order to allow administrators to easily switch between editing and viewing their website
I want logged in refinery users to see a site bar
View
59 vendor/refinerycms/core/lib/generators/refinery_engine/templates/app/views/admin/plural_name/index.html.erb
@@ -1,3 +1,29 @@
+<div id='records'>
+ <%% if searching? %>
+ <h2><%%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
+ <%% end %>
+ <%% if @<%= plural_name %>.any? %>
+ <%%= will_paginate @<%= plural_name %>,
+ :previous_label => '&laquo;',
+ :next_label => '&raquo;' %>
+
+ <%%= render :partial => "sortable_list" %>
+
+ <%%= will_paginate @<%= plural_name %>,
+ :previous_label => '&laquo;',
+ :next_label => '&raquo;' %>
+ <%% else %>
+ <p>
+ <%% unless searching? %>
+ <strong>
+ <%%= t('.no_items_yet') %>
+ </strong>
+ <%% else %>
+ <%%= t('shared.admin.search.no_results') %>
+ <%% end %>
+ </p>
+ <%% end %>
+</div>
<div id='actions'>
<ul>
<li>
@@ -26,39 +52,6 @@
<%% end %>
</ul>
</div>
-<div id='records'>
- <%% if searching? %>
- <h2><%%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
- <%% if @<%= plural_name %>.any? %>
- <%%= will_paginate @<%= plural_name %>, :previous_label => '&laquo;', :next_label => '&raquo;' %>
- <ul>
- <%%= render :partial => "<%= singular_name %>",
- :collection => @<%= plural_name %> %>
- </ul>
- <%%= will_paginate @<%= plural_name %>, :previous_label => '&laquo;', :next_label => '&raquo;' %>
- <%% else %>
- <p><%%= t('shared.admin.search.no_results') %></p>
- <%% end %>
- <%% else %>
- <%% if @<%= plural_name %>.any? %>
- <%%= will_paginate @<%= plural_name %>,
- :previous_label => '&laquo;',
- :next_label => '&raquo;' %>
-
- <%%= render :partial => "sortable_list" %>
-
- <%%= will_paginate @<%= plural_name %>,
- :previous_label => '&laquo;',
- :next_label => '&raquo;' %>
- <%% else %>
- <p>
- <strong>
- <%%= t('.no_items_yet') %>
- </strong>
- </p>
- <%% end %>
- <%% end %>
-</div>
<%%= render :partial => "/shared/admin/make_sortable",
:locals => {
:tree => false
View
174 vendor/refinerycms/core/lib/refinery/application_controller.rb
@@ -1,112 +1,116 @@
require 'action_controller'
-module Refinery::ApplicationController
-
- def self.included(controller)
- controller.send :include, InstanceMethods
- controller.send :include, ClassMethods
- end
+module Refinery
+ module ApplicationController
+
+ def self.included(controller)
+ #unless controller.class.instance_methods.map(&:to_sym).include?(:crudify)
+ controller.send :include, ::Refinery::ApplicationController::InstanceMethods
+ controller.send :include, ::Refinery::ApplicationController::ClassMethods
+ #end
+ end
- module ClassMethods
- def self.included(c) # Extend controller
- c.helper_method :home_page?,
- :local_request?,
- :just_installed?,
- :from_dialog?,
- :admin?,
- :login?
+ module ClassMethods
+ def self.included(c) # Extend controller
+ c.helper_method :home_page?,
+ :local_request?,
+ :just_installed?,
+ :from_dialog?,
+ :admin?,
+ :login?
- c.protect_from_forgery # See ActionController::RequestForgeryProtection
+ c.protect_from_forgery # See ActionController::RequestForgeryProtection
- c.send :include, Crud # basic create, read, update and delete methods
- c.send :include, AuthenticatedSystem
+ c.send :include, Crud # basic create, read, update and delete methods
+ c.send :include, AuthenticatedSystem
- c.send :before_filter, :find_pages_for_menu,
- :show_welcome_page?
+ c.send :before_filter, :find_pages_for_menu,
+ :show_welcome_page?
- c.send :after_filter, :store_current_location!,
- :if => Proc.new {|c| c.send(:refinery_user?) rescue false }
+ c.send :after_filter, :store_current_location!,
+ :if => Proc.new {|c| c.send(:refinery_user?) rescue false }
- if Refinery.rescue_not_found
- c.send :rescue_from, ActiveRecord::RecordNotFound,
- ActionController::UnknownAction,
- ActionView::MissingTemplate,
- :with => :error_404
+ if Refinery.rescue_not_found
+ c.send :rescue_from, ActiveRecord::RecordNotFound,
+ ActionController::UnknownAction,
+ ActionView::MissingTemplate,
+ :with => :error_404
+ end
end
end
- end
- module InstanceMethods
- def admin?
- controller_name =~ %r{^admin/}
- end
+ module InstanceMethods
+ def admin?
+ controller_name =~ %r{^admin/}
+ end
- def error_404(exception=nil)
- if (@page = Page.where(:menu_match => "^/404$").includes(:parts, :slugs).first).present?
- # render the application's custom 404 page with layout and meta.
- render :template => "/pages/show",
- :format => 'html',
- :status => 404
- else
- # fallback to the default 404.html page.
- file = Rails.root.join('public', '404.html')
- file = Refinery.root.join('vendor', 'refinerycms', 'core', 'public', '404.html') unless file.exist?
- render :file => file.cleanpath.to_s,
- :layout => false,
- :status => 404
+ def error_404(exception=nil)
+ if (@page = Page.where(:menu_match => "^/404$").includes(:parts, :slugs).first).present?
+ # render the application's custom 404 page with layout and meta.
+ render :template => "/pages/show",
+ :format => 'html',
+ :status => 404
+ else
+ # fallback to the default 404.html page.
+ file = Rails.root.join('public', '404.html')
+ file = Refinery.root.join('vendor', 'refinerycms', 'core', 'public', '404.html') unless file.exist?
+ render :file => file.cleanpath.to_s,
+ :layout => false,
+ :status => 404
+ end
end
- end
- def from_dialog?
- params[:dialog] == "true" or params[:modal] == "true"
- end
+ def from_dialog?
+ params[:dialog] == "true" or params[:modal] == "true"
+ end
- def home_page?
- root_url(:only_path => true) == request.path
- end
+ def home_page?
+ root_url(:only_path => true) == request.path
+ end
- def just_installed?
- Role[:refinery].users.empty?
- end
+ def just_installed?
+ Role[:refinery].users.empty?
+ end
- def local_request?
- Rails.env.development? or request.remote_ip =~ /(::1)|(127.0.0.1)|((192.168).*)/
- end
+ def local_request?
+ Rails.env.development? or request.remote_ip =~ /(::1)|(127.0.0.1)|((192.168).*)/
+ end
- def login?
- (controller_name =~ /^(user|session)(|s)/ and not admin?) or just_installed?
- end
+ def login?
+ (controller_name =~ /^(user|session)(|s)/ and not admin?) or just_installed?
+ end
- protected
+ protected
- # get all the pages to be displayed in the site menu.
- def find_pages_for_menu
- @menu_pages = Page.where(:show_in_menu => true, :draft => false).order('lft ASC').includes(:parts)
- end
+ # get all the pages to be displayed in the site menu.
+ def find_pages_for_menu
+ @menu_pages = Page.where(:show_in_menu => true, :draft => false).order('lft ASC').includes(:parts)
+ end
- # use a different model for the meta information.
- def present(model)
- presenter = (Object.const_get("#{model.class}Presenter") rescue ::Refinery::BasePresenter)
- @meta = presenter.new(model)
- end
+ # use a different model for the meta information.
+ def present(model)
+ presenter = (Object.const_get("#{model.class}Presenter") rescue ::Refinery::BasePresenter)
+ @meta = presenter.new(model)
+ end
- # this hooks into the Rails render method.
- def render(action = nil, options = {}, &blk)
- present(@page) unless admin? or @meta.present?
- super
- end
+ # this hooks into the Rails render method.
+ def render(action = nil, options = {}, &blk)
+ present(@page) unless admin? or @meta.present?
+ super
+ end
- def show_welcome_page?
- render :template => "/welcome", :layout => "login" if just_installed? and controller_name != "users"
- end
+ def show_welcome_page?
+ render :template => "/welcome", :layout => "login" if just_installed? and controller_name != "users"
+ end
- private
- def store_current_location!
- if admin?
- # ensure that we don't redirect to AJAX or POST/PUT/DELETE urls
- session[:refinery_return_to] = request.path if request.get? and !request.xhr? and !from_dialog?
- elsif defined?(@page) and @page.present?
- session[:website_return_to] = @page.url
+ private
+ def store_current_location!
+ if admin?
+ # ensure that we don't redirect to AJAX or POST/PUT/DELETE urls
+ session[:refinery_return_to] = request.path if request.get? and !request.xhr? and !from_dialog?
+ elsif defined?(@page) and @page.present?
+ session[:website_return_to] = @page.url
+ end
end
end
end
View
17 vendor/refinerycms/core/lib/refinery/helpers/menu_helper.rb
@@ -4,9 +4,9 @@ module MenuHelper
# This was extracted from REFINERY_ROOT/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb
# to remove the complexity of that template by reducing logic in the view.
- def css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count = nil)
+ def css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count = nil, collection = [])
css = []
- css << "selected" if selected_page?(menu_branch) or descendant_page_selected?(menu_branch)
+ css << "selected" if selected_page?(menu_branch) or descendant_page_selected?(menu_branch, collection)
css << "first" if menu_branch_counter == 0
css << "last" if menu_branch_counter == (sibling_count ||= menu_branch.shown_siblings.size)
css
@@ -14,8 +14,17 @@ def css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count = nil)
# Determines whether any page underneath the supplied page is the current page according to rails.
# Just calls selected_page? for each descendant of the supplied page.
- def descendant_page_selected?(page)
- page.has_descendants? and page.descendants.any? {|descendant| selected_page?(descendant) }
+ # if you pass a collection it won't check its own descendants but use the collection supplied.
+ def descendant_page_selected?(page, collection = [])
+ return false unless page.has_descendants?
+
+ descendants = if collection.present?
+ collection.select{ |item| item.parent_id == page.id }
+ else
+ page.descendants
+ end
+
+ descendants.any? {|d| selected_page?(d) }
end
# Determine whether the supplied page is the currently open page according to Refinery.
View
2  vendor/refinerycms/core/lib/refinery/plugin.rb
@@ -13,7 +13,7 @@ def self.register(&block)
Page.friendly_id_config.reserved_words << reserved_word
end
- raise "A plugin MUST have a name!: #{plugin.inspect}" if plugin.name.nil?
+ raise "A plugin MUST have a name!: #{plugin.inspect}" if plugin.name.blank?
# Set the root as Rails::Engine.called_from will always be
# vendor/engines/refinery/lib/refinery
View
10 vendor/refinerycms/core/public/javascripts/refinery/admin.js
@@ -78,6 +78,16 @@ init_interface = function() {
$('#other_locales').animate({opacity: 'toggle', height: 'toggle'}, 250);
e.preventDefault();
});
+
+ $('#existing_image img').load(function(){
+ $('form.edit_image .form-actions').css({
+ 'margin-top': ($('#existing_image').height() - $('form.edit_image').height() + 8)
+ });
+ });
+
+ $('.form-actions .form-actions-left input:submit#submit_button').click(function(e) {
+ $("<img src='/images/refinery/icons/ajax-loader.gif' width='16' height='16' class='save-loader' />").appendTo($(this).parent());
+ });
}
init_modal_dialogs = function(){
View
36 vendor/refinerycms/core/public/stylesheets/refinery/application.css
@@ -1,27 +1,48 @@
body {
margin: 0px;
}
-#page_container, #site_bar_content, footer, header {
+#page, #site_bar_content, footer, header {
width: 1000px;
margin: 0px auto;
}
-#page_container {
- padding: 20px;
-}
#body_content_left {
float: left;
- width: 600px;
+ width: 590px;
+ padding-right: 10px;
}
#body_content_right {
float: right;
- width: 360px;
+ padding-left: 10px;
+ width: 390px;
+}
+#body_content.no_body_content_left #body_content_right,
+ #body_content.no_body_content_right #body_content_left {
+ width: 100%;
+ padding-left: 0px;
+ padding-right: 0px;
}
.inquiries form label {
width: 150px;
float: left;
}
+.menu ul {
+ margin: 0px;
+ padding: 0px;
+}
+.menu li {
+ padding: 0px;
+ margin: 0px 9px 0px 0px;
+ list-style: none;
+ float: left;
+}
+.menu li.last {
+ margin-right: 0px;
+}
+.menu li.selected a {
+ font-weight: bold;
+}
.inquiries form input {
-
+ width: 200px;
}
.inquiries form input, .inquiries form textarea {
@@ -33,6 +54,7 @@ body {
margin-left: 150px;
}
.inquiries form .actions input {
+ width: auto;
}
.inquiries .field {
margin: 12px 0px;
View
13 vendor/refinerycms/core/public/stylesheets/refinery/refinery.css
@@ -1106,6 +1106,11 @@ a#toggle_advanced_options:hover {
#content .form-actions .form-actions-right, .wym_dialog .form-actions .form-actions-right, .ui-dialog .form-actions .form-actions-right {
right: 10px;
}
+#content .form-actions .save-loader {
+ position: absolute;
+ right: -24px;
+ top: 4px;
+}
.wym_dialog .form-actions, .ui-dialog .form-actions {
border: 0px none;
border-top: 1px solid #E8E8E8;
@@ -1178,6 +1183,14 @@ ul#image_grid li p {
ul#image_grid li span.actions {
width: 100%;
}
+#content form.edit_image {
+ width: 70%;
+ float: left;
+}
+#content #existing_image {
+ float: right;
+ width: 25%;
+}
ul.checkboxes {
margin: 0px;
padding: 0px;
View
1  vendor/refinerycms/dashboard/app/views/admin/dashboard/_additional_dashboard_menu_items.html.erb
@@ -0,0 +1 @@
+<%# Add items here to have them appear on your dashboard's right hand side menu %>
View
5 vendor/refinerycms/dashboard/app/views/admin/dashboard/index.html.erb
@@ -1,7 +1,7 @@
<div class='clearfix'>
<div id='records' class='clearfix<%= ' one_list' if @recent_activity.empty? or @recent_inquiries.empty? %>'>
- <%= render :partial => "recent_activity" if @recent_activity.any? %>
- <%= render :partial => "recent_inquiries" if @recent_inquiries.any? %>
+ <%= render :partial => "recent_activity" if @recent_activity.present? %>
+ <%= render :partial => "recent_inquiries" if @recent_inquiries.present? %>
</div>
<div id='actions'>
<h2><%= t('.quick_tasks').titleize %></h2>
@@ -38,6 +38,7 @@
:class => "add_icon" %>
</li>
<% end %>
+ <%= render :partial => 'additional_dashboard_menu_items' %>
<li>
<%= link_to t('.see_home_page'), root_url,
:class => "go_icon",
View
2  vendor/refinerycms/dashboard/features/dashboard.feature
@@ -1,4 +1,4 @@
-@dashboard
+@refinerycms @dashboard
Feature: Dashboard
In order to see recent changes to my website
As an administrator
View
0  vendor/refinerycms/dashboard/features/step_definitions/.gitkeep
No changes.
View
40 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
@@ -1,27 +1,29 @@
-module Admin::ImagesHelper
+module Admin
+ module ImagesHelper
- def image_views
- RefinerySetting.find_or_set(:image_views, [:grid, :list])
- end
+ def image_views
+ RefinerySetting.find_or_set(:image_views, [:grid, :list])
+ end
- def current_image_view
- RefinerySetting.find_or_set(:preferred_image_view, :list)
- end
+ def current_image_view
+ RefinerySetting.find_or_set(:preferred_image_view, :list)
+ end
- def other_image_views
- image_views.reject {|image_view| image_view.to_s == current_image_view.to_s }
- end
+ def other_image_views
+ image_views.reject {|image_view| image_view.to_s == current_image_view.to_s }
+ end
- def change_list_mode_if_specified
- if action_name == 'index' and params[:view].present? and image_views.include?(params[:view].to_sym)
- RefinerySetting.set(:preferred_image_view, params[:view])
+ def change_list_mode_if_specified
+ if action_name == 'index' and params[:view].present? and image_views.include?(params[:view].to_sym)
+ RefinerySetting.set(:preferred_image_view, params[:view])
+ end
end
- end
- def images_paginator(collection, dialog = false)
- will_paginate collection, :previous_label => '&laquo; Previous',
- :next_label => 'Next &raquo;',
- :renderer => Refinery::LinkRenderer
- end
+ def images_paginator(collection, dialog = false)
+ will_paginate collection, :previous_label => '&laquo; Previous',
+ :next_label => 'Next &raquo;',
+ :renderer => Refinery::LinkRenderer
+ end
+ end
end
View
9 vendor/refinerycms/images/app/views/admin/images/_existing_image.html.erb
@@ -14,13 +14,17 @@
<% end -%>
</ul>
</div>
+
<%= images_paginator @images, from_dialog? %>
+
<% unless @app_dialog %>
<div id='existing_image_size_area' class='clearfix'>
<input type='hidden' name='selected_image_size' id='selected_image_size' />
<p>
<input type="checkbox" id="wants_to_resize_image" name="wants_to_resize_image" value="1" checked="checked" />
- <label for='wants_to_resize_image' class='stripped'><strong><%= t('.resize_image').html_safe %></strong></label>
+ <label for='wants_to_resize_image' class='stripped' style='font-weight: bold;'>
+ <%= t('.resize_image').html_safe %>
+ </label>
</p>
<ul>
<%
@@ -32,7 +36,7 @@
).sort_by{|k,v| v}.each_with_index do |(size, pixels), index|
safe_pixels = pixels.to_s.gsub(/[<>=]/, '')
-%>
- <li id="image_dialog_size_<%= index %>" class="image_dialog_size <%= 'selected' if size.to_s == 'medium' %>">
+ <li id="image_dialog_size_<%= index %>" class="image_dialog_size<%= ' selected' if size.to_s == 'medium' %>">
<%= link_to size.to_s, "##{size}",
:'data-size' => pixels,
:title => "#{size} image (#{safe_pixels})",
@@ -42,6 +46,7 @@
</ul>
</div>
<% end %>
+
<%= render :partial => "/shared/admin/form_actions",
:locals => {
:f => nil,
View
38 vendor/refinerycms/images/app/views/admin/images/_form.html.erb
@@ -1,8 +1,4 @@
-<%= form_for [:admin, @image], :url => @url_override || @url,
- :html => {
- :multipart => true,
- :style => 'float: left; width: 70%'
- } do |f| %>
+<%= form_for [:admin, @image], :url => @url_override || @url, :html => {:multipart => true} do |f| %>
<%= render :partial => "/shared/admin/error_messages",
:locals => {
@@ -12,26 +8,28 @@
<div class='field'>
<% if action_name =~ /(edit)|(update)/ %>
- <%= t('.use_current_image') %>
- <em><%= t('.or') %></em><%= t('.replace_image') %>
+ <p>
+ <%= t('.use_current_image') %>
+ <em><%= t('.or') %></em><%= t('.replace_image') %>
+ </p>
<% end %>
- <%= f.file_field :image %>
+ <p>
+ <%= f.file_field :image %>
+ </p>
</div>
<div class='field'>
<label><%= t('.maximum_image_size', :megabytes => Image::MAX_SIZE_IN_MB) %></label>
</div>
- <div<%= (" style='margin-top: #{@image.thumbnail('225x255>').height - 63}px'" rescue nil) if action_name =~ /(edit)|(update)/ and !@app_dialog%>>
- <%= render :partial => "/shared/admin/form_actions",
- :locals => {
- :f => f,
- :continue_editing => false,
- :hide_cancel => (@app_dialog or action_name == "insert" or from_dialog?),
- :delete_title => t('admin.images.delete'),
- :delete_confirmation => t('shared.admin.delete.message', :title => @image.image_name)
- } %>
- </div>
+ <%= render :partial => "/shared/admin/form_actions",
+ :locals => {
+ :f => f,
+ :continue_editing => false,
+ :hide_cancel => (@app_dialog or action_name == "insert" or from_dialog?),
+ :delete_title => t('admin.images.delete'),
+ :delete_confirmation => t('shared.admin.delete.message', :title => @image.image_name)
+ } -%>
<% if @app_dialog %>
<input type='hidden' name='app_dialog' value='<%= @app_dialog %>' />
@@ -44,8 +42,8 @@
<% end %>
<% if action_name =~ /(edit)|(update)/ %>
- <div style='float: right; width: 25%;'>
+ <div id='existing_image'>
<label><%=t('.current_image') %></label>
- <%= image_fu @image, '225x255>', { :class => "brown_border" } %>
+ <%= image_fu @image, '225x255>', :class => "brown_border" %>
</div>
<% end %>
View
49 vendor/refinerycms/images/app/views/admin/images/index.html.erb
@@ -1,10 +1,27 @@
+<div id='records'>
+ <% if searching? %>
+ <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
+ <% end %>
+ <% if @images.any? %>
+ <%= will_paginate @images, :previous_label => '&laquo;', :next_label => '&raquo;' %>
+ <%= render :partial => "#{current_image_view}_view" %>
+ <%= will_paginate @images, :previous_label => '&laquo;', :next_label => '&raquo;' %>
+ <% else %>
+ <p>
+ <% unless searching? %>
+ <strong>
+ <%= t('.no_images_yet') %>
+ </strong>
+ <% else %>
+ <%= t('shared.admin.search.no_results') %>
+ <% end %>
+ </p>
+ <% end %>
+</div>
<div id='actions'>
<ul>
<li>
- <%= render :partial => "/shared/admin/search",
- :locals => {
- :url => admin_images_url
- } %>
+ <%= render :partial => "/shared/admin/search", :locals => {:url => admin_images_url} %>
</li>
<li>
<%= link_to t('.create_new_image'), new_admin_image_url(:dialog => true, :width => 600, :height => 300),
@@ -12,32 +29,10 @@
</li>
<% other_image_views.each do |image_view| %>
<li>
- <%= link_to t('.view.switch_to', :view_name => t('.view.' + image_view.to_s)),
+ <%= link_to t('.view.switch_to', :view_name => t(".view.#{image_view}")),
admin_images_url(:view => image_view, :page => params[:page]),
:class => "reorder_icon" %>
</li>
<% end %>
</ul>
</div>
-<div id='records'>
- <% if searching? %>
- <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
- <% if @images.any? %>
- <%= render :partial => "#{current_image_view}_view" %>
- <% else %>
- <p><%= t('shared.admin.search.no_results') %></p>
- <% end %>
- <% else %>
- <% if @images.any? %>
- <%= will_paginate @images, :previous_label => '&laquo;', :next_label => '&raquo;' %>
- <%= render :partial => "#{current_image_view}_view" %>
- <%= will_paginate @images, :previous_label => '&laquo;', :next_label => '&raquo;' %>
- <% else %>
- <p>
- <strong>
- <%= t('.no_images_yet') %>
- </strong>
- </p>
- <% end %>
- <% end %>
-</div>
View
2  vendor/refinerycms/images/features/manage_images.feature
@@ -1,4 +1,4 @@
-@images @images-manage
+@refinerycms @images @images-manage
Feature: Manage Images
In order to control the content on my website
As an administrator
View
13 vendor/refinerycms/images/lib/images.rb
@@ -45,20 +45,15 @@ def unlink
app_images.analyser.register(Dragonfly::Analysis::RMagickAnalyser)
app_images.analyser.register(Dragonfly::Analysis::FileCommandAnalyser)
- # This little eval makes it so that dragonfly urls work in traditional
+ # This eval makes it so that dragonfly urls work in traditional
# situations where the filename and extension are required, e.g. lightbox.
# What this does is takes the url that is about to be produced e.g.
# /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
# and adds the filename onto the end (say the image was 'refinery_is_awesome.jpg')
# /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.jpg
- app_images.instance_eval %{
- def url_for(job, *args)
- image_url = nil
- if (fetcher = job.steps.detect{|s| s.class.step_name == :fetch}).present?
- image_url = ['', fetcher.uid.to_s.split('/').last].join('/')
- end
- "\#{super}\#{image_url}"
- end
+ # from: http://markevans.github.com/dragonfly/file.URLs.html
+ app_images.url_suffix = proc{|job|
+ "/#{job.uid_basename}#{job.encoded_extname || job.uid_extname}"
}
### Extend active record ###
View
15 vendor/refinerycms/pages/app/controllers/pages_controller.rb
@@ -9,7 +9,7 @@ class PagesController < ApplicationController
}
def home
- error_404 unless (@page = Page.find_by_link_url("/", :include => [:parts, :slugs])).present?
+ error_404 unless (@page = Page.find_by_link_url("/")).present?
end
# This action can be accessed normally, or as nested pages.
@@ -23,18 +23,13 @@ def home
# GET /about/mission
#
def show
- @page = if params[:path]
- Page.find(params[:path].split('/').last, :include => [:parts, :slugs])
- else
- Page.find(params[:id], :include => [:parts, :slugs])
- end
+ # Find the page by the newer 'path' or fallback to the page's id if no path.
+ @page = Page.find(params[:path] ? params[:path].to_s.split('/').last : params[:id])
- if @page.try(:live?) or
- (refinery_user? and
- current_user.authorized_plugins.include?("refinery_pages"))
+ if @page.try(:live?) or (refinery_user? and current_user.authorized_plugins.include?("refinery_pages"))
# if the admin wants this to be a "placeholder" page which goes to its first child, go to that instead.
if @page.skip_to_first_child
- first_live_child = @page.children.find_by_draft(false, :order => "position ASC")
+ first_live_child = @page.children.order('lft ASC').where(:draft=>false).first
redirect_to first_live_child.url if first_live_child.present?
end
else
View
5 vendor/refinerycms/pages/app/models/page.rb
@@ -79,7 +79,7 @@ def destroy!
# It automatically prints out this page title and all of it's parent page titles joined by a PATH_SEPARATOR
def path(options = {})
# Handle deprecated boolean
- if %w(trueclass falseclass).include?(options.class.to_s.downcase)
+ if [true, false].include?(options)
warning = "Page::path does not want a boolean (you gave #{options.inspect}) anymore. "
warning << "Please change this to {:reversed => #{options.inspect}}. "
warn(warning << "\nCalled from #{caller.first.inspect}")
@@ -172,9 +172,8 @@ def live?
# Return true if this page can be shown in the navigation.
# If it's a draft or is set to not show in the menu it will return false.
- # If any of the page's ancestors aren't to be shown in the menu then this page is not either.
def in_menu?
- self.live? && self.show_in_menu? && self.ancestors.all? { |a| a.in_menu? }
+ self.live? && self.show_in_menu?
end
# Returns true if this page is the home page or links to it.
View
20 vendor/refinerycms/pages/app/views/admin/pages/_form_page_parts.html.erb
@@ -16,11 +16,16 @@
<% end %>
<div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
<ul id='page_parts'>
- <% @page.parts.each_with_index do |part, part_index| %>
- <li class='ui-state-default<%= ' ui-state-active' if part_index == 0 %>'>
- <%= link_to part.title, "##{@page.new_record? ? "page_part_new_#{part_index}" : part.to_param}" %>
- </li>
- <% end %>
+ <% @page.parts.each_with_index do |part, part_index| %>
+ <li class='ui-state-default<%= ' ui-state-active' if part_index == 0 %>'>
+ <%= link_to part.title, "##{@page.new_record? ? "page_part_new_#{part_index}" : part.to_param}" %>
+ </li>
+ <% end %>
+ <% Refinery::Pages.tabs.each_with_index do |tab, tab_index| %>
+ <li class='ui-state-default' id="custom_<%= tab.name %>_tab">
+ <%= link_to tab.name.titleize, "#custom_tab_#{tab_index}" %>
+ </li>
+ <% end %>
</ul>
<div id='page_part_editors'>
@@ -33,5 +38,10 @@
:new_part => @page.new_record?
} -%>
<% end %>
+ <% Refinery::Pages.tabs.each_with_index do |tab, tab_index| %>
+ <div class='page_part' id='<%= "custom_tab_#{tab_index}" %>'>
+ <%= render :partial => tab.partial, :locals => {:f => f} %>
+ </div>
+ <% end %>
</div>
</div>
View
3  vendor/refinerycms/pages/app/views/admin/pages/_sortable_list.html.erb
@@ -1,4 +1,5 @@
<ul id='sortable_list'>
<%= render :partial => "page", :collection => @pages %>
</ul>
-<%= render :partial => "/shared/admin/sortable_list", :locals => {:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)} %>
+<%= render :partial => "/shared/admin/sortable_list",
+ :locals => {:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)} %>
View
49 vendor/refinerycms/pages/app/views/admin/pages/index.html.erb
@@ -1,3 +1,19 @@
+<div id='records' class='tree'>
+ <% if searching? %>
+ <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
+ <% end %>
+ <% if @pages.any? %>
+ <%= render :partial => 'sortable_list' %>
+ <% else %>
+ <p>
+ <% unless searching? %>
+ <strong><%=t('.no_pages_yet')%></strong>
+ <% else %>
+ <%= t('shared.admin.search.no_results') %>
+ <% end %>
+ </p>
+ <% end %>
+</div>
<div id='actions'>
<ul>
<li>
@@ -6,30 +22,19 @@
<li>
<%= link_to t('.create_new_page'), new_admin_page_url, :class => "add_icon" %>
</li>
- <% if Page.count > 1 and not searching? %>
+ <% if @pages.many? and !searching? %>
<li>
- <%= link_to t('.reorder_pages'), admin_pages_url, :id => "reorder_action", :class => "reorder_icon" %>
- <%= link_to t('.reorder_pages_done'), admin_pages_url, :id => "reorder_action_done", :style => "display: none;", :class => "reorder_icon" %>
+ <%= link_to t('.reorder_pages'), admin_pages_url,
+ :id => "reorder_action",
+ :class => "reorder_icon" %>
+
+ <%= link_to t('.reorder_pages_done'), admin_pages_url,
+ :id => "reorder_action_done",
+ :style => "display: none;",
+ :class => "reorder_icon" %>
</li>
<% end %>
</ul>
</div>
-<div id='records' class='tree'>
- <% if searching? %>
- <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
- <% if @pages.any? %>
- <%= render :partial => "sortable_list" %>
- <% else %>
- <p><%= t('shared.admin.search.no_results') %></p>
- <% end %>
- <% else %>
- <% if @pages.any? %>
- <%= render :partial => "sortable_list" %>
- <% else %>
- <p>
- <strong><%=t('.no_pages_yet')%></strong>
- </p>
- <% end %>
- <% end %>
-</div>
-<%= render :partial => "/shared/admin/make_sortable", :locals => {:tree => true} if Page.count > 1 %>
+<%= render :partial => "/shared/admin/make_sortable",
+ :locals => {:tree => true} if @pages.many? -%>
View
2  vendor/refinerycms/pages/features/manage_pages.feature
@@ -1,4 +1,4 @@
-@pages @pages-manage
+@refinerycms @pages @pages-manage
Feature: Manage Pages
In order to control the content on my website
As an administrator
View
5 vendor/refinerycms/pages/lib/pages.rb
@@ -3,12 +3,17 @@
module Refinery
module Pages
+
class Engine < Rails::Engine
# Register cache sweeper, ensuring that we don't overwrite any other observers.
config.autoload_paths += %W(#{config.root}/app/sweepers)
(config.active_record.observers ||= []) << :page_sweeper
+ config.to_prepare do
+ require File.expand_path('../pages/tabs', __FILE__)
+ end
+
config.after_initialize do
Refinery::Plugin.register do |plugin|
plugin.name = "refinery_pages"
View
30 vendor/refinerycms/pages/lib/pages/tabs.rb
@@ -0,0 +1,30 @@
+module Refinery
+ module Pages
+
+ attr_accessor :tabs
+
+ def self.tabs
+ @tabs ||= []
+ end
+
+ class Tab
+ attr_accessor :name, :partial
+
+ def self.register(&block)
+ tab = self.new
+
+ yield tab
+
+ raise "A tab MUST have a name!: #{tab.inspect}" if tab.name.blank?
+ raise "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank?
+ end
+
+ protected
+
+ def initialize
+ ::Refinery::Pages.tabs << self # add me to the collection of registered page tabs
+ end
+ end
+
+ end
+end
View
9 vendor/refinerycms/pages/spec/models/page_spec.rb
@@ -31,6 +31,7 @@ def turn_off_marketable_urls
RefinerySetting.set(:use_marketable_urls, {:value => false, :scoping => 'pages'})
end
+
before(:each) do
reset_page
end
@@ -75,7 +76,13 @@ def turn_off_marketable_urls
it ".path() still responds to the deprecated boolean" do
create_child
- @child.path(false).should == 'The child page - RSpec is great for testing too'
+ capture_stdout { @child.path(false).should == 'The child page - RSpec is great for testing too' }
+ end
+
+ it "prints a logger warning when the deprecated boolean is used for path()" do
+ create_child
+ log_messages = capture_stdout { @child.path(false) }
+ log_messages.should_not be_empty
end
it "should return its url" do
View
65 vendor/refinerycms/resources/app/views/admin/resources/index.html.erb
@@ -1,45 +1,44 @@
-<div id='actions'>
- <ul>
- <li>
- <%= render :partial => "/shared/admin/search", :locals => {:url => admin_resources_url} %>
- </li>
- <li>
- <%= link_to t('.upload_new'), new_admin_resource_url(:dialog => true, :width => 600, :height => 300), :class => "add_icon" %>
- </li>
- </ul>
-</div>
<div id='records' class='files'>
<% if searching? %>
<h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
- <% if @resources.any? %>
- <ul>
- <%= render :partial => "resource", :collection => @resources %>
- </ul>
- <% else %>
- <p><%= t('shared.admin.search.no_results') %></p>
- <% end %>
- <% else %>
- <% if @resources.any? -%>
- <%= will_paginate @resources, :previous_label => '&laquo;', :next_label => '&raquo;' %>
- <% if RefinerySetting.find_or_set(:group_resources_by_date_uploaded, true) %>
- <% @grouped_resources.each do |container| %>
- <% date_time = (resource_group = container.last).first.created_at %>
- <% date = Date.parse(date_time.to_s) %>
+ <% end %>
+ <% if @resources.any? %>
+ <%= will_paginate @resources, :previous_label => '&laquo;', :next_label => '&raquo;' %>
+ <% unless searching? or !RefinerySetting.find_or_set(:group_resources_by_date_uploaded, true)
+ @grouped_resources.each do |container|
+ date = Date.parse((resource_group = container.last).first.created_at.to_s)
+ %>
<h3><%= l(date, :format => :long ) %></h3>
<ul>
<%= render :partial => "resource", :collection => resource_group %>
</ul>
<% end %>
+ <% else %>
+ <ul>
+ <%= render :partial => "resource", :collection => @resources %>
+ </ul>
+ <% end %>
+ <%= will_paginate @resources, :previous_label => '&laquo;', :next_label => '&raquo;' %>
+ <% else %>
+ <p>
+ <% unless searching? %>
+ <strong><%= t('.no_files_yet') %></strong>
<% else %>
- <ul>
- <%= render :partial => "resource", :collection => @resources %>
- </ul>
+ <%= t('shared.admin.search.no_results') %>
<% end %>
- <%= will_paginate @resources, :previous_label => '&laquo;', :next_label => '&raquo;' %>
- <% else -%>
- <p>
- <strong><%= t('.no_files_yet') %></strong>
- </p>
- <% end -%>
+ </p>
<% end %>
</div>
+<div id='actions'>
+ <ul>
+ <li>
+ <%= render :partial => "/shared/admin/search", :locals => {:url => admin_resources_url} %>
+ </li>
+ <li>
+ <%= link_to t('.upload_new'), new_admin_resource_url(:dialog => true,
+ :width => 600,
+ :height => 300),
+ :class => "add_icon" %>
+ </li>
+ </ul>
+</div>
View
2  vendor/refinerycms/resources/features/manage_files.feature
@@ -1,4 +1,4 @@
-@files @files-manage
+@refinerycms @files @files-manage
Feature: Manage Files
In order to control the content on my website
As an administrator
View
19 vendor/refinerycms/resources/lib/resources.rb
@@ -44,20 +44,15 @@ def unlink
app_resources.define_macro(ActiveRecord::Base, :resource_accessor)
app_resources.analyser.register(Dragonfly::Analysis::FileCommandAnalyser)
- # This little eval makes it so that dragonfly urls work in traditional
+ # This eval makes it so that dragonfly urls work in traditional
# situations where the filename and extension are required, e.g. lightbox.
# What this does is takes the url that is about to be produced e.g.
- # /system/resources/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
- # and adds the filename onto the end (say the file was 'refinery_is_awesome.jpg')
- # /system/resources/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.jpg
- app_resources.instance_eval %{
- def url_for(job, *args)
- resource_url = nil
- if (fetcher = job.steps.detect{|s| s.class.step_name == :fetch}).present?
- resource_url = ['', fetcher.uid.to_s.split('/').last].join('/')
- end
- "\#{super}\#{resource_url}"
- end
+ # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
+ # and adds the filename onto the end (say the image was 'refinery_is_awesome.pdf')
+ # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.pdf
+ # from: http://markevans.github.com/dragonfly/file.URLs.html
+ app_resources.url_suffix = proc{|job|
+ "/#{job.uid_basename}#{job.encoded_extname || job.uid_extname}"
}
### Extend active record ###
View
2  vendor/refinerycms/settings/app/models/refinery_setting.rb
@@ -155,7 +155,7 @@ def value
def value=(new_value)
# must convert to string if true or false supplied otherwise it becomes 0 or 1, unfortunately.
- if %w(trueclass falseclass).include?(new_value.class.to_s.downcase)
+ if [true, false].include?(new_value)
new_value = new_value.to_s
end
View
5 vendor/refinerycms/settings/app/views/admin/refinery_settings/index.html.erb
@@ -1,8 +1,7 @@
<div id='records'>
<% if searching? %>
<h2>
- <%= t('shared.admin.search.results_for',
- :query => params[:search]) %>
+ <%= t('shared.admin.search.results_for', :query => params[:search]) %>
</h2>
<% end %>
<% if @refinery_settings.any? %>
@@ -52,4 +51,4 @@
});
});
</script>
-<% end %>
+<% end -%>
View
2  vendor/refinerycms/settings/features/manage_refinery_settings.feature
@@ -1,4 +1,4 @@
-@settings @settings-manage @refinery-settings
+@refinerycms @settings @settings-manage @refinery-settings
Feature: Manage Refinery Settings
In order to control the configuration of my website
As an administrator
Please sign in to comment.
Something went wrong with that request. Please try again.