refinerycms-page-images 1.0.4 → 2.0.0

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 (48) hide show
  1. data/.gitignore +2 -0
  2. data/.travis.yml +16 -0
  3. data/Gemfile +70 -0
  4. data/Rakefile +19 -0
  5. data/{public/javascripts/page-image-picker.js → app/assets/javascripts/refinery/page-image-picker.js.erb} +21 -28
  6. data/app/assets/stylesheets/refinery/page-image-picker.css.scss +57 -0
  7. data/app/models/refinery/image_page.rb +13 -0
  8. data/app/views/refinery/admin/pages/tabs/_images.html.erb +12 -0
  9. data/app/views/{admin → refinery/admin}/pages/tabs/_images_bar.html.erb +2 -2
  10. data/app/views/{admin → refinery/admin}/pages/tabs/_images_field.html.erb +7 -6
  11. data/config/locales/bg.yml +16 -0
  12. data/config/locales/cs.yml +16 -0
  13. data/config/locales/de.yml +10 -0
  14. data/config/locales/en.yml +15 -9
  15. data/config/locales/fr.yml +16 -0
  16. data/config/locales/nl.yml +11 -10
  17. data/config/locales/pt-BR.yml +16 -0
  18. data/config/locales/ru.yml +11 -0
  19. data/config/locales/sk.yml +16 -0
  20. data/db/migrate/20101014230041_create_page_images.rb +5 -11
  21. data/db/migrate/20101014230042_add_caption_to_image_pages.rb +2 -6
  22. data/db/migrate/20110511215016_translate_page_image_captions.rb +22 -0
  23. data/db/migrate/20110527052435_change_page_to_polymorphic.rb +5 -0
  24. data/lib/generators/refinery/page_images_generator.rb +15 -0
  25. data/lib/generators/refinery/templates/config/initializers/refinery/page_images.rb.erb +3 -0
  26. data/lib/refinery/page_images/configuration.rb +9 -0
  27. data/lib/refinery/page_images/engine.rb +46 -0
  28. data/lib/refinery/page_images/extension.rb +66 -0
  29. data/lib/refinery/page_images.rb +22 -0
  30. data/lib/refinerycms-page-images.rb +1 -54
  31. data/readme.md +29 -35
  32. data/refinerycms-page-images.gemspec +17 -0
  33. data/spec/factories/page-images.rb +9 -0
  34. data/spec/models/refinery/blog_spec.rb +15 -0
  35. data/spec/models/refinery/page_spec.rb +69 -0
  36. data/spec/requests/attach_page_images_spec.rb +29 -0
  37. data/spec/spec_helper.rb +56 -0
  38. data/spec/support/database_cleaner.rb +17 -0
  39. data/spec/support/devise.rb +8 -0
  40. data/spec/support/refinery.rb +6 -0
  41. data/tasks/rspec.rake +4 -0
  42. metadata +84 -21
  43. data/app/models/image_page.rb +0 -10
  44. data/app/views/admin/pages/tabs/_images.html.erb +0 -12
  45. data/features/attach_page_images.feature +0 -17
  46. data/lib/gemspec.rb +0 -29
  47. data/lib/generators/refinerycms_page_images_generator.rb +0 -6
  48. data/public/stylesheets/page-image-picker.css +0 -62
@@ -0,0 +1,66 @@
1
+ module Refinery
2
+ module PageImages
3
+ module Extension
4
+ def has_many_page_images
5
+ has_many :image_pages, :as => :page, :order => 'position ASC'
6
+ has_many :images, :through => :image_pages, :order => 'position ASC'
7
+ # accepts_nested_attributes_for MUST come before def images_attributes=
8
+ # this is because images_attributes= overrides accepts_nested_attributes_for.
9
+
10
+ accepts_nested_attributes_for :images, :allow_destroy => false
11
+
12
+ # need to do it this way because of the way accepts_nested_attributes_for
13
+ # deletes an already defined images_attributes
14
+ module_eval do
15
+ def images_attributes=(data)
16
+ ids_to_keep = data.map{|i, d| d['image_page_id']}.compact
17
+
18
+ image_pages_to_delete = if ids_to_keep.empty?
19
+ self.image_pages
20
+ else
21
+ self.image_pages.where(
22
+ Refinery::ImagePage.arel_table[:id].not_in(ids_to_keep)
23
+ )
24
+ end
25
+
26
+ image_pages_to_delete.destroy_all
27
+
28
+ data.each do |i, image_data|
29
+ image_page_id, image_id, caption =
30
+ image_data.values_at('image_page_id', 'id', 'caption')
31
+
32
+ next if image_id.blank?
33
+
34
+ image_page = if image_page_id.present?
35
+ self.image_pages.find(image_page_id)
36
+ else
37
+ self.image_pages.build(:image_id => image_id)
38
+ end
39
+
40
+ image_page.position = i
41
+ image_page.caption = caption if Refinery::PageImages.captions
42
+ image_page.save
43
+ end
44
+ end
45
+ end
46
+
47
+ include Refinery::PageImages::Extension::InstanceMethods
48
+
49
+ attr_accessible :images_attributes
50
+ end
51
+
52
+ module InstanceMethods
53
+
54
+ def caption_for_image_index(index)
55
+ self.image_pages[index].try(:caption).presence || ""
56
+ end
57
+
58
+ def image_page_id_for_image_index(index)
59
+ self.image_pages[index].try(:id)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+ ActiveRecord::Base.send(:extend, Refinery::PageImages::Extension)
@@ -0,0 +1,22 @@
1
+ require 'refinerycms-core'
2
+
3
+ module Refinery
4
+ autoload :PageImagesGenerator, 'generators/refinery/page_images_generator'
5
+
6
+ module PageImages
7
+
8
+ class << self
9
+ def root
10
+ @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
11
+ end
12
+
13
+ def factory_paths
14
+ @factory_paths ||= [ root.join('spec', 'factories').to_s ]
15
+ end
16
+ end
17
+
18
+ require 'refinery/page_images/configuration'
19
+ require 'refinery/page_images/engine'
20
+ require 'refinery/page_images/extension'
21
+ end
22
+ end
@@ -1,54 +1 @@
1
- require 'refinery'
2
-
3
- module Refinery
4
- module PageImages
5
- class Engine < Rails::Engine
6
- initializer "static assets" do |app|
7
- app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
8
- end
9
-
10
- config.to_prepare do
11
- Page.module_eval do
12
- has_many :image_pages
13
- has_many :images, :through => :image_pages, :order => 'position ASC'
14
- # accepts_nested_attributes_for MUST come before def images_attributes=
15
- # this is because images_attributes= overrides accepts_nested_attributes_for.
16
- accepts_nested_attributes_for :images, :allow_destroy => false
17
-
18
- attr_accessible :images_attributes
19
-
20
- def images_attributes=(data)
21
- ImagePage.delete_all(:page_id => self.id)
22
-
23
- (0..(data.length-1)).each do |i|
24
- unless (image_data = data[i.to_s]).nil? or image_data['id'].blank?
25
- image_page = self.image_pages.new(:image_id => image_data['id'].to_i, :position => i)
26
- # Add caption if supported
27
- if RefinerySetting.find_or_set(:page_images_captions, false)
28
- image_page.caption = image_data['caption']
29
- end
30
- self.image_pages << image_page
31
- end
32
- end
33
- end
34
-
35
- def caption_for_image_index(index)
36
- self.image_pages[index].try(:caption).presence || ""
37
- end
38
- end
39
- end
40
-
41
- config.after_initialize do
42
- ::Refinery::Pages::Tab.register do |tab|
43
- tab.name = "images"
44
- tab.partial = "/admin/pages/tabs/images"
45
- end
46
- ::Refinery::Plugin.register do |plugin|
47
- plugin.name = "page_images"
48
- plugin.hide_from_menu = true
49
- end
50
- end
51
- end
52
- end
53
- end
54
-
1
+ require 'refinery/page_images'
data/readme.md CHANGED
@@ -6,7 +6,7 @@ Page Images allows you to relate one or more images to any page in Refinery whic
6
6
 
7
7
  ## Requirements
8
8
 
9
- * refinerycms >= 0.9.9
9
+ * refinerycms >= 2.0.0
10
10
 
11
11
  ## Features
12
12
 
@@ -18,51 +18,45 @@ Page Images allows you to relate one or more images to any page in Refinery whic
18
18
 
19
19
  Add this line to your applications `Gemfile`
20
20
 
21
- gem 'refinerycms-page-images', '~> 1.0'
21
+ ```ruby
22
+ gem 'refinerycms-page-images', '~> 2.0.0'
23
+ ```
22
24
 
23
25
  Next run
24
26
 
25
- bundle install
26
- rails g refinerycms_page_images
27
- rake db:migrate
27
+ ```bash
28
+ bundle install
29
+ rails generate refinery:page_images
30
+ rake db:migrate
31
+ ```
28
32
 
29
33
  Now when you start up your Refinery application, edit a page and there should be a new "Images" tab.
30
34
 
31
- If you get an error like
32
-
33
- uninitialized constant Refinery::Pages::Tab
34
-
35
- It means your Refinery version isn't new enough. To fix that you need to update the Refinery CMS `Gemfile` line to this
36
-
37
- gem 'refinerycms', '~> 0.9.9'
38
-
39
- Then run:
40
-
41
- bundle install
42
- rake refinery:update
43
-
44
- And then try again. Note that doing this will likely mean that you need to fix your application
45
- for any changes that have happened since the version of Refinery CMS that you were using.
46
-
47
35
  ## Enable Captions
48
36
 
49
- Change the setting "Page Images Captions" to "true" to enable captions.
37
+ You can enable captions using an initializer containing the following configuration:
50
38
 
51
- ## Usage
39
+ ```ruby
40
+ Refinery::PageImages.captions = true
41
+ ```
52
42
 
53
- `app/views/pages/show.html.erb`
43
+ ## Usage
54
44
 
55
- <% content_for :body_content_right do %>
56
- <ul id='gallery'>
57
- <% @page.images.each do |i| %>
58
- <li>
59
- <%= link_to image_tag(i.thumbnail("200x200#c").url), i.thumbnail("900x600").url %>
60
- </li>
61
- <% end %>
62
- </ul>
63
- <% end %>
64
- <%= render :partial => "/shared/content_page" %>
45
+ `app/views/refinery/pages/show.html.erb`
46
+
47
+ ```erb
48
+ <% content_for :body_content_right do %>
49
+ <ul id='gallery'>
50
+ <% @page.images.each do |i| %>
51
+ <li>
52
+ <%= link_to image_tag(i.thumbnail("200x200#c").url), i.thumbnail("900x600").url %>
53
+ </li>
54
+ <% end %>
55
+ </ul>
56
+ <% end %>
57
+ <%= render :partial => "/refinery/content_page" %>
58
+ ```
65
59
 
66
60
  ## Screenshot
67
61
 
68
- ![Refinery CMS Page Images Screenshot](http://refinerycms.com/system/images/0000/1736/refinerycms-page-images.png)
62
+ ![Refinery CMS Page Images Screenshot](http://refinerycms.com/system/images/0000/1736/refinerycms-page-images.png)
@@ -0,0 +1,17 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{refinerycms-page-images}
3
+ s.version = %q{2.0.0}
4
+ s.description = %q{Page Images Engine for Refinery CMS}
5
+ s.date = Date.today.strftime("%Y-%m-%d")
6
+ s.summary = %q{Page Images Engine for Refinery CMS}
7
+ s.email = %q{dave@resolvedigital.com}
8
+ s.homepage = %q{http://github.com/resolve/refinerycms-page-images}
9
+ s.authors = ['Philip Arndt', 'David Jones']
10
+ s.require_paths = %w(lib)
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+ s.test_files = `git ls-files -- spec/*`.split("\n")
14
+
15
+ s.add_dependency 'refinerycms-pages', '~> 2.0.0'
16
+ s.add_development_dependency 'refinerycms-testing', '~> 2.0.0'
17
+ end
@@ -0,0 +1,9 @@
1
+ FactoryGirl.define do
2
+ factory :page_with_image, :parent => :page do
3
+ after_create { |p| p.images << Factory(:image) }
4
+ end
5
+
6
+ factory :blog_post_with_image, :parent => :blog_post do
7
+ after_create { |b| b.images << Factory(:image) }
8
+ end if defined? Refinery::Blog::Post
9
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ module Refinery
4
+ describe BlogPost do
5
+ it "should not have images" do
6
+ blog = Factory(:blog_post)
7
+ blog.images.count.should == 0
8
+ end
9
+
10
+ it "should have images" do
11
+ blog = Factory(:blog_post_with_image)
12
+ blog.images.count.should == 1
13
+ end
14
+ end
15
+ end if defined?(Refinery::Blog::Post)
@@ -0,0 +1,69 @@
1
+ require 'spec_helper'
2
+
3
+ module Refinery
4
+ describe Page do
5
+ it "can have images added" do
6
+ page = Factory(:page)
7
+ page.images.count.should eq(0)
8
+
9
+ page.images << Factory(:image)
10
+ page.images.count.should eq(1)
11
+ end
12
+
13
+ describe "#images_attributes=" do
14
+ it "adds images" do
15
+ page = Factory(:page)
16
+ image = Factory(:image)
17
+
18
+ page.images.count.should == 0
19
+ page.update_attributes({:images_attributes => {"0" => {"id" => image.id}}})
20
+
21
+ page.images.count.should == 1
22
+ end
23
+
24
+ it "deletes specific images" do
25
+ page = Factory(:page)
26
+ images = [Factory(:image), Factory(:image)]
27
+ page.images = images
28
+
29
+ page.update_attributes(:images_attributes => {
30
+ "0" => {
31
+ "id" => images.first.id.to_s,
32
+ "image_page_id" => page.image_pages.first.id,
33
+ },
34
+ })
35
+
36
+ page.images.should eq([images.first])
37
+ end
38
+
39
+ it "deletes all images" do
40
+ page = Factory(:page)
41
+ images = [Factory(:image), Factory(:image)]
42
+ page.images = images
43
+
44
+ page.update_attributes(:images_attributes => {"0" => {"id"=>""}})
45
+
46
+ page.images.should be_empty
47
+ end
48
+
49
+ it "reorders images" do
50
+ page = Factory(:page)
51
+ images = [Factory(:image), Factory(:image)]
52
+ page.images = images
53
+
54
+ page.update_attributes(:images_attributes => {
55
+ "0" => {
56
+ "id" => images.second.id,
57
+ "image_page_id" => page.image_pages.second.id,
58
+ },
59
+ "1" => {
60
+ "id" => images.first.id,
61
+ "image_page_id" => page.image_pages.first.id,
62
+ },
63
+ })
64
+
65
+ page.images.should eq([images.second, images.first])
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,29 @@
1
+ require "spec_helper"
2
+
3
+ describe "attach page images" do
4
+ login_refinery_user
5
+
6
+ before(:each) do
7
+ Factory(:page)
8
+
9
+ visit refinery.admin_pages_path
10
+
11
+ click_link "Edit this page"
12
+ end
13
+
14
+ it "shows images tab" do
15
+ within "#custom_images_tab" do
16
+ page.should have_content("Images")
17
+ end
18
+ end
19
+
20
+ # This spec actually is broken in a way because Add Image link would
21
+ # be visible to capybara even if we don't click on Images tab.
22
+ it "shows add image link" do
23
+ within "#custom_images_tab" do
24
+ click_link "Images"
25
+ end
26
+
27
+ page.should have_content("Add Image")
28
+ end
29
+ end
@@ -0,0 +1,56 @@
1
+ require 'rubygems'
2
+
3
+ def setup_environment
4
+ # Configure Rails Environment
5
+ ENV["RAILS_ENV"] ||= 'test'
6
+
7
+ require File.expand_path("../dummy/config/environment", __FILE__)
8
+
9
+ require 'rspec/rails'
10
+ require 'capybara/rspec'
11
+ require 'factory_girl_rails'
12
+
13
+ Rails.backtrace_cleaner.remove_silencers!
14
+
15
+ RSpec.configure do |config|
16
+ config.mock_with :rspec
17
+ config.treat_symbols_as_metadata_keys_with_true_values = true
18
+ config.filter_run :focus => true
19
+ config.run_all_when_everything_filtered = true
20
+ end
21
+
22
+ # set javascript driver for capybara
23
+ Capybara.javascript_driver = :selenium
24
+ end
25
+
26
+ def each_run
27
+ ActiveSupport::Dependencies.clear
28
+
29
+ FactoryGirl.reload
30
+
31
+ # Requires supporting files with custom matchers and macros, etc,
32
+ # in ./support/ and its subdirectories including factories.
33
+ ([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
34
+ Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
35
+ }.flatten.sort.each do |support_file|
36
+ require support_file
37
+ end
38
+ end
39
+
40
+ # If spork is available in the Gemfile it'll be used but we don't force it.
41
+ unless (begin; require 'spork'; rescue LoadError; nil end).nil?
42
+ Spork.prefork do
43
+ # Loading more in this block will cause your tests to run faster. However,
44
+ # if you change any configuration or code from libraries loaded here, you'll
45
+ # need to restart spork for it take effect.
46
+ setup_environment
47
+ end
48
+
49
+ Spork.each_run do
50
+ # This code will be run each time you run your specs.
51
+ each_run
52
+ end
53
+ else
54
+ setup_environment
55
+ each_run
56
+ end
@@ -0,0 +1,17 @@
1
+ require 'database_cleaner'
2
+
3
+ RSpec.configure do |config|
4
+ config.use_transactional_fixtures = false
5
+
6
+ config.before(:suite) do
7
+ DatabaseCleaner.strategy = :truncation
8
+ end
9
+
10
+ config.before(:each) do
11
+ DatabaseCleaner.start
12
+ end
13
+
14
+ config.after(:each) do
15
+ DatabaseCleaner.clean
16
+ end
17
+ end
@@ -0,0 +1,8 @@
1
+ require 'devise'
2
+
3
+ RSpec.configure do |config|
4
+ config.mock_with :rspec
5
+ config.use_transactional_fixtures = false
6
+
7
+ config.include Devise::TestHelpers, :type => :controller
8
+ end
@@ -0,0 +1,6 @@
1
+ require 'refinerycms-testing'
2
+
3
+ RSpec.configure do |config|
4
+ config.extend Refinery::Testing::ControllerMacros::Authentication, :type => :controller
5
+ config.extend Refinery::Testing::RequestMacros::Authentication, :type => :request
6
+ end
data/tasks/rspec.rake ADDED
@@ -0,0 +1,4 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ desc "Run specs"
4
+ RSpec::Core::RakeTask.new
metadata CHANGED
@@ -1,19 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-page-images
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease:
5
- version: 1.0.4
6
+ segments:
7
+ - 2
8
+ - 0
9
+ - 0
10
+ version: 2.0.0
6
11
  platform: ruby
7
12
  authors:
8
- - Resolve Digital
9
- - David Jones
10
13
  - Philip Arndt
14
+ - David Jones
11
15
  autorequire:
12
16
  bindir: bin
13
17
  cert_chain: []
14
18
 
15
- date: 2011-05-08 00:00:00 +12:00
16
- default_executable:
19
+ date: 2012-03-13 00:00:00 Z
17
20
  dependencies:
18
21
  - !ruby/object:Gem::Dependency
19
22
  name: refinerycms-pages
@@ -21,11 +24,32 @@ dependencies:
21
24
  requirement: &id001 !ruby/object:Gem::Requirement
22
25
  none: false
23
26
  requirements:
24
- - - ">="
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
- version: 0.9.9.1
29
+ hash: 15
30
+ segments:
31
+ - 2
32
+ - 0
33
+ - 0
34
+ version: 2.0.0
27
35
  type: :runtime
28
36
  version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: refinerycms-testing
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ hash: 15
46
+ segments:
47
+ - 2
48
+ - 0
49
+ - 0
50
+ version: 2.0.0
51
+ type: :development
52
+ version_requirements: *id002
29
53
  description: Page Images Engine for Refinery CMS
30
54
  email: dave@resolvedigital.com
31
55
  executables: []
@@ -35,22 +59,47 @@ extensions: []
35
59
  extra_rdoc_files: []
36
60
 
37
61
  files:
38
- - readme.md
39
- - app/models/image_page.rb
40
- - app/views/admin/pages/tabs/_images.html.erb
41
- - app/views/admin/pages/tabs/_images_bar.html.erb
42
- - app/views/admin/pages/tabs/_images_field.html.erb
62
+ - .gitignore
63
+ - .travis.yml
64
+ - Gemfile
65
+ - Rakefile
66
+ - app/assets/javascripts/refinery/page-image-picker.js.erb
67
+ - app/assets/stylesheets/refinery/page-image-picker.css.scss
68
+ - app/models/refinery/image_page.rb
69
+ - app/views/refinery/admin/pages/tabs/_images.html.erb
70
+ - app/views/refinery/admin/pages/tabs/_images_bar.html.erb
71
+ - app/views/refinery/admin/pages/tabs/_images_field.html.erb
72
+ - config/locales/bg.yml
73
+ - config/locales/cs.yml
74
+ - config/locales/de.yml
43
75
  - config/locales/en.yml
76
+ - config/locales/fr.yml
44
77
  - config/locales/nl.yml
78
+ - config/locales/pt-BR.yml
79
+ - config/locales/ru.yml
80
+ - config/locales/sk.yml
45
81
  - db/migrate/20101014230041_create_page_images.rb
46
82
  - db/migrate/20101014230042_add_caption_to_image_pages.rb
47
- - features/attach_page_images.feature
48
- - lib/gemspec.rb
49
- - lib/generators/refinerycms_page_images_generator.rb
83
+ - db/migrate/20110511215016_translate_page_image_captions.rb
84
+ - db/migrate/20110527052435_change_page_to_polymorphic.rb
85
+ - lib/generators/refinery/page_images_generator.rb
86
+ - lib/generators/refinery/templates/config/initializers/refinery/page_images.rb.erb
87
+ - lib/refinery/page_images.rb
88
+ - lib/refinery/page_images/configuration.rb
89
+ - lib/refinery/page_images/engine.rb
90
+ - lib/refinery/page_images/extension.rb
50
91
  - lib/refinerycms-page-images.rb
51
- - public/javascripts/page-image-picker.js
52
- - public/stylesheets/page-image-picker.css
53
- has_rdoc: true
92
+ - readme.md
93
+ - refinerycms-page-images.gemspec
94
+ - spec/factories/page-images.rb
95
+ - spec/models/refinery/blog_spec.rb
96
+ - spec/models/refinery/page_spec.rb
97
+ - spec/requests/attach_page_images_spec.rb
98
+ - spec/spec_helper.rb
99
+ - spec/support/database_cleaner.rb
100
+ - spec/support/devise.rb
101
+ - spec/support/refinery.rb
102
+ - tasks/rspec.rake
54
103
  homepage: http://github.com/resolve/refinerycms-page-images
55
104
  licenses: []
56
105
 
@@ -64,19 +113,33 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
113
  requirements:
65
114
  - - ">="
66
115
  - !ruby/object:Gem::Version
116
+ hash: 3
117
+ segments:
118
+ - 0
67
119
  version: "0"
68
120
  required_rubygems_version: !ruby/object:Gem::Requirement
69
121
  none: false
70
122
  requirements:
71
123
  - - ">="
72
124
  - !ruby/object:Gem::Version
125
+ hash: 3
126
+ segments:
127
+ - 0
73
128
  version: "0"
74
129
  requirements: []
75
130
 
76
131
  rubyforge_project:
77
- rubygems_version: 1.6.2
132
+ rubygems_version: 1.8.17
78
133
  signing_key:
79
134
  specification_version: 3
80
135
  summary: Page Images Engine for Refinery CMS
81
- test_files: []
82
-
136
+ test_files:
137
+ - spec/factories/page-images.rb
138
+ - spec/models/refinery/blog_spec.rb
139
+ - spec/models/refinery/page_spec.rb
140
+ - spec/requests/attach_page_images_spec.rb
141
+ - spec/spec_helper.rb
142
+ - spec/support/database_cleaner.rb
143
+ - spec/support/devise.rb
144
+ - spec/support/refinery.rb
145
+ has_rdoc:
@@ -1,10 +0,0 @@
1
- class ImagePage < ActiveRecord::Base
2
-
3
- belongs_to :image
4
- belongs_to :page
5
-
6
- before_save do |image_page|
7
- image_page.position = (ImagePage.maximum(:position) || -1) + 1
8
- end
9
-
10
- end
@@ -1,12 +0,0 @@
1
- <div class='wym_skin_refinery page_part' id='page_image_picker'>
2
- <%= render :partial => '/admin/pages/tabs/images_bar', :locals => {:f => f} %>
3
- <%= render :partial => '/admin/pages/tabs/images_field', :locals => {:f => f} %>
4
- </div>
5
-
6
- <% content_for :stylesheets do %>
7
- <%= stylesheet_link_tag 'page-image-picker' %>
8
- <% end %>
9
-
10
- <% content_for :javascripts do %>
11
- <%= javascript_include_tag 'page-image-picker' %>
12
- <% end %>
@@ -1,17 +0,0 @@
1
- @refinerycms @pages @pages-manage @page-images
2
- Feature: Attach Page Images
3
- In order to control the content on my website
4
- As an administrator
5
- I want to create and manage page images
6
-
7
- Background:
8
- Given I am a logged in refinery user
9
- And I have pages titled Home, About
10
- When I go to the list of pages
11
- And I follow "Edit this page"
12
-
13
- Scenario: Page Edit Shows Images Tab
14
- Then I should see "Images" within "#custom_images_tab"
15
-
16
- Scenario: Add Image Button appears
17
- Then I should see "Add Image"