refinerycms 0.9.6.18 → 0.9.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. data/VERSION +1 -1
  2. data/config/application.rb +2 -2
  3. data/config/environment.rb +1 -1
  4. data/config/preinitializer.rb +1 -1
  5. data/db/seeds.rb +1 -1
  6. data/lib/refinery/tasks/refinery.rb +1 -1
  7. data/lib/refinery_initializer.rb +1 -1
  8. data/public/javascripts/refinery/admin.js +2 -1
  9. data/readme.md +2 -2
  10. data/test/functional/dashboard_controller_test.rb +9 -9
  11. data/test/functional/images_controller_test.rb +18 -18
  12. data/vendor/plugins/dashboard/rails/init.rb +1 -1
  13. data/vendor/plugins/images/app/helpers/admin/images_helper.rb +2 -2
  14. data/vendor/plugins/images/app/views/admin/images/index.html.erb +1 -1
  15. data/vendor/plugins/inquiries/rails/init.rb +0 -3
  16. data/vendor/plugins/news/app/models/news_item.rb +5 -3
  17. data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +1 -1
  18. data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +1 -1
  19. data/vendor/plugins/refinery/lib/generators/refinery/README +1 -0
  20. data/vendor/plugins/refinery/lib/generators/refinery/USAGE +1 -1
  21. data/vendor/plugins/refinery/lib/generators/refinery/refinery_generator.rb +1 -4
  22. data/vendor/plugins/refinery/lib/generators/refinery/templates/MIGRATE +4 -0
  23. data/vendor/plugins/refinery/lib/generators/refinery/templates/model.rb +2 -2
  24. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_form.html.erb +1 -1
  25. data/vendor/plugins/refinery/lib/refinery.rb +1 -1
  26. data/vendor/plugins/refinery/lib/refinery/deprecations.rb +1 -1
  27. data/vendor/plugins/refinery/lib/refinery/initializer.rb +1 -1
  28. data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +1 -1
  29. data/vendor/plugins/refinery_dialogs/app/views/admin/dialogs/show.html.erb +1 -1
  30. data/vendor/plugins/themes/app/helpers/themes_helper.rb +9 -0
  31. metadata +4 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.6.18
1
+ 0.9.6.19
@@ -2,7 +2,7 @@
2
2
  RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
3
3
 
4
4
  # Specified gem version of Refinery to use when vendor/plugins/refinery/lib/refinery.rb is not present.
5
- REFINERY_GEM_VERSION = '0.9.6.18' unless defined? REFINERY_GEM_VERSION
5
+ REFINERY_GEM_VERSION = '0.9.6.19' unless defined? REFINERY_GEM_VERSION
6
6
 
7
7
  # Boot Rails
8
8
  require File.join(File.dirname(__FILE__), 'boot')
@@ -26,4 +26,4 @@ Refinery::Initializer.run do |config|
26
26
 
27
27
  # Specify your application's gem requirements here. See the example below:
28
28
  # config.gem "refinerycms-portfolio", :lib => "portfolio", :version => "~> 0.9.3.8"
29
- end
29
+ end
@@ -1,2 +1,2 @@
1
1
  # Load the rails application
2
- require File.expand_path('../application', __FILE__)
2
+ require File.expand_path('../application', __FILE__)
@@ -20,4 +20,4 @@ else
20
20
  end
21
21
 
22
22
  require 'refinery_initializer'
23
- end
23
+ end
@@ -101,7 +101,7 @@ Page.create(:title => "Privacy Policy",
101
101
  :position => 6).parts.create(
102
102
  {
103
103
  :title => "Body",
104
- :body => "<p><strong>We respect your privacy. We do not market, rent or sell our email list to any outside parties.</p><p>We need your e-mail address so that we can ensure that the people using our forms are bona fide. It also allows us to send you e-mail newsletters and other communications, if you opt-in. Your postal address is required in order to send you information and pricing, if you request it.</p><p>Please call us at 123 456 7890 if you have any questions or concerns.</p>"
104
+ :body => "<p>We respect your privacy. We do not market, rent or sell our email list to any outside parties.</p><p>We need your e-mail address so that we can ensure that the people using our forms are bona fide. It also allows us to send you e-mail newsletters and other communications, if you opt-in. Your postal address is required in order to send you information and pricing, if you request it.</p><p>Please call us at 123 456 7890 if you have any questions or concerns.</p>"
105
105
  }).page.parts.create(
106
106
  {
107
107
  :title => "Side Body",
@@ -13,4 +13,4 @@ end
13
13
  extra_rake_tasks << Dir[Rails.root.join("lib", "refinery", "tasks", "*.rake")]
14
14
 
15
15
  # Load in any extra tasks that we've found.
16
- extra_rake_tasks.flatten.compact.uniq.each {|rake| load rake }
16
+ extra_rake_tasks.flatten.compact.uniq.each {|rake| load rake }
@@ -20,4 +20,4 @@ $LOAD_PATH.uniq!
20
20
  require 'refinery/initializer'
21
21
 
22
22
  # Pull in attachment_fu patch for windows
23
- require 'refinery/attachment_fu_patch' if RUBY_PLATFORM =~ /mswin/
23
+ require 'refinery/attachment_fu_patch' if RUBY_PLATFORM =~ /mswin/
@@ -572,7 +572,8 @@ var list_reorder = {
572
572
 
573
573
  // parse any children branches too.
574
574
  $(li).find('> li[id], > ul li[id]').each(function(i, child) {
575
- branch += list_reorder.parse_branch(indexes + [i], child);
575
+ current_indexes = $.merge($.merge([], indexes), [i]);
576
+ branch += list_reorder.parse_branch(current_indexes, child);
576
577
  });
577
578
 
578
579
  return branch;
data/readme.md CHANGED
@@ -27,9 +27,9 @@ Unlike other content managers, Refinery is truly aimed at the end user making it
27
27
 
28
28
  ## Requirements
29
29
 
30
- Refinery runs using a number of gems which (as of Refinery version 0.9.6.18) are outlined below:
30
+ Refinery runs using a number of gems which (as of Refinery version 0.9.6.19) are outlined below:
31
31
 
32
- * [friendly_id ~> 2.3.2](http://rubygems.org/gems/friendly_id)
32
+ * [friendly_id ~> 2.2.2](http://rubygems.org/gems/friendly_id)
33
33
  * [will_paginate ~> 2.3.11](http://rubygems.org/gems/will_paginate)
34
34
  * [rails ~> 2.3.5](http://rubygems.org/gems/rails)
35
35
  * [aasm ~> 2.1.3](http://rubygems.org/gems/aasm)
@@ -4,25 +4,25 @@ require 'admin/dashboard_controller'
4
4
  class Admin::DashboardController; def rescue_action(e) raise e end; end
5
5
 
6
6
  class DashboardControllerTest < ActionController::TestCase
7
-
7
+
8
8
  fixtures :users, :pages
9
-
9
+
10
10
  def setup
11
11
  @controller = Admin::DashboardController.new
12
12
  @request = ActionController::TestRequest.new
13
13
  @response = ActionController::TestResponse.new
14
-
14
+
15
15
  login_as(:quentin)
16
16
  end
17
-
17
+
18
18
  def test_should_get_index
19
19
  get :index
20
20
  assert_response :success
21
-
21
+
22
22
  assert_not_nil assigns(:recent_activity)
23
23
 
24
24
  end
25
-
25
+
26
26
  def test_recent_activity_should_report_activity
27
27
  sleep 1
28
28
  pages(:home_page).update_attribute(:updated_at, Time.now)
@@ -32,13 +32,13 @@ class DashboardControllerTest < ActionController::TestCase
32
32
  # now the home page is updated is it at the top?
33
33
  assert_equal pages(:home_page).id, assigns(:recent_activity).first.id
34
34
  end
35
-
35
+
36
36
  def test_should_require_login_and_redirect
37
37
  logout
38
-
38
+
39
39
  get :index
40
40
  assert_response :redirect
41
41
  assert_nil assigns(:recent_activity)
42
42
  end
43
43
 
44
- end
44
+ end
@@ -4,14 +4,14 @@ require 'admin/images_controller'
4
4
  class Admin::ImagesController; def rescue_action(e) raise e end; end
5
5
 
6
6
  class ImagesControllerTest < ActionController::TestCase
7
-
7
+
8
8
  fixtures :users, :images
9
-
9
+
10
10
  def setup
11
11
  @controller = Admin::ImagesController.new
12
12
  @request = ActionController::TestRequest.new
13
13
  @response = ActionController::TestResponse.new
14
-
14
+
15
15
  login_as(:quentin)
16
16
  end
17
17
 
@@ -27,61 +27,61 @@ class ImagesControllerTest < ActionController::TestCase
27
27
  assert_not_nil assigns(:image)
28
28
  assert_not_nil assigns(:url_override)
29
29
  end
30
-
30
+
31
31
  def test_search
32
32
  get :index, :search => "Car"
33
-
33
+
34
34
  assert 1, assigns(:images).size
35
35
  assert images(:the_world), assigns(:images).first
36
36
  assert_not_nil assigns(:images)
37
37
  end
38
-
38
+
39
39
  def test_should_require_login_and_redirect
40
40
  logout
41
-
41
+
42
42
  get :index
43
43
  assert_response :redirect
44
44
  assert_nil assigns(:images)
45
45
  end
46
-
46
+
47
47
  def test_edit
48
48
  get :edit, :id => images(:the_world).id
49
-
49
+
50
50
  assert_response :success
51
-
51
+
52
52
  assert_not_nil assigns(:image)
53
53
  assert_equal images(:the_world), assigns(:image)
54
54
  end
55
-
55
+
56
56
  def test_insert
57
57
  get :insert
58
-
58
+
59
59
  assert_not_nil assigns(:image)
60
60
  assert_not_nil assigns(:url_override)
61
61
  end
62
-
62
+
63
63
  def test_update
64
64
  put :update, :id => images(:the_world).id, :image => {}
65
65
  assert_redirected_to admin_images_path
66
66
  end
67
-
67
+
68
68
  def test_create_with_errors
69
69
  post :create # didn't provide an image to upload
70
70
  assert_not_nil assigns(:image)
71
71
  assert_response :success
72
72
  end
73
-
73
+
74
74
  def test_successful_create
75
75
  # This needs to be sorted out yet. I'm not sure how to upload
76
76
  # a file through tests
77
-
77
+
78
78
  # assert_difference('Image.count', +1) do
79
79
  # post :create, :post => {} # didn't provide an image to upload
80
80
  # assert_not_nil assigns(:image)
81
81
  # assert_redirected_to admin_images_path
82
82
  # end
83
83
  end
84
-
84
+
85
85
  def test_destroy
86
86
  assert_difference('Image.count', -1) do
87
87
  delete :destroy, :id => images(:the_world).id
@@ -90,4 +90,4 @@ class ImagesControllerTest < ActionController::TestCase
90
90
  assert_redirected_to admin_images_path
91
91
  end
92
92
 
93
- end
93
+ end
@@ -3,4 +3,4 @@ Refinery::Plugin.register do |plugin|
3
3
  plugin.description = "Gives an overview of activity in Refinery"
4
4
  plugin.version = 1.0
5
5
  plugin.always_allow_access = true
6
- end
6
+ end
@@ -23,5 +23,5 @@ module Admin::ImagesHelper
23
23
  :next_label => 'Next &raquo;',
24
24
  :renderer => Refinery::LinkRenderer
25
25
  end
26
-
27
- end
26
+
27
+ end
@@ -39,4 +39,4 @@
39
39
  </p>
40
40
  <% end %>
41
41
  <% end %>
42
- </div>
42
+ </div>
@@ -8,6 +8,3 @@ Refinery::Plugin.register do |plugin|
8
8
  {:class => InquirySetting, :url_prefix => "edit", :title => 'name', :url_prefix => 'edit', :created_image => "user_comment.png", :updated_image => "user_edit.png"}
9
9
  ]
10
10
  end
11
-
12
- # Set the actionmailer root so that it'll work for delivering emails from this plugin.
13
- ActionMailer::Base.template_root = Refinery.root.join("vendor", "plugins", "inquiries", "app", "views").to_s
@@ -5,11 +5,13 @@ class NewsItem < ActiveRecord::Base
5
5
  has_friendly_id :title, :use_slug => true
6
6
 
7
7
  acts_as_indexed :fields => [:title, :body],
8
- :index_file => [Rails.root.to_s, "tmp", "index"]
8
+ :index_file => %W(#{Rails.root} tmp index)
9
9
 
10
10
  default_scope :order => "publish_date DESC"
11
- named_scope :latest, :conditions => ["publish_date < ?", Time.now], :limit => 10
12
- named_scope :published, :conditions => ["publish_date < ?", Time.now]
11
+ # If you're using a named scope that includes a changing variable you need to wrap it in a lambda
12
+ # This avoids the query being cached thus becoming unaffected by changes (i.e. Time.now is constant)
13
+ named_scope :latest, lambda { { :conditions => ["publish_date < ?", Time.now], :limit => 10 } }
14
+ named_scope :published, lambda { { :conditions => ["publish_date < ?", Time.now] } }
13
15
 
14
16
  def not_published? # has the published date not yet arrived?
15
17
  publish_date > Time.now
@@ -2,4 +2,4 @@
2
2
  <li class='clearfix<%= " child#{child}" if child %><%= " linked" if linked%>' id="<%= dom_id(page_link) -%>">
3
3
  <%= link_to page_link.title_with_meta, page_link.url, :title => 'Link to this Page', :rel => page_link.title, :class => 'page_link' %>
4
4
  </li>
5
- <%= render :partial => 'page_link', :collection => page_link.children, :locals => {:child => child ? (child+1) : 1} if page_link.children.any? %>
5
+ <%= render :partial => 'page_link', :collection => page_link.children, :locals => {:child => child ? (child+1) : 1} if page_link.children.any? %>
@@ -20,4 +20,4 @@
20
20
  </ul>
21
21
  <% end -%>
22
22
  </li>
23
- <% end -%>
23
+ <% end -%>
@@ -15,6 +15,7 @@ There must be at least one attribute.
15
15
  == Examples
16
16
  ./script/generate refinery team_member title:string description:text
17
17
  ./script/generate refinery team_member title:string
18
+ ./script/generate refinery team_member title:string description:text image:image
18
19
 
19
20
  Results in:
20
21
  create app/controllers/admin/team_members_controller.rb
@@ -1,2 +1,2 @@
1
1
  Usage:
2
- ./script/generate refinery team_member title:string description:text
2
+ ./script/generate refinery team_member title:string description:text image:image
@@ -55,10 +55,7 @@ class RefineryGenerator < Rails::Generator::NamedBase
55
55
  m.directory 'db/migrate/'
56
56
  m.migration_template 'migration.rb', 'db/migrate', :assigns => {:migration_name => "Create#{class_name.pluralize}"}, :migration_file_name => "create_#{singular_name.pluralize}"
57
57
 
58
- puts "IMPORTANT"
59
- puts "---------------------------------------"
60
- puts "Now run 'rake db:migrate' to add the table to the DB"
61
- puts "---------------------------------------"
58
+ m.readme "MIGRATE"
62
59
  end
63
60
  end
64
61
 
@@ -0,0 +1,4 @@
1
+ IMPORTANT
2
+ ---------------------------------------
3
+ Now run 'rake db:migrate' to add the table to the DB
4
+ ---------------------------------------
@@ -5,9 +5,9 @@ class <%= class_name %> < ActiveRecord::Base
5
5
 
6
6
  validates_presence_of :<%= attributes.first.name %>
7
7
  validates_uniqueness_of :<%= attributes.first.name %>
8
-
8
+
9
9
  <% attributes.collect{|a| a if a.type.to_s == 'image'}.compact.uniq.each do |a| -%>
10
10
  belongs_to :<%= a.name.gsub("_id", "") %><%= ", :class_name => 'Image'" unless a.name =~ /^image(_id)?$/ %>
11
11
  <% end -%>
12
12
 
13
- end
13
+ end
@@ -18,4 +18,4 @@
18
18
  </div>
19
19
  <% end %>
20
20
  <%%= render :partial => "/shared/admin/form_actions", :locals => {:f => f, :continue_editing => false} %>
21
- <%% end -%>
21
+ <%% end -%>
@@ -15,4 +15,4 @@ module Refinery
15
15
  end
16
16
  end
17
17
 
18
- end
18
+ end
@@ -43,4 +43,4 @@ REFINERY_ROOT = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do
43
43
  self.warned = true
44
44
  end
45
45
  end
46
- end).new
46
+ end).new
@@ -49,7 +49,7 @@ module Refinery
49
49
  configuration.plugin_loader = Refinery::PluginLoader unless configuration.plugin_loader != Rails::Plugin::Loader
50
50
  configuration.plugins = [ :friendly_id, :will_paginate, :aasm, :all ] if configuration.plugins.nil?
51
51
  configuration.gem "aasm", :version => "~> 2.1.3", :lib => "aasm"
52
- configuration.gem "friendly_id", :version => "~> 2.3.2", :lib => "friendly_id"
52
+ configuration.gem "friendly_id", :version => "~> 2.2.2", :lib => "friendly_id"
53
53
  configuration.gem "hpricot", :version => "~> 0.8.1", :lib => "hpricot"
54
54
  configuration.gem "slim_scrooge", :version => "~> 1.0.5", :lib => "slim_scrooge"
55
55
  configuration.gem "will_paginate", :version => "~> 2.3.11", :lib => "will_paginate"
@@ -24,4 +24,4 @@ class Admin::DialogsController < Admin::BaseController
24
24
  end
25
25
  end
26
26
 
27
- end
27
+ end
@@ -17,4 +17,4 @@
17
17
  or
18
18
  <a href='' class='wym_cancel close_dialog'><%= @cancel_button_text ||= 'Cancel' %></a>
19
19
  </div>
20
- </form>
20
+ </form>
@@ -22,4 +22,13 @@ module ThemesHelper
22
22
  tag.gsub!(/\/stylesheets\//, "/theme/stylesheets/") if theme
23
23
  tag.gsub(/theme=(.+?)\ /, '') # we need to remove any addition of theme='false' etc.
24
24
  end
25
+
26
+ def image_submit_tag(source, options = {})
27
+ theme = (options.delete(:theme) == true)
28
+
29
+ tag = super
30
+ # inject /theme/ into the image tag src if this is themed.
31
+ tag.gsub!(/src=[\"|\']/) { |m| "#{m}/theme/" }.gsub!("//", "/") if theme
32
+ tag.gsub(/theme=(.+?)\ /, '') # we need to remove any addition of theme='false' etc.
33
+ end
25
34
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 6
9
- - 18
10
- version: 0.9.6.18
9
+ - 19
10
+ version: 0.9.6.19
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-03-03 00:00:00 +13:00
20
+ date: 2010-03-04 00:00:00 +13:00
21
21
  default_executable:
22
22
  dependencies: []
23
23
 
@@ -507,6 +507,7 @@ files:
507
507
  - vendor/plugins/refinery/lib/generators/refinery/USAGE
508
508
  - vendor/plugins/refinery/lib/generators/refinery/install.rb
509
509
  - vendor/plugins/refinery/lib/generators/refinery/refinery_generator.rb
510
+ - vendor/plugins/refinery/lib/generators/refinery/templates/MIGRATE
510
511
  - vendor/plugins/refinery/lib/generators/refinery/templates/config/routes.rb
511
512
  - vendor/plugins/refinery/lib/generators/refinery/templates/controller.rb
512
513
  - vendor/plugins/refinery/lib/generators/refinery/templates/migration.rb