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,8 +1,8 @@
1
1
  class UsersController < ActionController::Base
2
-
3
-
2
+
3
+
4
4
  def index
5
5
  @freelancer = Freelancer.find_all_by_name(param[:name])
6
6
  @user = User.find(1)
7
7
  end
8
- end
8
+ end
@@ -1,5 +1,5 @@
1
1
  class Address < ActiveRecord::Base
2
-
2
+
3
3
  belongs_to :addressable, :polymorphic => true
4
4
  belongs_to :country
5
- end
5
+ end
@@ -2,10 +2,10 @@ class Company < ActiveRecord::Base
2
2
 
3
3
  belongs_to :owner, :foreign_key => 'owner_id', :class_name => 'User'
4
4
  belongs_to :country
5
-
5
+
6
6
  has_one :address, :as => :addressable
7
-
7
+
8
8
  has_many :users
9
-
9
+
10
10
  has_and_belongs_to_many :freelancers
11
- end
11
+ end
@@ -1,4 +1,4 @@
1
1
  class Country < ActiveRecord::Base
2
2
  has_many :addresses
3
3
  has_many :companies
4
- end
4
+ end
@@ -1,3 +1,3 @@
1
1
  class Freelancer < ActiveRecord::Base
2
2
  has_and_belongs_to_many :companies
3
- end
3
+ end
@@ -1,10 +1,10 @@
1
1
  class Gift < ActiveRecord::Base
2
-
2
+
3
3
  set_primary_key :custom_primary_key
4
4
  has_and_belongs_to_many :users, :join_table => "purchases", :association_foreign_key => 'buyer_id', :foreign_key => 'present_id'
5
-
5
+
6
6
  def search_all(name, price)
7
7
  Gift.find_all_by_name_and_price(name, price)
8
8
  end
9
-
10
- end
9
+
10
+ end
@@ -1,3 +1,3 @@
1
1
  class God < ActiveRecord::Base
2
2
  self.abstract_class = true
3
- end
3
+ end
@@ -1,16 +1,17 @@
1
1
  class User < ActiveRecord::Base
2
-
2
+
3
3
  has_one :company, :foreign_key => 'owner_id'
4
- has_one :address, :as => :addressable
4
+ has_one :address, :as => :addressable
5
5
 
6
6
  has_and_belongs_to_many :users, :join_table => "purchases", :association_foreign_key => 'present_id', :foreign_key => 'buyer_id'
7
-
8
-
7
+
8
+ validates_uniqueness_of :name
9
+
9
10
  def search_via_email(email = "user@domain.com")
10
11
  self.find_by_email(email)
11
12
  end
12
-
13
+
13
14
  def search_via_email_and_name(email, name)
14
15
  self.find_by_email_and_name(email, name)
15
16
  end
16
- end
17
+ end
@@ -6,4 +6,4 @@ class UserSweeper < ActionController::Caching::Sweeper
6
6
  def after_create(product)
7
7
  logger.info "Sweeped!"
8
8
  end
9
- end
9
+ end
@@ -3,44 +3,44 @@ ActiveRecord::Schema.define do
3
3
  t.column "name", :text
4
4
  t.column "email", :text
5
5
  end
6
-
6
+
7
7
  create_table "companies", :force => true do |t|
8
8
  t.column "name", :text
9
9
  t.column "owned_id", :integer
10
10
  t.column "country_id", :integer
11
11
  end
12
-
12
+
13
13
  add_index :companies, :country_id
14
-
14
+
15
15
  create_table "addresses", :force => true do |t|
16
16
  t.column "addressable_type", :string
17
17
  t.column "addressable_id", :integer
18
18
  t.column "address", :text
19
19
  t.column "country_id", :integer
20
20
  end
21
-
21
+
22
22
  create_table "freelancers", :force => true do |t|
23
23
  t.column "name", :string
24
24
  t.column "price_per_hour", :integer
25
25
  end
26
-
26
+
27
27
  create_table "companies_freelancers", :force => true do |t|
28
28
  t.column "freelancer_id", :integer
29
29
  t.column "company_id", :integer
30
30
  end
31
-
31
+
32
32
  create_table "gifts", :force => true do |t|
33
33
  t.column "custom_primary_key", :integer
34
34
  t.column "name", :string
35
35
  t.column "price", :integer
36
36
  end
37
-
37
+
38
38
  create_table "purchases", :force => true do |t|
39
39
  t.column "present_id", :integer
40
40
  t.column "buyer_id", :integer
41
41
  end
42
-
42
+
43
43
  create_table "countries", :force => true do |t|
44
44
  t.column "name", :string
45
45
  end
46
- end
46
+ end
@@ -1,51 +1,51 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class RailsIndexesTest < ActiveSupport::TestCase
4
-
4
+
5
5
  test "relationship indexes are found" do
6
6
  @relationship_indexes = Indexer.check_for_indexes
7
7
 
8
8
  assert @relationship_indexes.size > 0
9
-
9
+
10
10
  assert @relationship_indexes.has_key?("companies")
11
11
  assert @relationship_indexes.has_key?("companies_freelancers")
12
12
  assert @relationship_indexes.has_key?("addresses")
13
13
  assert @relationship_indexes.has_key?("purchases")
14
14
  end
15
-
15
+
16
16
  # should add 2 composite indexes or each pair
17
17
  test "has_and_belongs_to_many" do
18
18
  @relationship_indexes = Indexer.check_for_indexes(true)
19
-
19
+
20
20
  assert @relationship_indexes["companies_freelancers"].include?(["company_id", "freelancer_id"])
21
21
  assert @relationship_indexes["companies_freelancers"].include?(["freelancer_id", "company_id"])
22
22
  end
23
-
23
+
24
24
  test "has_and_belongs_to_many with custom columns" do
25
25
  @relationship_indexes = Indexer.check_for_indexes(true)
26
-
26
+
27
27
  assert @relationship_indexes["purchases"].include?(["present_id", "buyer_id"])
28
28
  assert @relationship_indexes["purchases"].include?(["buyer_id", "present_id"])
29
29
  end
30
-
30
+
31
31
  test "belongs_to" do
32
32
  @relationship_indexes = Indexer.check_for_indexes(true)
33
33
  assert @relationship_indexes["addresses"].include?("country_id")
34
34
  end
35
-
35
+
36
36
  test "belongs_to with a custom foreign key" do
37
37
  @relationship_indexes = Indexer.check_for_indexes(true)
38
38
  assert @relationship_indexes["companies"].include?("owner_id")
39
39
  end
40
-
40
+
41
41
  test "should not add an already existing index" do
42
42
  @relationship_indexes = Indexer.check_for_indexes(true)
43
43
  assert !(@relationship_indexes["companies"].include?("country_id"))
44
44
  end
45
-
45
+
46
46
  test "default find_by indexes for primary keys" do
47
47
  @find_by_indexes = Indexer.ar_find_indexes(false)
48
-
48
+
49
49
  # Default added the primary key for each table
50
50
  assert @find_by_indexes.has_key?("users")
51
51
  assert @find_by_indexes.has_key?("companies")
@@ -53,30 +53,30 @@ class RailsIndexesTest < ActiveSupport::TestCase
53
53
  assert @find_by_indexes.has_key?("freelancers")
54
54
  assert @find_by_indexes.has_key?("countries")
55
55
  end
56
-
56
+
57
57
  test "default find_by indexes for custom primary keys" do
58
58
  @find_by_indexes = Indexer.ar_find_indexes(false)
59
59
 
60
60
  assert @find_by_indexes["gifts"].include?("custom_primary_key")
61
61
  end
62
-
62
+
63
63
  test "find_by indexes for self.find_by_email_and_name" do
64
64
  @find_by_indexes = Indexer.ar_find_indexes(false)
65
-
65
+
66
66
  assert @find_by_indexes["users"].include?(["name", "email"])
67
67
  assert @find_by_indexes["users"].include?(["email", "name"])
68
68
  end
69
-
69
+
70
70
  test "find_by indexes for Gift.find_all_by_name_and_price" do
71
71
  @find_by_indexes = Indexer.ar_find_indexes(false)
72
-
72
+
73
73
  assert @find_by_indexes["gifts"].include?(["name", "price"])
74
74
  assert @find_by_indexes["gifts"].include?(["price", "name"])
75
75
  end
76
-
76
+
77
77
  test "find_by indexes from UsersController" do
78
78
  @find_by_indexes = Indexer.ar_find_indexes(false)
79
-
79
+
80
80
  assert @find_by_indexes["freelancers"].include?("name")
81
81
 
82
82
  end
@@ -15,4 +15,4 @@
15
15
  <%= javascript_include_tag 'admin', 'thickbox', 'wymeditor/jquery.refinery.wymeditor.js', 'refinery/boot_wym', 'refinery/admin', :cache => (use_caching ? "cache/admin" : false) %>
16
16
  <%= javascript_include_tag "http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js" if RefinerySetting.find_or_set(:show_firebug_lite, false) -%>
17
17
  <%= yield :head %>
18
- </head>
18
+ </head>
@@ -17,4 +17,4 @@
17
17
  </div>
18
18
  </div>
19
19
  </body>
20
- </html>
20
+ </html>
@@ -29,4 +29,4 @@
29
29
  <div class='page_not_live'>
30
30
  This page is NOT live for public viewing.
31
31
  </div>
32
- <% end -%>
32
+ <% end -%>
@@ -12,4 +12,4 @@
12
12
  <%= "<meta name=\"keywords\" content=\"#{@meta.meta_keywords}\" />" if @meta.meta_keywords.present? %>
13
13
  <%= "<meta name=\"description\" content=\"#{@meta.meta_description}\" />" if @meta.meta_description.present? -%>
14
14
  <%= yield :head %>
15
- </head>
15
+ </head>
@@ -1,4 +1,4 @@
1
1
  <div id='header_content'>
2
2
  <h1><%= link_to RefinerySetting[:site_name], root_url %></h1>
3
3
  <%= render :partial => "/shared/menu" %>
4
- </div>
4
+ </div>
@@ -4,4 +4,4 @@
4
4
  :hide_children => RefinerySetting.find_or_set(:menu_hide_children, false)
5
5
  } -%>
6
6
  </ul>
7
- <% end %>
7
+ <% end %>
@@ -8,10 +8,10 @@
8
8
  <% if menu_branch.in_menu? %>
9
9
  <li<%= " class='#{css.join(' ')}'" if css.present? -%><%= " id='#{domid}'" if domid.present? -%>>
10
10
  <%= link_to menu_branch.title, menu_branch.url %>
11
- <%
12
- unless hide_children or
13
- menu_branch.parent_id.present? or
14
- (children = menu_branch.children.collect{|c| c if c.in_menu? }.compact).empty?
11
+ <%
12
+ unless hide_children or
13
+ menu_branch.parent_id.present? or
14
+ (children = menu_branch.children.collect{|c| c if c.in_menu? }.compact).empty?
15
15
  -%>
16
16
  <ul class='clearfix'>
17
17
  <%= render :partial => "/shared/menu_branch",
@@ -20,4 +20,4 @@
20
20
  </ul>
21
21
  <% end -%>
22
22
  </li>
23
- <% end -%>
23
+ <% end -%>
@@ -2,4 +2,4 @@
2
2
  <ul id='submenu'>
3
3
  <%= render :partial => "/shared/submenu_branch", :collection => children %>
4
4
  </ul>
5
- <% end -%>
5
+ <% end -%>
@@ -1,4 +1,4 @@
1
1
  <% unless f.object.new_record? -%>
2
2
  <%= hidden_field_tag :continue_editing, false %>
3
3
  <%= f.submit 'Save &amp; Continue Editing', :id => "submit_continue_button", :class => "wymupdate" %>
4
- <% end -%>
4
+ <% end -%>
@@ -1,2 +1,2 @@
1
1
  <%= error_messages_for symbol %>
2
- <input type='hidden' id='fieldsWithErrors' value='<%= object.errors.collect { |attrib, msg| "#{object.class.name.underscore}_#{attrib}"}.join(",") %>' />
2
+ <input type='hidden' id='fieldsWithErrors' value='<%= object.errors.collect { |attrib, msg| "#{object.class.name.underscore}_#{attrib}"}.join(",") %>' />
@@ -10,4 +10,4 @@
10
10
  :title => (title ||= "Cancelling will lose all changes you've made to this #{f.object.class.name.underscore.gsub("_", " ")}"),
11
11
  :id => "#{cancel_button_id ||= "cancel_button"}", :class => "close_dialog" %>
12
12
  <% end -%>
13
- </div>
13
+ </div>
@@ -2,33 +2,47 @@
2
2
  description ||= "image"
3
3
  thumbnail ||= "medium"
4
4
  toggle_image_display ||= false
5
+ randomiser = rand(Time.now.yesterday.to_i * Time.now.to_i)
5
6
  -%>
6
- <%= link_to "Show", "", :id => "current_image_toggler" if toggle_image_display -%>
7
- <%= f.hidden_field field, :id => 'custom_title_field' -%>
7
+ <%= link_to "Show", "", :id => "current_image_toggler_#{randomiser}" if toggle_image_display -%>
8
+ <%= f.hidden_field field, :id => "current_image_id_#{randomiser}" -%>
8
9
 
9
- <div id='current_image_container'<%= " style='display: none'" if toggle_image_display %> style="margin-top: 10px;">
10
- <a id='current_image_link' href="<%= insert_admin_images_url %>?thickbox=true&amp;modal=true&amp;titlebar=true&amp;field=custom_title_field&amp;thumbnail=&amp;KeepThis=true&amp;TB_iframe=true&amp;width=958&amp;height=510" style='border: 0px' title='Change <%= description.titleize %>' name='Change <%= description.titleize %>' class='thickbox'>
10
+ <div id='current_image_container_<%= randomiser %>'<%= " style='display: none'" if toggle_image_display %> style="margin-top: 10px;">
11
+ <a id='current_image_link_<%= randomiser %>' href="<%= insert_admin_images_url %>?thickbox=true&amp;modal=true&amp;titlebar=true&amp;callback=image_picker_<%= randomiser %>_changed&amp;KeepThis=true&amp;TB_iframe=true&amp;width=958&amp;height=510" style='border: 0px' title='Change <%= description.titleize %>' name='Change <%= description.titleize %>' class='thickbox'>
11
12
  <% unless image.nil? -%>
12
13
  <%= image_fu image, nil, {:class => "brown_border", :id => "current_picked_image"} %>
13
14
  <% else -%>
14
- <img id="current_picked_image" class="" src="" alt="" style='display: none' />
15
+ <img id="current_picked_image_<%= randomiser %>" class="" src="" alt="" style='display: none' />
15
16
  <% end -%>
16
- <p id='no_picked_image_selected' <%= "style='display: none;'" unless image.nil? %>>
17
+ <p id='no_picked_image_selected_<%= randomiser %>' <%= "style='display: none;'" if image.present? %>>
17
18
  There is currently no <%= description %> selected, please click here to add one.
18
19
  </p>
19
20
  </a>
20
21
  <br/>
21
- <%= link_to "Remove current #{description}", "#", :id => "remove_picked_image", :style => "#{"display:none;" if image.nil?}" %>
22
+ <%= link_to "Remove current #{description}", "#", :id => "remove_picked_image_#{randomiser}", :style => "#{"display:none;" if image.nil?}" %>
22
23
  </div>
23
24
 
24
25
  <% content_for :head do -%>
25
26
  <script type='text/javascript'>
26
- $(document).ready(function(){
27
- image_picker.init({
28
- thumbnail: '<%= thumbnail %>'
29
- , toggle_image_display: <%= toggle_image_display.to_s %>
30
- , description: '<%= description %>'
31
- });
27
+ // We're so un-object-oriented here. We need to rewrite the jQuery admin.js file to use OO.
28
+ var image_picker_<%= randomiser %>_options = {
29
+ thumbnail: '<%= thumbnail %>'
30
+ , toggle_image_display: <%= toggle_image_display.to_s %>
31
+ , description: '<%= description %>'
32
+ , field: '#current_image_id_<%= randomiser %>'
33
+ , image_display: '#current_picked_image_<%= randomiser %>'
34
+ , no_image_message: '#no_picked_image_selected_<%= randomiser %>'
35
+ , remove_image_button: '#remove_picked_image_<%= randomiser %>'
36
+ , image_container: '#current_image_container_<%= randomiser %>'
37
+ };
38
+
39
+ $(document).ready(function(e) {
40
+ image_picker.init(image_picker_<%= randomiser %>_options);
32
41
  });
42
+
43
+ image_picker_<%= randomiser %>_changed = function(args) {
44
+ image_picker.init(image_picker_<%= randomiser %>_options);
45
+ image_picker.changed(args);
46
+ }
33
47
  </script>
34
48
  <% end %>
@@ -54,4 +54,4 @@
54
54
  });
55
55
  });
56
56
  </script>
57
- <% end %>
57
+ <% end %>
@@ -2,4 +2,4 @@
2
2
  Search
3
3
  <input id="search" name="search" size="35" type="search" value="<%= params[:search] %>" />
4
4
  <%= submit_tag 'Go', :name => "" %>
5
- </form>
5
+ </form>
@@ -6,4 +6,4 @@
6
6
  init_tooltips();
7
7
  });
8
8
  </script>
9
- <% end %>
9
+ <% end %>
@@ -6,4 +6,4 @@ class <%= class_name %> < ActiveRecord::Base
6
6
  validates_presence_of :<%= attributes.first.name %>
7
7
  validates_uniqueness_of :<%= attributes.first.name %>
8
8
 
9
- end
9
+ end
@@ -27,4 +27,4 @@ protected
27
27
  @page = Page.find_by_link_url("/<%= plural_name %>")
28
28
  end
29
29
 
30
- end
30
+ end
@@ -1,2 +1,2 @@
1
1
  <%%= render :partial => '<%= singular_name %>', :collection => @<%= plural_name %> %>
2
- <%%= render :partial => "/shared/admin/sortable_list", :locals => {:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)} %>
2
+ <%%= render :partial => "/shared/admin/sortable_list", :locals => {:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)} %>