refinerycms 0.9.6.5 → 0.9.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/VERSION +1 -1
  2. data/app/controllers/application.rb +1 -1
  3. data/app/controllers/application_controller.rb +1 -1
  4. data/config/environment.rb +2 -2
  5. data/config/environments/development.rb +1 -1
  6. data/config/environments/production.rb +1 -1
  7. data/config/preinitializer.rb +1 -1
  8. data/db/migrate/20100114092849_add_themes_table.rb +12 -12
  9. data/db/migrate/20100202034802_remove_custom_title_image_id_and_image_id_from_pages.rb +6 -6
  10. data/db/schema.rb +1 -1
  11. data/db/seeds.rb +2 -2
  12. data/lib/refinery_initializer.rb +1 -1
  13. data/public/javascripts/refinery/admin.js +61 -61
  14. data/readme.md +3 -3
  15. data/test/files/The world!.gif +0 -0
  16. data/test/files/car-wallpapers19.jpg +0 -0
  17. data/test/fixtures/images.yml +14 -0
  18. data/test/test_helper.rb +1 -1
  19. data/test/unit/image_test.rb +19 -8
  20. data/test/unit/page_part_test.rb +11 -11
  21. data/test/unit/page_test.rb +125 -125
  22. data/vendor/plugins/authentication/app/controllers/users_controller.rb +20 -20
  23. data/vendor/plugins/authentication/app/models/user.rb +5 -5
  24. data/vendor/plugins/authentication/app/views/user_mailer/reset_notification.html.erb +2 -2
  25. data/vendor/plugins/authentication/app/views/users/forgot.html.erb +1 -1
  26. data/vendor/plugins/authentication/app/views/users/reset.html.erb +2 -2
  27. data/vendor/plugins/authentication/config/routes.rb +4 -4
  28. data/vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb +1 -1
  29. data/vendor/plugins/dashboard/app/views/admin/dashboard/_recent_activity.html.erb +1 -1
  30. data/vendor/plugins/dashboard/rails/init.rb +1 -1
  31. data/vendor/plugins/images/app/models/image.rb +14 -14
  32. data/vendor/plugins/images/app/views/admin/images/_form.html.erb +1 -8
  33. data/vendor/plugins/images/app/views/admin/images/insert.html.erb +1 -1
  34. data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +3 -3
  35. data/vendor/plugins/inquiries/app/views/inquiries/new.html.erb +1 -1
  36. data/vendor/plugins/inquiries/app/views/inquiries/thank_you.html.erb +1 -1
  37. data/vendor/plugins/news/app/controllers/admin/news_items_controller.rb +1 -1
  38. data/vendor/plugins/news/app/controllers/news_items_controller.rb +1 -1
  39. data/vendor/plugins/news/app/views/news_items/index.html.erb +1 -1
  40. data/vendor/plugins/news/app/views/news_items/show.html.erb +1 -1
  41. data/vendor/plugins/pages/app/controllers/admin/pages_controller.rb +1 -1
  42. data/vendor/plugins/pages/app/models/page.rb +42 -42
  43. data/vendor/plugins/pages/app/models/page_part.rb +1 -1
  44. data/vendor/plugins/pages/app/presenters/page_presenter.rb +1 -1
  45. data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +1 -1
  46. data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +1 -1
  47. data/vendor/plugins/pages/app/views/admin/pages/_list.html.erb +1 -1
  48. data/vendor/plugins/pages/app/views/admin/pages/_page_part_field.html.erb +1 -1
  49. data/vendor/plugins/pages/app/views/pages/home.html.erb +1 -1
  50. data/vendor/plugins/pages/app/views/pages/show.html.erb +1 -1
  51. data/vendor/plugins/pages/rails/init.rb +5 -5
  52. data/vendor/plugins/rails_indexes/lib/indexer.rb +49 -47
  53. data/vendor/plugins/rails_indexes/tasks/indexer.rake +5 -3
  54. data/vendor/plugins/rails_indexes/test/fixtures/app/controllers/users_controller.rb +3 -3
  55. data/vendor/plugins/rails_indexes/test/fixtures/app/models/address.rb +2 -2
  56. data/vendor/plugins/rails_indexes/test/fixtures/app/models/company.rb +4 -4
  57. data/vendor/plugins/rails_indexes/test/fixtures/app/models/country.rb +1 -1
  58. data/vendor/plugins/rails_indexes/test/fixtures/app/models/freelancer.rb +1 -1
  59. data/vendor/plugins/rails_indexes/test/fixtures/app/models/gift.rb +4 -4
  60. data/vendor/plugins/rails_indexes/test/fixtures/app/models/god.rb +1 -1
  61. data/vendor/plugins/rails_indexes/test/fixtures/app/models/user.rb +7 -6
  62. data/vendor/plugins/rails_indexes/test/fixtures/app/sweepers/user_sweeper.rb +1 -1
  63. data/vendor/plugins/rails_indexes/test/fixtures/schema.rb +9 -9
  64. data/vendor/plugins/rails_indexes/test/rails_indexes_test.rb +18 -18
  65. data/vendor/plugins/refinery/app/views/admin/_head.html.erb +1 -1
  66. data/vendor/plugins/refinery/app/views/layouts/application.html.erb +1 -1
  67. data/vendor/plugins/refinery/app/views/shared/_content_page.html.erb +1 -1
  68. data/vendor/plugins/refinery/app/views/shared/_head.html.erb +1 -1
  69. data/vendor/plugins/refinery/app/views/shared/_header.html.erb +1 -1
  70. data/vendor/plugins/refinery/app/views/shared/_menu.html.erb +1 -1
  71. data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +5 -5
  72. data/vendor/plugins/refinery/app/views/shared/_submenu.html.erb +1 -1
  73. data/vendor/plugins/refinery/app/views/shared/admin/_continue_editing.html.erb +1 -1
  74. data/vendor/plugins/refinery/app/views/shared/admin/_error_messages_for.html.erb +1 -1
  75. data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +1 -1
  76. data/vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb +27 -13
  77. data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +1 -1
  78. data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +1 -1
  79. data/vendor/plugins/refinery/app/views/shared/admin/_sortable_list.html.erb +1 -1
  80. data/vendor/plugins/refinery/lib/generators/refinery/templates/model.rb +1 -1
  81. data/vendor/plugins/refinery/lib/generators/refinery/templates/public_controller.rb +1 -1
  82. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_sortable_list.html.erb +1 -1
  83. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/index.html.erb +2 -2
  84. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/index.html.erb +1 -1
  85. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/show.html.erb +1 -1
  86. data/vendor/plugins/refinery/lib/refinery/activity.rb +1 -1
  87. data/vendor/plugins/refinery/lib/refinery/application_controller.rb +4 -4
  88. data/vendor/plugins/refinery/lib/refinery/application_helper.rb +1 -1
  89. data/vendor/plugins/refinery/lib/refinery/base_presenter.rb +1 -1
  90. data/vendor/plugins/refinery/lib/refinery/initializer.rb +1 -1
  91. data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +1 -1
  92. data/vendor/plugins/resources/app/models/resource.rb +8 -8
  93. data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +1 -1
  94. data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +1 -1
  95. data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +1 -1
  96. data/vendor/plugins/resources/config/routes.rb +2 -2
  97. data/vendor/plugins/resources/rails/init.rb +1 -1
  98. data/vendor/plugins/themes/app/controllers/admin/themes_controller.rb +17 -17
  99. data/vendor/plugins/themes/app/models/theme.rb +40 -40
  100. data/vendor/plugins/themes/app/views/admin/themes/_form.html.erb +1 -1
  101. data/vendor/plugins/themes/config/routes.rb +2 -2
  102. data/vendor/plugins/themes/lib/theme_server.rb +26 -0
  103. data/vendor/plugins/themes/rails/init.rb +3 -1
  104. metadata +6 -3
  105. data/vendor/plugins/themes/app/controllers/themes_controller.rb +0 -45
@@ -1,130 +1,130 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class PageTest < ActiveSupport::TestCase
4
-
5
- fixtures :pages, :page_parts
6
-
7
- def setup
8
- @new_page = Page.new
9
- end
10
-
4
+
5
+ fixtures :pages, :page_parts
6
+
7
+ def setup
8
+ @new_page = Page.new
9
+ end
10
+
11
11
  def test_should_not_save_page_without_title
12
- assert !@new_page.save, "Saved the page without a title"
13
- end
14
-
15
- def test_should_stop_system_pages_from_being_deleted
16
- assert_equal false, pages(:home_page).deletable?
17
- assert_equal false, pages(:page_not_found).destroy
18
- end
19
-
20
- def test_should_allow_normal_pages_to_be_deleted
21
- assert_equal true, pages(:services).deletable?
22
- end
23
-
24
- def test_should_stop_custom_link_pages_from_being_deleted
25
- assert_equal false, pages(:contact_us).deletable?
26
- end
27
-
28
- def test_page_tree_structure
29
- assert_equal 1, pages(:draft_page_child).ancestors.size
30
- assert_equal pages(:draft_page), pages(:draft_page_child).ancestors.first
31
- assert_equal 0, pages(:home_page).ancestors.size
32
-
33
- assert_equal 3, pages(:products).children.size
34
- assert_equal pages(:products), pages(:blue_jelly).ancestors.first
35
- end
36
-
37
- def test_should_have_custom_seo_settings
38
- assert_equal "Services", pages(:services).path
39
- assert_equal "Secret Product - Secret information about secret product", pages(:draft_page_child).path
40
- assert_equal "Secret information about secret product - Secret Product", pages(:draft_page_child).path(reverse = false)
41
- end
42
-
43
- def test_should_force_a_non_deletable_page_to_be_deleted
44
- assert_equal Page, pages(:page_not_found).destroy!.class # not .destroy. Returns the page you just destroyed
45
- end
46
-
47
- def test_should_have_custom_url_override
48
- assert_equal "/inquiries/new", pages(:contact_us).url # the contact us page links to the inquiries plugin form
49
- assert_equal "/", pages(:home_page).url # the home page has a special "/" url
50
- end
51
-
52
- def test_should_have_regular_url
53
- assert pages(:services).url.include? "/pages/"
54
- # not sure how I get it to render the friendly_id url /pages/services
55
- # test seems to reduce the id instead e.g. /pages/234423
56
- end
57
-
58
- def test_drafts
59
- assert_equal false, pages(:draft_page).live? # the draft page is indeed a draft
60
- assert_equal true, pages(:home_page).live? # the home page is not a draft
61
- assert_equal true, pages(:draft_page_child).live? # child pages with draft parents should be drafts too
62
- end
63
-
64
- def test_home_page
65
- assert pages(:home_page).home?
66
- assert !pages(:services).home?
67
- end
68
-
69
- def test_in_menu_logic
70
- assert_equal true, pages(:home_page).in_menu? # home page should be in menu
71
- assert_equal false, pages(:draft_page_child).in_menu? # child pages with draft parents should be hidden
72
- assert_equal false, pages(:draft_page).in_menu? # draft pages should be hidden
73
-
74
- pages(:home_page).toggle!(:draft) # make the page a draft
75
- assert_equal false, pages(:home_page).live? # home page is no longer live
76
- assert_equal false, pages(:home_page).in_menu? # it should also not appear in the menu now
77
-
78
- pages(:home_page).toggle!(:draft) # make the page live again
79
- assert_equal true, pages(:home_page).in_menu? # home page should reappear in the menu
80
-
81
- pages(:home_page).toggle!(:show_in_menu) # now let's hide the home page from the menu
82
- assert_equal false, pages(:home_page).in_menu? # yep, it's hidden.
83
-
12
+ assert !@new_page.save, "Saved the page without a title"
13
+ end
14
+
15
+ def test_should_stop_system_pages_from_being_deleted
16
+ assert_equal false, pages(:home_page).deletable?
17
+ assert_equal false, pages(:page_not_found).destroy
18
+ end
19
+
20
+ def test_should_allow_normal_pages_to_be_deleted
21
+ assert_equal true, pages(:services).deletable?
22
+ end
23
+
24
+ def test_should_stop_custom_link_pages_from_being_deleted
25
+ assert_equal false, pages(:contact_us).deletable?
26
+ end
27
+
28
+ def test_page_tree_structure
29
+ assert_equal 1, pages(:draft_page_child).ancestors.size
30
+ assert_equal pages(:draft_page), pages(:draft_page_child).ancestors.first
31
+ assert_equal 0, pages(:home_page).ancestors.size
32
+
33
+ assert_equal 3, pages(:products).children.size
34
+ assert_equal pages(:products), pages(:blue_jelly).ancestors.first
35
+ end
36
+
37
+ def test_should_have_custom_seo_settings
38
+ assert_equal "Services", pages(:services).path
39
+ assert_equal "Secret Product - Secret information about secret product", pages(:draft_page_child).path
40
+ assert_equal "Secret information about secret product - Secret Product", pages(:draft_page_child).path(reverse = false)
41
+ end
42
+
43
+ def test_should_force_a_non_deletable_page_to_be_deleted
44
+ assert_equal Page, pages(:page_not_found).destroy!.class # not .destroy. Returns the page you just destroyed
45
+ end
46
+
47
+ def test_should_have_custom_url_override
48
+ assert_equal "/inquiries/new", pages(:contact_us).url # the contact us page links to the inquiries plugin form
49
+ assert_equal "/", pages(:home_page).url # the home page has a special "/" url
50
+ end
51
+
52
+ def test_should_have_regular_url
53
+ assert pages(:services).url.include? "/pages/"
54
+ # not sure how I get it to render the friendly_id url /pages/services
55
+ # test seems to reduce the id instead e.g. /pages/234423
56
+ end
57
+
58
+ def test_drafts
59
+ assert_equal false, pages(:draft_page).live? # the draft page is indeed a draft
60
+ assert_equal true, pages(:home_page).live? # the home page is not a draft
61
+ assert_equal true, pages(:draft_page_child).live? # child pages with draft parents should be drafts too
62
+ end
63
+
64
+ def test_home_page
65
+ assert pages(:home_page).home?
66
+ assert !pages(:services).home?
67
+ end
68
+
69
+ def test_in_menu_logic
70
+ assert_equal true, pages(:home_page).in_menu? # home page should be in menu
71
+ assert_equal false, pages(:draft_page_child).in_menu? # child pages with draft parents should be hidden
72
+ assert_equal false, pages(:draft_page).in_menu? # draft pages should be hidden
73
+
74
+ pages(:home_page).toggle!(:draft) # make the page a draft
75
+ assert_equal false, pages(:home_page).live? # home page is no longer live
76
+ assert_equal false, pages(:home_page).in_menu? # it should also not appear in the menu now
77
+
78
+ pages(:home_page).toggle!(:draft) # make the page live again
79
+ assert_equal true, pages(:home_page).in_menu? # home page should reappear in the menu
80
+
81
+ pages(:home_page).toggle!(:show_in_menu) # now let's hide the home page from the menu
82
+ assert_equal false, pages(:home_page).in_menu? # yep, it's hidden.
83
+
84
84
  assert_equal false, pages(:thank_you).in_menu? # a live page that's hidden should not show in menu
85
- end
86
-
87
- def test_shown_siblings
88
- assert_equal 3, pages(:products).children.size
89
- assert_equal 3, pages(:products).shown_siblings.size
90
- end
91
-
92
- def test_top_level_page_output
93
- assert_equal 4, Page.top_level.size
94
-
95
- # testing the order of pages.
96
- assert_equal pages(:home_page), Page.top_level.first
97
- assert_equal pages(:contact_us), Page.top_level.last
98
- assert_equal pages(:products), Page.top_level[1]
99
- assert_equal pages(:services), Page.top_level[2]
100
- end
101
-
102
- def test_order_of_children
103
- assert_equal pages(:blue_jelly), pages(:products).children.first
104
- assert_equal pages(:green_jelly), pages(:products).children[1]
105
- assert_equal pages(:rainbow_jelly), pages(:products).children.last
106
- end
107
-
108
- def test_title_with_meta
109
- assert_equal "Home Page", pages(:home_page).title_with_meta
110
- assert_equal "Secret Product <em>(draft)</em>", pages(:draft_page).title_with_meta
111
- end
112
-
113
- def test_per_page
114
- assert_equal 20, Page.per_page
115
- assert_equal 14, Page.per_page(dialog = true)
116
- end
117
-
118
- def test_all_page_part_content
119
- assert_equal "This is the body This is the side body", pages(:home_page).all_page_part_content
120
- end
121
-
122
- def test_page_parts
123
- assert_equal page_parts(:home_page_body).body, pages(:home_page)[:body]
124
- assert_equal page_parts(:home_page_side_body).body, pages(:home_page)[:side_body]
125
-
126
- # but make sure we can still access other fields through []
127
- assert_equal "Home Page", pages(:home_page)[:title]
128
- end
129
-
130
- end
85
+ end
86
+
87
+ def test_shown_siblings
88
+ assert_equal 3, pages(:products).children.size
89
+ assert_equal 3, pages(:products).shown_siblings.size
90
+ end
91
+
92
+ def test_top_level_page_output
93
+ assert_equal 4, Page.top_level.size
94
+
95
+ # testing the order of pages.
96
+ assert_equal pages(:home_page), Page.top_level.first
97
+ assert_equal pages(:contact_us), Page.top_level.last
98
+ assert_equal pages(:products), Page.top_level[1]
99
+ assert_equal pages(:services), Page.top_level[2]
100
+ end
101
+
102
+ def test_order_of_children
103
+ assert_equal pages(:blue_jelly), pages(:products).children.first
104
+ assert_equal pages(:green_jelly), pages(:products).children[1]
105
+ assert_equal pages(:rainbow_jelly), pages(:products).children.last
106
+ end
107
+
108
+ def test_title_with_meta
109
+ assert_equal "Home Page", pages(:home_page).title_with_meta
110
+ assert_equal "Secret Product <em>(draft)</em>", pages(:draft_page).title_with_meta
111
+ end
112
+
113
+ def test_per_page
114
+ assert_equal 20, Page.per_page
115
+ assert_equal 14, Page.per_page(dialog = true)
116
+ end
117
+
118
+ def test_all_page_part_content
119
+ assert_equal "This is the body This is the side body", pages(:home_page).all_page_part_content
120
+ end
121
+
122
+ def test_page_parts
123
+ assert_equal page_parts(:home_page_body).body, pages(:home_page)[:body]
124
+ assert_equal page_parts(:home_page_side_body).body, pages(:home_page)[:side_body]
125
+
126
+ # but make sure we can still access other fields through []
127
+ assert_equal "Home Page", pages(:home_page)[:title]
128
+ end
129
+
130
+ end
@@ -62,12 +62,12 @@ class UsersController < ApplicationController
62
62
  if user
63
63
  user.create_reset_code
64
64
 
65
- begin
66
- flash[:notice] = "An email has been sent to #{user.email} with a link to reset your password."
67
- UserMailer.deliver_reset_notification(user, request)
68
- rescue
69
- info.logger "error: email could not be sent for user password reset"
70
- end
65
+ begin
66
+ flash[:notice] = "An email has been sent to #{user.email} with a link to reset your password."
67
+ UserMailer.deliver_reset_notification(user, request)
68
+ rescue
69
+ info.logger "error: email could not be sent for user password reset"
70
+ end
71
71
  else
72
72
  flash[:notice] = "Sorry, #{params[:user][:email]} isn't associated with any acounts. Are you sure you typed the correct email address?"
73
73
  end
@@ -76,21 +76,21 @@ class UsersController < ApplicationController
76
76
  end
77
77
  end
78
78
 
79
- def reset
80
- @user = User.find_by_reset_code(params[:reset_code]) unless params[:reset_code].nil?
79
+ def reset
80
+ @user = User.find_by_reset_code(params[:reset_code]) unless params[:reset_code].nil?
81
81
 
82
- if request.post?
83
- if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
84
- self.current_user = @user
85
- @user.delete_reset_code
82
+ if request.post?
83
+ if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
84
+ self.current_user = @user
85
+ @user.delete_reset_code
86
86
 
87
- flash[:notice] = "Password reset successfully for #{@user.email}"
88
- redirect_back_or_default(admin_root_url)
89
- else
90
- render :action => :reset
91
- end
92
- end
93
- end
87
+ flash[:notice] = "Password reset successfully for #{@user.email}"
88
+ redirect_back_or_default(admin_root_url)
89
+ else
90
+ render :action => :reset
91
+ end
92
+ end
93
+ end
94
94
 
95
95
  protected
96
96
 
@@ -100,4 +100,4 @@ protected
100
100
  User.count == 0
101
101
  end
102
102
 
103
- end
103
+ end
@@ -1,6 +1,6 @@
1
1
  require 'digest/sha1'
2
2
  class User < ActiveRecord::Base
3
-
3
+
4
4
  # Hack: Allow "rake gems:install" to run when this class is missing its gem dependency.
5
5
  # For further clarification on why, refer to:
6
6
  # https://rails.lighthouseapp.com/projects/8994/tickets/780-rake-gems-install-doesn-t-work-if-plugins-are-missing-gem-dependencies
@@ -112,11 +112,11 @@ class User < ActiveRecord::Base
112
112
 
113
113
  def create_reset_code
114
114
  @reset = true
115
- code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )
115
+ code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )
116
116
  self.attributes = {:reset_code => code[0..6]}
117
117
  save(false)
118
- end
119
-
118
+ end
119
+
120
120
  def recently_reset?
121
121
  @reset
122
122
  end
@@ -150,4 +150,4 @@ protected
150
150
  self.deleted_at = self.activation_code = nil
151
151
  end
152
152
 
153
- end
153
+ end
@@ -2,5 +2,5 @@ Request to reset password received for <%= @user.login %>
2
2
 
3
3
  Visit this url to choose a new password:
4
4
  <%= @url %>
5
-
6
- (Your password will remain the same if no action is taken)
5
+
6
+ (Your password will remain the same if no action is taken)
@@ -10,4 +10,4 @@
10
10
  or
11
11
  <%= link_to "Cancel", login_url %>
12
12
  </div>
13
- <% end -%>
13
+ <% end -%>
@@ -9,10 +9,10 @@
9
9
  <%= f.label :password_confirmation %>
10
10
  <%= f.password_field :password_confirmation %>
11
11
  </div>
12
-
12
+
13
13
  <div class='form-actions'>
14
14
  <%= submit_tag 'Reset password' %>
15
15
  or
16
16
  <%= link_to "Cancel", login_url %>
17
17
  </div>
18
- <% end -%>
18
+ <% end -%>
@@ -1,5 +1,5 @@
1
1
  ActionController::Routing::Routes.draw do |map|
2
-
2
+
3
3
  map.resources :users
4
4
  map.resource :session
5
5
 
@@ -9,7 +9,7 @@ ActionController::Routing::Routes.draw do |map|
9
9
 
10
10
  map.login '/login', :controller => 'sessions', :action => 'new'
11
11
  map.logout '/logout', :controller => 'sessions', :action => 'destroy'
12
- map.forgot '/forgot', :controller => 'users', :action => 'forgot'
13
- map.reset 'reset/:reset_code', :controller => 'users', :action => 'reset'
12
+ map.forgot '/forgot', :controller => 'users', :action => 'forgot'
13
+ map.reset 'reset/:reset_code', :controller => 'users', :action => 'reset'
14
14
 
15
- end
15
+ end
@@ -16,4 +16,4 @@ module Admin::DashboardHelper
16
16
  end
17
17
  end
18
18
 
19
- end
19
+ end
@@ -11,4 +11,4 @@
11
11
  <p>
12
12
  Nothing has happened yet.
13
13
  </p>
14
- <% end %>
14
+ <% 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
@@ -1,6 +1,6 @@
1
1
  class Image < ActiveRecord::Base
2
2
 
3
- # Docs for attachment_fu http://github.com/technoweenie/attachment_fu
3
+ # Docs for attachment_fu http://github.com/technoweenie/attachment_fu
4
4
  has_attachment :content_type => :image,
5
5
  :storage => (USE_S3_BACKEND ? :s3 : :file_system),
6
6
  :path_prefix => (USE_S3_BACKEND ? nil : 'public/system/images'),
@@ -8,30 +8,30 @@ class Image < ActiveRecord::Base
8
8
  :thumbnails => ((((thumbnails = RefinerySetting.find_or_set(:image_thumbnails, {})).is_a?(Hash) ? thumbnails : (RefinerySetting[:image_thumbnails] = {}))) rescue {}),
9
9
  :max_size => 50.megabytes
10
10
 
11
- validates_as_attachment
11
+ validates_as_attachment
12
12
 
13
13
  # Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
14
14
  acts_as_indexed :fields => [:title],
15
- :index_file => [Rails.root.to_s, "tmp", "index"]
15
+ :index_file => [Rails.root.to_s, "tmp", "index"]
16
16
 
17
- named_scope :thumbnails, :conditions => "parent_id NOT NULL"
18
- named_scope :originals, :conditions => {:parent_id => nil}
17
+ named_scope :thumbnails, :conditions => "parent_id IS NOT NULL"
18
+ named_scope :originals, :conditions => {:parent_id => nil}
19
19
 
20
- # when a dialog pops up with images, how many images per page should there be
21
- PAGES_PER_DIALOG = 18
20
+ # when a dialog pops up with images, how many images per page should there be
21
+ PAGES_PER_DIALOG = 18
22
22
 
23
- # when listing images out in the admin area, how many images should show per page
24
- PAGES_PER_ADMIN_INDEX = 20
23
+ # when listing images out in the admin area, how many images should show per page
24
+ PAGES_PER_ADMIN_INDEX = 20
25
25
 
26
- # How many images per page should be displayed?
26
+ # How many images per page should be displayed?
27
27
  def self.per_page(dialog = false)
28
28
  dialog ? PAGES_PER_DIALOG : PAGES_PER_ADMIN_INDEX
29
29
  end
30
-
30
+
31
31
  # Returns a titleized version of the filename
32
- # my_file.jpg returns My File
32
+ # my_file.jpg returns My File
33
33
  def title
34
- self.filename.gsub(/\.\w+$/, '').titleize
34
+ CGI::unescape(self.filename).gsub(/\.\w+$/, '').titleize
35
35
  end
36
36
 
37
- end
37
+ end