spree_showcase 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,28 +1,43 @@
1
1
  Spree Showcase
2
2
  ===========
3
-
3
+ #### For anyone who recently upgraded on the master, please pull a file from the gem, please pull a file from the lib.
4
+
5
+ spree_showcase/lib/generators/spree_showcase/install/assets/javascripts/store/showcase.js.erb
6
+
4
7
  Spree Showcase is a simple extension that allows you to create the good ol' slideshow. The goal is to create a slideshow extension that makes things easy for the users and programmers. Minimal effort needed.
5
8
 
6
9
  The secondary objective is to create a slideshow template that allows most types of JS slider to be implemented easily into Spree.
7
10
 
8
- Currently, this is the first iteration of the slideshow extension at v0.1. Contributors are greatly welcomed =)
11
+ #### Screenshot of Frontend:
12
+ ![Screenshot of Frontend](https://github.com/downloads/daemonsy/spree_showcase/in%20action.png)
13
+
14
+ #### Admin Backend:
15
+ ![Screenshot of Backend](https://github.com/downloads/daemonsy/spree_showcase/Screen%20Shot%202012-05-09%20at%202.07.00%20AM.png)
16
+
17
+ Currently, this is the first iteration of the slideshow extension at v0.5.2. Contributors are greatly welcomed =)
9
18
 
10
19
  **Next to come:**
11
20
  - Adding sliders to different layout positions
12
21
  - Enabling more options to be customized in the Admin Menu
13
22
 
14
- Example
23
+ Installation
15
24
  =======
16
25
  Get a clean Spree Installation
17
26
 
18
- rails new spree_demo
19
- cd spree_demo
20
- spree install
27
+ ```rails new spree_demo```
28
+ ```cd spree_demo```
29
+ ```spree install```
30
+
31
+ ```gem 'spree_showcase', :git=>"git://github.com/daemonsy/spree_showcase" # Into Gemfile```
32
+
33
+ OR
34
+
35
+ ```gem 'spree_showcase' # Ruby Gems```
21
36
 
22
- gem 'spree_showcase', :git=>"git://github.com/daemonsy/spree_showcase" # Into Gemfile
37
+ ```bundle install```
38
+ ```rails g spree_showcase:install```
23
39
 
24
- bundle install
25
- rails g spree_showcase:install
40
+ **Remember** to run ```rake assets:clean```, otherwise the javascript library might not be loaded.
26
41
 
27
42
  Testing
28
43
  -------
@@ -2,11 +2,31 @@ module Spree
2
2
  module Admin
3
3
  class ShowcaseSettingsController < BaseController
4
4
  def show
5
- @preferences = [:enabled, :thumbnail_style, :showcase_style, :number_of_slides_to_show]
5
+ @preferences = [:enabled,
6
+ :thumbnail_style,
7
+ :showcase_style,
8
+ :number_of_slides_to_show,
9
+ :slideshow,
10
+ :animation_type,
11
+ :slideshow_speed,
12
+ :animation_duration,
13
+ :randomize,
14
+ :animation_loop,
15
+ :pause_on_hover]
6
16
  end
7
17
 
8
18
  def edit
9
- @preferences = [:enabled, :thumbnail_style, :showcase_style, :number_of_slides_to_show]
19
+ @preferences = [:enabled,
20
+ :thumbnail_style,
21
+ :showcase_style,
22
+ :number_of_slides_to_show,
23
+ :slideshow,
24
+ :animation_type,
25
+ :slideshow_speed,
26
+ :animation_duration,
27
+ :randomize,
28
+ :animation_loop,
29
+ :pause_on_hover]
10
30
  end
11
31
 
12
32
  def update
@@ -3,7 +3,7 @@ Deface::Override.new(:virtual_path => 'spree/admin/configurations/index',
3
3
  :insert_bottom => "[data-hook='admin_configurations_menu']",
4
4
  :text => %q{
5
5
  <tr>
6
- <td><%= link_to 'Showcase Slider', admin_slides_path %></td>
7
- <td>Showcase Slides & Settings</td>
6
+ <td><%= link_to t(:showcase_slider), admin_slides_path %></td>
7
+ <td><%= t(:showcase_settings) %></td>
8
8
  </tr> })
9
9
 
@@ -2,6 +2,6 @@ Deface::Override.new(
2
2
  :virtual_path => 'spree/admin/shared/_configuration_menu',
3
3
  :name => 'add_showcase_to_admin_configurations_side_menu',
4
4
  :insert_bottom => "[data-hook='admin_configurations_sidebar_menu']",
5
- :text => %q{<%= configurations_sidebar_menu_item 'Showcase Slider', admin_slides_path %>}
5
+ :text => %q{<%= configurations_sidebar_menu_item t(:showcase_slider), admin_slides_path %>}
6
6
  )
7
7
 
@@ -8,7 +8,7 @@
8
8
  type = SpreeShowcase::Config.preference_type(key) %>
9
9
  <%= label_tag(key, t(key) + ': ') + tag(:br) if type != :boolean %>
10
10
  <%= preference_field_tag(key, SpreeShowcase::Config[key], :type => type) %>
11
- <%= label_tag(key, t(key)) + tag(:br) if type == :boolean %>
11
+ <%= label_tag(key, t(key)) + tag(:br) if type == :boolean %> <br />
12
12
  <% end %>
13
13
  </fieldset>
14
14
  <p class="form-buttons" data-hook="buttons">
@@ -18,7 +18,7 @@
18
18
  <% end %>
19
19
 
20
20
  <%= f.field_container :thumbnail_message do %>
21
- <%= f.label "Thumb Message" %>
21
+ <%= f.label :thumbnail_message, t(:thumbnail_message) %>
22
22
  <%= f.text_field :thumbnail_message %>
23
23
  <% end %>
24
24
  <%= f.field_container :published do %>
@@ -3,18 +3,18 @@
3
3
  <div class="toolbar" data-hook="toolbar">
4
4
  <ul class="actions">
5
5
  <li>
6
- <p><%= button_link_to 'New Slide', new_object_url, :icon => 'add', :id => 'admin_new_slide_link' %></p>
6
+ <p><%= button_link_to t(:new_slide), new_object_url, :icon => 'add', :id => 'admin_new_slide_link' %></p>
7
7
  </li>
8
8
  </ul>
9
9
  <br class="clear" />
10
10
  </div>
11
11
 
12
- <h1>Showcase </h1>
12
+ <h1><%= t(:showcase) %></h1>
13
13
 
14
14
  <table class="index sortable" id="listing_slides" data-hook data-sortable-link="<%= update_positions_admin_slides_url %>">
15
15
  <thead>
16
16
  <tr data-hook="admin_slides_index_headers">
17
- <th>Name</th>
17
+ <th><%= t(:name) %></th>
18
18
  <th data-hook="admin_slides_index_header_actions"></th>
19
19
  </tr>
20
20
  </thead>
@@ -30,5 +30,3 @@
30
30
  <% end %>
31
31
  </tbody>
32
32
  </table>
33
-
34
- <p>Showcase is done by Damon Aw - @daemonsy</p>
@@ -1,6 +1,6 @@
1
1
  <%= render :partial => 'spree/admin/shared/configuration_menu' %>
2
2
  <%= render :partial=>'spree/admin/shared/showcase_submenu'%>
3
- <h1>New Showcase Slide</h1>
3
+ <h1><%= t(:new_showcase_slide) %></h1>
4
4
  <%= render 'spree/shared/error_messages', :target => @slide %>
5
5
 
6
6
  <%= form_for [:admin, @slide] , :html => { :multipart => true } do |f| %>
@@ -28,7 +28,7 @@
28
28
  </td>
29
29
  </tr>
30
30
  <tr data-hook="image_file_name">
31
- <th><%= t(:image_file_name) %></th>
31
+ <th><%= t(:image) %></th>
32
32
  <td>
33
33
  <%= @slide.image_file_name %>
34
34
  </td>
@@ -0,0 +1,15 @@
1
+ fr:
2
+ new_slide: "Ajouter une image"
3
+ showcase: "Diaporama"
4
+ slides: "Images"
5
+ slide: "Image"
6
+ showcase_slider: "Diaporama"
7
+ showcase_settings: "Options du diaporama"
8
+ edit_showcase_settings: "Edition des propriétés du diaporama"
9
+ body: "Corps"
10
+ target_url: "Cible du lien"
11
+ image: Image
12
+ thumbnail_message: "Texte de la miniature"
13
+ published: "Publiée"
14
+ new_showcase_slide: "Nouvelle image"
15
+ edit_showcase_slide: "Edition de l'image"
@@ -0,0 +1,32 @@
1
+ //= require store/jquery.flexslider
2
+ // Put your own showcase trigger here if you wish to use another JS Library. Remember to require it in all.js or this file.
3
+
4
+ $(window).load(function() {
5
+ $('.flexslider').flexslider({
6
+ animation: "<%= SpreeShowcase::Config[:animation_type] %>", //String: Select your animation type, "fade" or "slide"
7
+ slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
8
+ slideshow: "<%= SpreeShowcase::Config[:slideshow] %>", //Boolean: Animate slider automatically
9
+ slideshowSpeed: "<%= SpreeShowcase::Config[:slideshow_speed] %>", //Integer: Set the speed of the slideshow cycling, in milliseconds
10
+ animationDuration: "<%= SpreeShowcase::Config[:animation_duration] %>", //Integer: Set the speed of animations, in milliseconds
11
+ directionNav: false, //Boolean: Create navigation for previous/next navigation? (true/false)
12
+ controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
13
+ keyboardNav: true, //Boolean: Allow slider navigating via keyboard left/right keys
14
+ mousewheel: false, //Boolean: Allow slider navigating via mousewheel
15
+ prevText: "Previous", //String: Set the text for the "previous" directionNav item
16
+ nextText: "Next", //String: Set the text for the "next" directionNav item
17
+ pausePlay: false, //Boolean: Create pause/play dynamic element
18
+ pauseText: 'Pause', //String: Set the text for the "pause" pausePlay item
19
+ playText: 'Play', //String: Set the text for the "play" pausePlay item
20
+ randomize: "<%= SpreeShowcase::Config[:randomize] %>", //Boolean: Randomize slide order
21
+ slideToStart: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
22
+ animationLoop: "<%= SpreeShowcase::Config[:animation_loop] %>", //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
23
+ pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
24
+ pauseOnHover: "<%= SpreeShowcase::Config[:pause_on_hover] %>", //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
25
+ controlsContainer: ".flex-container", //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.
26
+ manualControls: ".custom-controls li a", //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
27
+ start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
28
+ before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation
29
+ after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
30
+ end: function(){} //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
31
+ });
32
+ });
@@ -5,17 +5,17 @@ module SpreeShowcase
5
5
 
6
6
  def add_javascripts
7
7
  append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_showcase\n"
8
- if copy_file "javascripts/store/showcase.js", "app/assets/javascripts/store/showcase.js"
9
- puts "Copied showcase.js into app/assets/javascripts/store/showcase.js\n"
8
+ if copy_file "javascripts/store/showcase.js.erb", "app/assets/javascripts/store/showcase.js.erb"
9
+ puts "Copied showcase.js.erb into app/assets/javascripts/store/showcase.js.erb\n"
10
10
  else
11
- puts "[Failed] File copying showcase.js => app/assets/javascripts/store/showcase.js\n"
11
+ puts "[Failed] File copying showcase.js.erb => app/assets/javascripts/store/showcase.js.erb\n"
12
12
  end
13
13
  if copy_file "javascripts/store/jquery.flexslider.js", "app/assets/javascripts/store/jquery.flexslider.js"
14
14
  puts "Copied jquery.flexslider.js into app/assets/javascripts/store/jquery.flexslider.js\n"
15
15
  else
16
16
  puts "[Failed] File copying jquery.flexslider.js => app/assets/javascripts/store/jquery.flexslider.js\n"
17
17
  end
18
- puts "Copying JS assets into your app's javascripts/store directory. The file showcase.js is required by the extension and is used to activate slideshow.\n"
18
+ puts "Copying JS assets into your app's javascripts/store directory. The file showcase.js.erb is required by the extension and is used to activate slideshow.\n"
19
19
  end
20
20
 
21
21
  def add_stylesheets
@@ -58,7 +58,8 @@ module SpreeShowcase
58
58
  end
59
59
 
60
60
  def complete
61
- puts "\nEverything is done! To summarize, _showcase.html.erb => HTML template, showcase.css.scss & showcase.js => assets. Edit these 3 files to fit run the slideshow."
61
+ puts "\nEverything is done! To summarize, _showcase.html.erb => HTML template, showcase.css.scss & showcase.js.erb => assets. Edit these 3 files to fit run the slideshow."
62
+ puts "\nPlease run rake assets:clean (IMPORTANT) to clear any precompiled assets from fresh install of Spree."
62
63
  end
63
64
  end
64
65
  end
@@ -4,5 +4,13 @@ class Spree::ShowcaseConfiguration < Spree::Preferences::Configuration
4
4
  preference :thumbnail_style, :string, :default=>"220x110#"
5
5
  preference :showcase_style, :string, :default =>"940x470#"
6
6
  preference :number_of_slides_to_show, :integer, :default=>4
7
+
8
+ preference :slideshow, :boolean, :default => true
9
+ preference :animation_type, :string, :default=>"fade"
10
+ preference :slideshow_speed, :integer, :default=>3000
11
+ preference :animation_duration, :integer, :default=>500
12
+ preference :randomize, :boolean, :default => false
13
+ preference :animation_loop, :boolean, :default => true
14
+ preference :pause_on_hover, :boolean, :default => true
7
15
  end
8
16
 
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_showcase'
5
- s.version = '0.5.2'
5
+ s.version = '0.5.3'
6
6
  s.summary = 'A Simple Spree Slider'
7
7
  s.description = 'A simple slider accommodator, using Flexslider as default'
8
8
  s.required_ruby_version = '>= 1.8.7'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_showcase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-12 00:00:00.000000000 Z
12
+ date: 2012-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core
@@ -146,11 +146,12 @@ files:
146
146
  - app/views/spree/slides/_content_insert.html.erb
147
147
  - app/views/spree/slides/_showcase.html.erb
148
148
  - config/locales/en.yml
149
+ - config/locales/fr.yml
149
150
  - config/routes.rb
150
151
  - db/migrate/20120506161852_create_slides.rb
151
152
  - db/migrate/20120507074922_add_position_to_slide.rb
152
153
  - lib/generators/spree_showcase/install/assets/javascripts/store/jquery.flexslider.js
153
- - lib/generators/spree_showcase/install/assets/javascripts/store/showcase.js
154
+ - lib/generators/spree_showcase/install/assets/javascripts/store/showcase.js.erb
154
155
  - lib/generators/spree_showcase/install/assets/partials/_showcase.html.erb
155
156
  - lib/generators/spree_showcase/install/assets/stylesheets/store/flexslider.css
156
157
  - lib/generators/spree_showcase/install/assets/stylesheets/store/showcase.css.scss
@@ -160,8 +161,6 @@ files:
160
161
  - lib/spree_showcase/engine.rb
161
162
  - script/rails
162
163
  - spec/spec_helper.rb
163
- - spree_showcase-0.5.0.gem
164
- - spree_showcase-0.5.1.gem
165
164
  - spree_showcase.gemspec
166
165
  homepage: http://theidealweb.com
167
166
  licenses: []
@@ -1,32 +0,0 @@
1
- //= require store/jquery.flexslider
2
- // Put your own showcase trigger here if you wish to use another JS Library. Remember to require it in all.js or this file.
3
-
4
- $(window).load(function() {
5
- $('.flexslider').flexslider({
6
- animation: "slide", //String: Select your animation type, "fade" or "slide"
7
- slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
8
- slideshow: true, //Boolean: Animate slider automatically
9
- slideshowSpeed: 12000, //Integer: Set the speed of the slideshow cycling, in milliseconds
10
- animationDuration: 500, //Integer: Set the speed of animations, in milliseconds
11
- directionNav: false, //Boolean: Create navigation for previous/next navigation? (true/false)
12
- controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
13
- keyboardNav: true, //Boolean: Allow slider navigating via keyboard left/right keys
14
- mousewheel: false, //Boolean: Allow slider navigating via mousewheel
15
- prevText: "Previous", //String: Set the text for the "previous" directionNav item
16
- nextText: "Next", //String: Set the text for the "next" directionNav item
17
- pausePlay: false, //Boolean: Create pause/play dynamic element
18
- pauseText: 'Pause', //String: Set the text for the "pause" pausePlay item
19
- playText: 'Play', //String: Set the text for the "play" pausePlay item
20
- randomize: false, //Boolean: Randomize slide order
21
- slideToStart: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
22
- animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
23
- pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
24
- pauseOnHover: true, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
25
- controlsContainer: ".flex-container", //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.
26
- manualControls: ".custom-controls li a", //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
27
- start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
28
- before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation
29
- after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
30
- end: function(){} //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
31
- });
32
- });
Binary file
Binary file