refinerycms 0.9.6.18 → 0.9.6.19
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/config/application.rb +2 -2
- data/config/environment.rb +1 -1
- data/config/preinitializer.rb +1 -1
- data/db/seeds.rb +1 -1
- data/lib/refinery/tasks/refinery.rb +1 -1
- data/lib/refinery_initializer.rb +1 -1
- data/public/javascripts/refinery/admin.js +2 -1
- data/readme.md +2 -2
- data/test/functional/dashboard_controller_test.rb +9 -9
- data/test/functional/images_controller_test.rb +18 -18
- data/vendor/plugins/dashboard/rails/init.rb +1 -1
- data/vendor/plugins/images/app/helpers/admin/images_helper.rb +2 -2
- data/vendor/plugins/images/app/views/admin/images/index.html.erb +1 -1
- data/vendor/plugins/inquiries/rails/init.rb +0 -3
- data/vendor/plugins/news/app/models/news_item.rb +5 -3
- data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/README +1 -0
- data/vendor/plugins/refinery/lib/generators/refinery/USAGE +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/refinery_generator.rb +1 -4
- data/vendor/plugins/refinery/lib/generators/refinery/templates/MIGRATE +4 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/model.rb +2 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_form.html.erb +1 -1
- data/vendor/plugins/refinery/lib/refinery.rb +1 -1
- data/vendor/plugins/refinery/lib/refinery/deprecations.rb +1 -1
- data/vendor/plugins/refinery/lib/refinery/initializer.rb +1 -1
- data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +1 -1
- data/vendor/plugins/refinery_dialogs/app/views/admin/dialogs/show.html.erb +1 -1
- data/vendor/plugins/themes/app/helpers/themes_helper.rb +9 -0
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.6.
|
1
|
+
0.9.6.19
|
data/config/application.rb
CHANGED
@@ -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.
|
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
|
data/config/environment.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# Load the rails application
|
2
|
-
require File.expand_path('../application', __FILE__)
|
2
|
+
require File.expand_path('../application', __FILE__)
|
data/config/preinitializer.rb
CHANGED
data/db/seeds.rb
CHANGED
@@ -101,7 +101,7 @@ Page.create(:title => "Privacy Policy",
|
|
101
101
|
:position => 6).parts.create(
|
102
102
|
{
|
103
103
|
:title => "Body",
|
104
|
-
:body => "<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",
|
data/lib/refinery_initializer.rb
CHANGED
@@ -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
|
-
|
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.
|
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.
|
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
|
@@ -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 =>
|
8
|
+
:index_file => %W(#{Rails.root} tmp index)
|
9
9
|
|
10
10
|
default_scope :order => "publish_date DESC"
|
11
|
-
|
12
|
-
|
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? %>
|
@@ -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
|
-
|
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
|
|
@@ -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
|
@@ -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.
|
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"
|
@@ -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
|
-
-
|
10
|
-
version: 0.9.6.
|
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-
|
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
|