refinerycms-image_slideshows 1.11 → 1.12

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.
@@ -12,6 +12,8 @@ module Refinery
12
12
 
13
13
  belongs_to :image_slideshow
14
14
  belongs_to :image
15
+
16
+ delegate :height, :width, :to => :image_slideshow
15
17
  end
16
18
  end
17
19
  end
@@ -3,7 +3,7 @@ module Refinery
3
3
  class ImageSlideshow < Refinery::Core::BaseModel
4
4
  self.table_name = 'refinery_image_slideshows'
5
5
 
6
- attr_accessible :title, :position, :js_config
6
+ attr_accessible :title, :position, :js_config, :height, :width
7
7
 
8
8
  acts_as_indexed :fields => [:title]
9
9
 
@@ -9,6 +9,16 @@
9
9
  <%= f.text_field :title, :class => 'larger widest' -%>
10
10
  </div>
11
11
 
12
+ <div class='field'>
13
+ <%= f.label :height -%>
14
+ <%= f.text_field :height -%>
15
+ </div>
16
+
17
+ <div class='field'>
18
+ <%= f.label :width -%>
19
+ <%= f.text_field :width -%>
20
+ </div>
21
+
12
22
  <div class='field'>
13
23
  <%= f.label :js_config, 'JavaScript Config' -%>
14
24
  <%= f.text_area :js_config, :cols => 80, :rows => 20 -%>
@@ -0,0 +1,6 @@
1
+ class AddHeightAndWidthToImageSlideshows < ActiveRecord::Migration
2
+ def change
3
+ add_column :refinery_image_slideshows, :height, :string
4
+ add_column :refinery_image_slideshows, :width, :string
5
+ end
6
+ end
data/readme.md CHANGED
@@ -1,10 +1,62 @@
1
- # Image Slideshows extension for Refinery CMS.
1
+ # Image Slideshows
2
+
3
+ ![Refinery Image Slideshows](http://refinerycms.com/system/images/0000/0876/news.png)
4
+
5
+ ## About
6
+
7
+ __Image Slideshows allows you to create groups of images for use by a JavaScript image slider.__
8
+
9
+ Suggested image slider: [Nivo Slider](http://nivo.dev7studios.com)
10
+
11
+ ## Requirements
12
+
13
+ [Refinery CMS](http://refinerycms.com) "core" engine version 2.0.0 or later.
14
+
15
+ ### Gem Installation
16
+
17
+ Include the latest [gem](http://rubygems.org/gems/refinerycms-image_slideshows) into your Refinery CMS application's Gemfile:
18
+
19
+ ```ruby
20
+ gem "refinerycms-image_slideshows", '~> 1.0'
21
+ ```
22
+
23
+ Then type the following at the command line inside your Refinery CMS application's root directory:
24
+
25
+ bundle install
26
+ rails generate refinery:image_slideshows
27
+ rake db:migrate
28
+ rake db:seed
29
+
30
+ ## How to display a slideshow with [Nivo Slider](http://nivo.dev7studios.com):
31
+
32
+ ```html+erb
33
+ <body>
34
+ <% main_slideshow = Refinery::ImageSlideshows::ImageSlideshow.find_by_title('Demo') %>
35
+ <div id="wrapper">
36
+ <div class="slider-wrapper theme-default">
37
+ <div id="slider" class="nivoSlider">
38
+ <% main_slideshow.image_slides.each do |image_slide| %>
39
+ <%= link_to image_slide.link_url do %>
40
+ <%= image_tag image_slide.image.url, :alt => image_slide.title, :title => image_slide.caption %>
41
+ <% end %>
42
+ <% end %>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <script type="text/javascript" src="/javascripts/jquery-1.7.1.min.js"></script>
47
+ <script type="text/javascript" src="/javascripts/jquery.nivo.slider.js"></script>
48
+ <script type="text/javascript">
49
+ $(window).load(function() {
50
+ $('#slider').nivoSlider({
51
+ <%= raw main_slideshow.js_config %>
52
+ });
53
+ });
54
+ </script>
55
+ </body>
56
+ ```
57
+
58
+
59
+
2
60
 
3
- ## How to build this extension as a gem
4
61
 
5
- cd vendor/extensions/image_slideshows
6
- gem build refinerycms-image_slideshows.gemspec
7
- gem install refinerycms-image_slideshows.gem
8
62
 
9
- # Sign up for a http://rubygems.org/ account and publish the gem
10
- gem push refinerycms-image_slideshows.gem
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-image_slideshows
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.11'
4
+ version: '1.12'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -44,7 +44,7 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: 2.0.9
46
46
  description: Ruby on Rails Image Slideshows extension for Refinery CMS
47
- email:
47
+ email: jim@roboticmethod.com
48
48
  executables: []
49
49
  extensions: []
50
50
  extra_rdoc_files: []
@@ -84,6 +84,7 @@ files:
84
84
  - db/migrate/3_add_image_and_caption_to_image_slides.rb
85
85
  - db/migrate/4_add_js_config_to_image_slideshows.rb
86
86
  - db/migrate/5_add_link_url_to_image_slides.rb
87
+ - db/migrate/6_add_height_and_width_to_image_slideshows.rb
87
88
  - db/seeds.rb
88
89
  - lib/generators/refinery/image_slideshows_generator.rb
89
90
  - lib/refinery/image_slideshows/engine.rb
@@ -91,7 +92,7 @@ files:
91
92
  - lib/refinerycms-image_slideshows.rb
92
93
  - lib/tasks/refinery/image_slideshows.rake
93
94
  - readme.md
94
- homepage:
95
+ homepage: http://refinerycms.com
95
96
  licenses: []
96
97
  post_install_message:
97
98
  rdoc_options: []