spree_home_page_features 1.1.3
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.
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/Gemfile +9 -0
- data/LICENSE +26 -0
- data/README.md +21 -0
- data/Rakefile +29 -0
- data/Versionfile +11 -0
- data/app/assets/javascripts/admin/spree_home_page_features.js +1 -0
- data/app/assets/javascripts/store/spree_home_page_features.js.coffee +6 -0
- data/app/assets/stylesheets/admin/spree_home_page_features.css +3 -0
- data/app/assets/stylesheets/store/spree_home_page_features.css +21 -0
- data/app/controllers/spree/admin/home_page_features_controller.rb +27 -0
- data/app/models/spree/home_page_feature.rb +26 -0
- data/app/overrides/admin/add_home_page_features_tab.rb +6 -0
- data/app/overrides/display_on_homepage.rb +6 -0
- data/app/views/spree/admin/home_page_features/_form.erb +16 -0
- data/app/views/spree/admin/home_page_features/_tab.erb +1 -0
- data/app/views/spree/admin/home_page_features/edit.html.erb +10 -0
- data/app/views/spree/admin/home_page_features/index.html.erb +43 -0
- data/app/views/spree/admin/home_page_features/new.html.erb +10 -0
- data/app/views/spree/home_page_features/_features.erb +12 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20120711073050_create_home_page_features.rb +12 -0
- data/lib/assets/javascripts/jquery.flexslider-min.js +37 -0
- data/lib/assets/stylesheets/flexslider.css +75 -0
- data/lib/generators/spree_home_page_features/install/install_generator.rb +29 -0
- data/lib/spree_home_page_features/engine.rb +22 -0
- data/lib/spree_home_page_features.rb +2 -0
- data/script/rails +7 -0
- data/spec/spec_helper.rb +44 -0
- data/spree_home_page_features.gemspec +28 -0
- metadata +145 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) 2012 [name of plugin creator]
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
* Neither the name Spree nor the names of its contributors may be used to
|
13
|
+
endorse or promote products derived from this software without specific
|
14
|
+
prior written permission.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
20
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
SpreeHomePageFeatures
|
2
|
+
=====================
|
3
|
+
|
4
|
+
Introduction goes here.
|
5
|
+
|
6
|
+
|
7
|
+
Example
|
8
|
+
=======
|
9
|
+
|
10
|
+
Example goes here.
|
11
|
+
|
12
|
+
Testing
|
13
|
+
-------
|
14
|
+
|
15
|
+
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
$ bundle exec rake test_app
|
19
|
+
$ bundle exec rspec spec
|
20
|
+
|
21
|
+
Copyright (c) 2012 [name of extension creator], released under the New BSD License
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rake/packagetask'
|
4
|
+
require 'rubygems/package_task'
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
require 'spree/core/testing_support/common_rake'
|
7
|
+
|
8
|
+
RSpec::Core::RakeTask.new
|
9
|
+
|
10
|
+
task :default => [:spec]
|
11
|
+
|
12
|
+
spec = eval(File.read('spree_home_page_features.gemspec'))
|
13
|
+
|
14
|
+
Gem::PackageTask.new(spec) do |p|
|
15
|
+
p.gem_spec = spec
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'Release to gemcutter'
|
19
|
+
task :release => :package do
|
20
|
+
require 'rake/gemcutter'
|
21
|
+
Rake::Gemcutter::Tasks.new(spec).define
|
22
|
+
Rake::Task['gem:push'].invoke
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'Generates a dummy app for testing'
|
26
|
+
task :test_app do
|
27
|
+
ENV['LIB_NAME'] = 'spree_home_page_features'
|
28
|
+
Rake::Task['common:test_app'].invoke
|
29
|
+
end
|
data/Versionfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# This file is used to designate compatibilty with different versions of Spree
|
2
|
+
# Please see http://spreecommerce.com/documentation/extensions.html#versionfile for details
|
3
|
+
|
4
|
+
# Examples
|
5
|
+
#
|
6
|
+
# '1.2.x' => { :branch => 'master' }
|
7
|
+
# '1.1.x' => { :branch => '1-1-stable' }
|
8
|
+
# '1.0.x' => { :branch => '1-0-stable' }
|
9
|
+
# '0.70.x' => { :branch => '0-70-stable' }
|
10
|
+
# '0.40.x' => { :tag => 'v1.0.0', :version => '1.0.0' }
|
11
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require admin/spree_core
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/*
|
2
|
+
*= require flexslider
|
3
|
+
*= require store/spree_core
|
4
|
+
*/
|
5
|
+
|
6
|
+
.flexslider .hero, .section-header .hero {
|
7
|
+
max-height: 200px;
|
8
|
+
overflow: hidden;
|
9
|
+
}
|
10
|
+
|
11
|
+
.flexslider, .section-header {
|
12
|
+
height: 257px;
|
13
|
+
background-color: #bbb;
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
#wrapper .section-header, .flexslider .feature{
|
18
|
+
height: 257px;
|
19
|
+
border-bottom-style: solid;
|
20
|
+
border-bottom-width: 5px;
|
21
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
class HomePageFeaturesController < Spree::Admin::ResourceController
|
4
|
+
def model_class
|
5
|
+
Spree::HomePageFeature
|
6
|
+
end
|
7
|
+
|
8
|
+
def new_object_url(options = {})
|
9
|
+
spree.new_admin_home_page_feature_path
|
10
|
+
end
|
11
|
+
|
12
|
+
def edit_object_url(object, options = {})
|
13
|
+
target = object ? object : @object
|
14
|
+
spree.edit_admin_home_page_feature_url target
|
15
|
+
end
|
16
|
+
|
17
|
+
def object_url(object = nil, options = {})
|
18
|
+
target = object ? object : @object
|
19
|
+
spree.edit_admin_home_page_feature_url target
|
20
|
+
end
|
21
|
+
|
22
|
+
def collection_url(options = {})
|
23
|
+
spree.admin_home_page_features_path
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Spree
|
2
|
+
class HomePageFeature < ActiveRecord::Base
|
3
|
+
self.table_name = 'home_page_features'
|
4
|
+
attr_accessible :body, :publish, :style, :title
|
5
|
+
|
6
|
+
scope :published, where(publish: true)
|
7
|
+
|
8
|
+
def style
|
9
|
+
self.style || ""
|
10
|
+
end
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def styles
|
14
|
+
@styles ||= []
|
15
|
+
end
|
16
|
+
|
17
|
+
def styles=(styles)
|
18
|
+
@styles = styles
|
19
|
+
end
|
20
|
+
|
21
|
+
def styles_dropdown
|
22
|
+
styles.map {|s| [s.humanize, s]}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= f.field_container :title do %>
|
2
|
+
<%= f.label :title, t(:title) %><br />
|
3
|
+
<%= f.text_field :title %>
|
4
|
+
<% end %>
|
5
|
+
<%= f.field_container :body do %>
|
6
|
+
<%= f.label :body, t(:body) %><br />
|
7
|
+
<%= f.text_area :body %>
|
8
|
+
<% end %>
|
9
|
+
<%= f.field_container :style do %>
|
10
|
+
<%= f.label :style, t(:style) %><br />
|
11
|
+
<%= f.select :style, Spree::HomePageFeature.styles_dropdown %>
|
12
|
+
<% end %>
|
13
|
+
<%= f.field_container :publish do %>
|
14
|
+
<%= f.label :publish, t(:publish) %><br />
|
15
|
+
<%= f.check_box :publish %>
|
16
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= tab :home_page_features, url: spree.admin_home_page_features_path %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
|
2
|
+
|
3
|
+
<h1>Editing Home Page Feature</h1>
|
4
|
+
|
5
|
+
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @home_page_feature } %>
|
6
|
+
|
7
|
+
<%= form_for [:admin, @home_page_feature], url: spree.admin_home_page_feature_path(@home_page_feature) do |f| %>
|
8
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
9
|
+
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
10
|
+
<% end %>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
|
2
|
+
|
3
|
+
<div class="toolbar" data-hook="toolbar">
|
4
|
+
<ul class="actions">
|
5
|
+
<li>
|
6
|
+
<p><%= button_link_to 'New Feature', spree.new_admin_home_page_feature_path, :icon => 'add', :id => 'admin_new_home_page_feature_link' %>
|
7
|
+
</p>
|
8
|
+
</li>
|
9
|
+
</ul>
|
10
|
+
<br class="clear" />
|
11
|
+
</div>
|
12
|
+
|
13
|
+
|
14
|
+
<h1><%= t(:listing_home_page_features) %></h1>
|
15
|
+
<table class="index" id='listing_home_page_features'>
|
16
|
+
<thead>
|
17
|
+
<tr>
|
18
|
+
<th><%= t(:title) %></th>
|
19
|
+
<th><%= t(:style) %></th>
|
20
|
+
<th><%= t(:published) %></th>
|
21
|
+
<th></th>
|
22
|
+
</tr>
|
23
|
+
</thead>
|
24
|
+
<tbody>
|
25
|
+
<% @home_page_features.each do |home_page_feature|
|
26
|
+
@edit_url = spree.edit_admin_home_page_feature_path(home_page_feature)
|
27
|
+
@delete_url = spree.admin_home_page_feature_path(home_page_feature)
|
28
|
+
%>
|
29
|
+
<tr id="<%= spree_dom_id home_page_feature %>">
|
30
|
+
<td><%= home_page_feature.title %></td>
|
31
|
+
<td><%= home_page_feature.style.humanize %></td>
|
32
|
+
<td><%= home_page_feature.publish.to_s.titleize %></td>
|
33
|
+
<td class="actions">
|
34
|
+
<%= link_to_edit home_page_feature, :class => 'edit' %>
|
35
|
+
<%= link_to_delete home_page_feature, url: spree.admin_home_page_feature_path(home_page_feature) %>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
38
|
+
<% if @home_page_features.empty? %>
|
39
|
+
<tr><td colspan="4"><%= t(:none) %></td></tr>
|
40
|
+
<% end %>
|
41
|
+
</tbody>
|
42
|
+
</table>
|
43
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
|
2
|
+
|
3
|
+
<h1>New Home Page Feature</h1>
|
4
|
+
|
5
|
+
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @home_page_feature } %>
|
6
|
+
|
7
|
+
<%= form_for [:admin, @home_page_feature], url: spree.admin_home_page_features_path do |f| %>
|
8
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
9
|
+
<%= render :partial => 'spree/admin/shared/new_resource_links', locals: { collection_url: spree.admin_home_page_features_path } %>
|
10
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="flexslider">
|
2
|
+
<ul class="slides">
|
3
|
+
<% Spree::HomePageFeature.published.each do |feature| %>
|
4
|
+
<li class="feature <%= feature.style %>">
|
5
|
+
<div class="hero padded vertical-margin">
|
6
|
+
<div class="title"><%= feature.title %></div>
|
7
|
+
<div class="body"><%= feature.body %></div>
|
8
|
+
</div>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
</div>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery FlexSlider v2.0
|
3
|
+
* Copyright 2012 WooThemes
|
4
|
+
* Contributing Author: Tyler Smith
|
5
|
+
*/
|
6
|
+
;(function(d){d.flexslider=function(h,k){var a=d(h),c=d.extend({},d.flexslider.defaults,k),e=c.namespace,o="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,s=o?"touchend":"click",l="vertical"===c.direction,m=c.reverse,i=0<c.itemWidth,p="fade"===c.animation,r=""!==c.asNavFor,f={};d.data(h,"flexslider",a);f={init:function(){a.animating=!1;a.currentSlide=c.startAt;a.animatingTo=a.currentSlide;a.atEnd=0===a.currentSlide||a.currentSlide===a.last;a.containerSelector=c.selector.substr(0,
|
7
|
+
c.selector.search(" "));a.slides=d(c.selector,a);a.container=d(a.containerSelector,a);a.count=a.slides.length;a.syncExists=0<d(c.sync).length;"slide"===c.animation&&(c.animation="swing");a.prop=l?"top":"marginLeft";a.args={};a.manualPause=!1;a.transitions=!c.video&&!p&&c.useCSS&&function(){var b=document.createElement("div"),c=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"],d;for(d in c)if(b.style[c[d]]!==void 0){a.pfx=c[d].replace("Perspective","").toLowerCase();
|
8
|
+
a.prop="-"+a.pfx+"-transform";return true}return false}();""!==c.controlsContainer&&(a.controlsContainer=0<d(c.controlsContainer).length&&d(c.controlsContainer));""!==c.manualControls&&(a.manualControls=0<d(c.manualControls).length&&d(c.manualControls));c.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-0.5}),a.container.empty().append(a.slides));a.doMath();r&&f.asNav.setup();a.setup("init");c.controlNav&&f.controlNav.setup();c.directionNav&&f.directionNav.setup();c.keyboard&&
|
9
|
+
(1===d(a.containerSelector).length||c.multipleKeyboard)&&d(document).bind("keyup",function(b){b=b.keyCode;if(!a.animating&&(b===39||b===37)){b=b===39?a.getTarget("next"):b===37?a.getTarget("prev"):false;a.flexAnimate(b,c.pauseOnAction)}});c.mousewheel&&a.bind("mousewheel",function(b,g){b.preventDefault();var d=g<0?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(d,c.pauseOnAction)});c.pausePlay&&f.pausePlay.setup();c.slideshow&&(c.pauseOnHover&&a.hover(function(){a.pause()},function(){a.manualPause||
|
10
|
+
a.play()}),0<c.initDelay?setTimeout(a.play,c.initDelay):a.play());o&&c.touch&&f.touch();(!p||p&&c.smoothHeight)&&d(window).bind("resize focus",f.resize);setTimeout(function(){c.start(a)},200)},asNav:{setup:function(){a.asNav=!0;a.animatingTo=Math.floor(a.currentSlide/a.move);a.currentItem=a.currentSlide;a.slides.removeClass(e+"active-slide").eq(a.currentItem).addClass(e+"active-slide");a.slides.click(function(b){b.preventDefault();var b=d(this),g=b.index();!d(c.asNavFor).data("flexslider").animating&&
|
11
|
+
!b.hasClass("active")&&(a.direction=a.currentItem<g?"next":"prev",a.flexAnimate(g,c.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var b=1,g;a.controlNavScaffold=d('<ol class="'+e+"control-nav "+e+("thumbnails"===c.controlNav?"control-thumbs":"control-paging")+'"></ol>');if(1<a.pagingCount)for(var q=0;q<a.pagingCount;q++)g="thumbnails"===c.controlNav?'<img src="'+a.slides.eq(q).attr("data-thumb")+
|
12
|
+
'"/>':"<a>"+b+"</a>",a.controlNavScaffold.append("<li>"+g+"</li>"),b++;a.controlsContainer?d(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img",s,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(a.direction=g>a.currentSlide?"next":"prev",a.flexAnimate(g,c.pauseOnAction))});o&&a.controlNavScaffold.delegate("a","click touchstart",function(a){a.preventDefault()})},
|
13
|
+
setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.live(s,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(g>a.currentSlide?a.direction="next":a.direction="prev",a.flexAnimate(g,c.pauseOnAction))});o&&a.controlNav.live("click touchstart",function(a){a.preventDefault()})},set:function(){a.controlNav=d("."+e+"control-nav li "+("thumbnails"===c.controlNav?"img":"a"),a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(e+
|
14
|
+
"active").eq(a.animatingTo).addClass(e+"active")},update:function(b,c){1<a.pagingCount&&"add"===b?a.controlNavScaffold.append(d("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(c).closest("li").remove();f.controlNav.set();1<a.pagingCount&&a.pagingCount!==a.controlNav.length?a.update(c,b):f.controlNav.active()}},directionNav:{setup:function(){var b=d('<ul class="'+e+'direction-nav"><li><a class="'+e+'prev" href="#">'+c.prevText+'</a></li><li><a class="'+
|
15
|
+
e+'next" href="#">'+c.nextText+"</a></li></ul>");a.controlsContainer?(d(a.controlsContainer).append(b),a.directionNav=d("."+e+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav=d("."+e+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind(s,function(b){b.preventDefault();b=d(this).hasClass(e+"next")?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(b,c.pauseOnAction)});o&&a.directionNav.bind("click touchstart",function(a){a.preventDefault()})},update:function(){var b=
|
16
|
+
e+"disabled";c.animationLoop||(1===a.pagingCount?a.directionNav.addClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+e+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+e+"next").addClass(b):a.directionNav.removeClass(b))}},pausePlay:{setup:function(){var b=d('<div class="'+e+'pauseplay"><a></a></div>');a.controlsContainer?(a.controlsContainer.append(b),a.pausePlay=d("."+e+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=d("."+e+"pauseplay a",
|
17
|
+
a));f.pausePlay.update(c.slideshow?e+"pause":e+"play");a.pausePlay.bind(s,function(b){b.preventDefault();if(d(this).hasClass(e+"pause")){a.pause();a.manualPause=true}else{a.play();a.manualPause=false}});o&&a.pausePlay.bind("click touchstart",function(a){a.preventDefault()})},update:function(b){"play"===b?a.pausePlay.removeClass(e+"pause").addClass(e+"play").text(c.playText):a.pausePlay.removeClass(e+"play").addClass(e+"pause").text(c.pauseText)}},touch:function(){function b(b){j=l?d-b.touches[0].pageY:
|
18
|
+
d-b.touches[0].pageX;o=l?Math.abs(j)<Math.abs(b.touches[0].pageX-e):Math.abs(j)<Math.abs(b.touches[0].pageY-e);if(!o||500<Number(new Date)-k)b.preventDefault(),!p&&a.transitions&&(c.animationLoop||(j/=0===a.currentSlide&&0>j||a.currentSlide===a.last&&0<j?Math.abs(j)/n+2:1),a.setProps(f+j,"setTouch"))}function g(){if(a.animatingTo===a.currentSlide&&!o&&null!==j){var i=m?-j:j,l=0<i?a.getTarget("next"):a.getTarget("prev");a.canAdvance(l)&&(550>Number(new Date)-k&&20<Math.abs(i)||Math.abs(i)>n/2)?a.flexAnimate(l,
|
19
|
+
c.pauseOnAction):a.flexAnimate(a.currentSlide,c.pauseOnAction,!0)}h.removeEventListener("touchmove",b,!1);h.removeEventListener("touchend",g,!1);f=j=e=d=null}var d,e,f,n,j,k,o=!1;h.addEventListener("touchstart",function(j){a.animating?j.preventDefault():1===j.touches.length&&(a.pause(),n=l?a.h:a.w,k=Number(new Date),f=i&&m&&a.animatingTo===a.last?0:i&&m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:i&&a.currentSlide===a.last?a.limit:i?(a.itemW+c.itemMargin)*a.move*a.currentSlide:m?(a.last-a.currentSlide+
|
20
|
+
a.cloneOffset)*n:(a.currentSlide+a.cloneOffset)*n,d=l?j.touches[0].pageY:j.touches[0].pageX,e=l?j.touches[0].pageX:j.touches[0].pageY,h.addEventListener("touchmove",b,!1),h.addEventListener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(i||a.doMath(),p?f.smoothHeight():i?(a.slides.width(a.computedW),a.update(a.pagingCount),a.setProps()):l?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(c.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,
|
21
|
+
"setTotal")))},smoothHeight:function(b){if(!l||p){var c=p?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingTo).height()},b):c.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingTo;switch(b){case "animate":g.flexAnimate(e,c.pauseOnAction,!1,!0);break;case "play":!g.playing&&!g.asNav&&g.play();break;case "pause":g.pause()}}};a.flexAnimate=function(b,g,q,h,k){if(!a.animating&&(a.canAdvance(b)||q)&&a.is(":visible")){if(r&&h)if(q=d(c.asNavFor).data("flexslider"),
|
22
|
+
a.atEnd=0===b||b===a.count-1,q.flexAnimate(b,!0,!1,!0,k),a.direction=a.currentItem<b?"next":"prev",q.direction=a.direction,Math.ceil((b+1)/a.visible)-1!==a.currentSlide&&0!==b)a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide"),b=Math.floor(b/a.visible);else return a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide"),!1;a.animating=!0;a.animatingTo=b;c.before(a);g&&a.pause();a.syncExists&&!k&&f.sync("animate");c.controlNav&&f.controlNav.active();
|
23
|
+
i||a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide");a.atEnd=0===b||b===a.last;c.directionNav&&f.directionNav.update();b===a.last&&(c.end(a),c.animationLoop||a.pause());if(p)a.slides.eq(a.currentSlide).fadeOut(c.animationSpeed,c.easing),a.slides.eq(b).fadeIn(c.animationSpeed,c.easing,a.wrapup);else{var n=l?a.slides.filter(":first").height():a.computedW;i?(b=c.itemWidth>a.w?2*c.itemMargin:c.itemMargin,b=(a.itemW+b)*a.move*a.animatingTo,b=b>a.limit&&1!==a.visible?a.limit:b):b=
|
24
|
+
0===a.currentSlide&&b===a.count-1&&c.animationLoop&&"next"!==a.direction?m?(a.count+a.cloneOffset)*n:0:a.currentSlide===a.last&&0===b&&c.animationLoop&&"prev"!==a.direction?m?0:(a.count+1)*n:m?(a.count-1-b+a.cloneOffset)*n:(b+a.cloneOffset)*n;a.setProps(b,"",c.animationSpeed);if(a.transitions){if(!c.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",function(){a.wrapup(n)})}else a.container.animate(a.args,
|
25
|
+
c.animationSpeed,c.easing,function(){a.wrapup(n)})}c.smoothHeight&&f.smoothHeight(c.animationSpeed)}};a.wrapup=function(b){!p&&!i&&(0===a.currentSlide&&a.animatingTo===a.last&&c.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide===a.last&&(0===a.animatingTo&&c.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;c.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=function(){clearInterval(a.animatedSlides);a.playing=!1;
|
26
|
+
c.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides=setInterval(a.animateSlides,c.slideshowSpeed);a.playing=!0;c.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b){var d=r?a.pagingCount-1:a.last;return r&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&!r?!1:c.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===d&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===d&&0===
|
27
|
+
b&&"next"===a.direction?!1:!0};a.getTarget=function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1};a.setProps=function(b,d,e){var f=function(){var e=b?b:(a.itemW+c.itemMargin)*a.move*a.animatingTo;return-1*function(){if(i)return"setTouch"===d?b:m&&a.animatingTo===a.last?0:m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:e;switch(d){case "setTotal":return m?(a.count-1-a.currentSlide+a.cloneOffset)*
|
28
|
+
b:(a.currentSlide+a.cloneOffset)*b;case "setTouch":return b;case "jumpEnd":return m?b:a.count*b;case "jumpStart":return m?a.count*b:b;default:return b}}()+"px"}();a.transitions&&(f=l?"translate3d(0,"+f+",0)":"translate3d("+f+",0,0)",e=void 0!==e?e/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",e));a.args[a.prop]=f;(a.transitions||void 0===e)&&a.container.css(a.args)};a.setup=function(b){if(p)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===
|
29
|
+
b&&a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed,c.easing),c.smoothHeight&&f.smoothHeight();else{var g,h;"init"===b&&(a.viewport=d('<div class="flex-viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,m&&(h=d.makeArray(a.slides).reverse(),a.slides=d(h),a.container.empty().append(a.slides)));c.animationLoop&&!i&&(a.cloneCount=2,a.cloneOffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));
|
30
|
+
a.newSlides=d(c.selector,a);g=m?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;l&&!i?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"});a.doMath();a.viewport.height(a.h);a.setProps(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(g*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",
|
31
|
+
display:"block"});c.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}i||a.slides.removeClass(e+"active-slide").eq(a.currentSlide).addClass(e+"active-slide")};a.doMath=function(){var b=a.slides.first(),d=c.itemMargin,e=c.minItems,f=c.maxItems;a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();i?(a.itemT=c.itemWidth+d,a.minW=e?e*a.itemT:a.w,a.maxW=f?f*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-d*e)/e:a.maxW<a.w?(a.w-d*f)/f:c.itemWidth>a.w?a.w:c.itemWidth,a.visible=Math.floor(a.w/(a.itemW+
|
32
|
+
d)),a.move=0<c.move&&c.move<a.visible?c.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:c.itemWidth>a.w?(a.itemW+2*d)*a.count-a.w-d:(a.itemW+d)*a.count-a.w):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,d){a.doMath();i||(b<a.currentSlide?a.currentSlide+=1:b<=a.currentSlide&&0!==b&&(a.currentSlide-=1),a.animatingTo=a.currentSlide);if(c.controlNav&&!a.manualControls)if("add"===
|
33
|
+
d&&!i||a.pagingCount>a.controlNav.length)f.controlNav.update("add");else if("remove"===d&&!i||a.pagingCount<a.controlNav.length)i&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),f.controlNav.update("remove",a.last);c.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;l&&m?void 0!==e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+
|
34
|
+
":not(.clone)",a);a.setup();c.added(a)};a.removeSlide=function(b){var e=isNaN(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?d(b,a.slides).remove():l&&m?a.slides.eq(a.last).remove():a.slides.eq(b).remove();a.doMath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,
|
35
|
+
slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},
|
36
|
+
removed:function(){}};d.fn.flexslider=function(h){h=h||{};if("object"===typeof h)return this.each(function(){var a=d(this),c=a.find(h.selector?h.selector:".slides > li");1===c.length?(c.fadeIn(400),h.start&&h.start(a)):void 0===a.data("flexslider")&&new d.flexslider(this,h)});var k=d(this).data("flexslider");switch(h){case "play":k.play();break;case "pause":k.pause();break;case "next":k.flexAnimate(k.getTarget("next"),!0);break;case "prev":case "previous":k.flexAnimate(k.getTarget("prev"),!0);break;
|
37
|
+
default:"number"===typeof h&&k.flexAnimate(h,!0)}}})(jQuery);
|
@@ -0,0 +1,75 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery FlexSlider v2.0
|
3
|
+
* http://www.woothemes.com/flexslider/
|
4
|
+
*
|
5
|
+
* Copyright 2012 WooThemes
|
6
|
+
* Free to use under the GPLv2 license.
|
7
|
+
* http://www.gnu.org/licenses/gpl-2.0.html
|
8
|
+
*
|
9
|
+
* Contributing author: Tyler Smith (@mbmufffin)
|
10
|
+
*/
|
11
|
+
|
12
|
+
|
13
|
+
/* Browser Resets */
|
14
|
+
.flex-container a:active,
|
15
|
+
.flexslider a:active,
|
16
|
+
.flex-container a:focus,
|
17
|
+
.flexslider a:focus {outline: none;}
|
18
|
+
.slides,
|
19
|
+
.flex-control-nav,
|
20
|
+
.flex-direction-nav {margin: 0; padding: 0; list-style: none;}
|
21
|
+
|
22
|
+
/* FlexSlider Necessary Styles
|
23
|
+
*********************************/
|
24
|
+
.flexslider {margin: 0; padding: 0;}
|
25
|
+
.flexslider .slides > li {display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */
|
26
|
+
.flexslider .slides img {width: 100%; display: block;}
|
27
|
+
.flex-pauseplay span {text-transform: capitalize;}
|
28
|
+
|
29
|
+
/* Clearfix for the .slides element */
|
30
|
+
.slides:after {content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
|
31
|
+
html[xmlns] .slides {display: block;}
|
32
|
+
* html .slides {height: 1%;}
|
33
|
+
|
34
|
+
/* No JavaScript Fallback */
|
35
|
+
/* If you are not using another script, such as Modernizr, make sure you
|
36
|
+
* include js that eliminates this class on page load */
|
37
|
+
.no-js .slides > li:first-child {display: block;}
|
38
|
+
|
39
|
+
|
40
|
+
/* FlexSlider Default Theme
|
41
|
+
*********************************/
|
42
|
+
.flexslider {margin: 0 0 60px; background: #fff; border: 4px solid #fff; position: relative; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.2); zoom: 1;}
|
43
|
+
.flex-viewport {max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease;}
|
44
|
+
.loading .flex-viewport {max-height: 300px;}
|
45
|
+
.flexslider .slides {zoom: 1;}
|
46
|
+
|
47
|
+
.carousel li {margin-right: 5px}
|
48
|
+
|
49
|
+
|
50
|
+
/* Direction Nav */
|
51
|
+
.flex-direction-nav a {width: 30px; height: 30px; margin: -20px 0 0; display: block; background: url(images/bg_direction_nav.png) no-repeat 0 0; position: absolute; top: 50%; cursor: pointer; text-indent: -9999px; opacity: 0; -webkit-transition: all .3s ease;}
|
52
|
+
.flex-direction-nav .flex-next {background-position: 100% 0; right: -36px; }
|
53
|
+
.flex-direction-nav .flex-prev {left: -36px;}
|
54
|
+
.flexslider:hover .flex-next {opacity: 0.8; right: 5px;}
|
55
|
+
.flexslider:hover .flex-prev {opacity: 0.8; left: 5px;}
|
56
|
+
.flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover {opacity: 1;}
|
57
|
+
.flex-direction-nav .disabled {opacity: .3!important; filter:alpha(opacity=30); cursor: default;}
|
58
|
+
|
59
|
+
/* Control Nav */
|
60
|
+
.flex-control-nav {width: 100%; position: absolute; bottom: -40px; text-align: center;}
|
61
|
+
.flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline;}
|
62
|
+
.flex-control-paging li a {width: 11px; height: 11px; display: block; background: #666; background: rgba(0,0,0,0.5); cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; box-shadow: inset 0 0 3px rgba(0,0,0,0.3);}
|
63
|
+
.flex-control-paging li a:hover { background: #333; background: rgba(0,0,0,0.7); }
|
64
|
+
.flex-control-paging li a.flex-active { background: #000; background: rgba(0,0,0,0.9); cursor: default; }
|
65
|
+
|
66
|
+
.flex-control-thumbs {margin: 5px 0 0; position: static; overflow: hidden;}
|
67
|
+
.flex-control-thumbs li {width: 25%; float: left; margin: 0;}
|
68
|
+
.flex-control-thumbs img {width: 100%; display: block; opacity: .7; cursor: pointer;}
|
69
|
+
.flex-control-thumbs img:hover {opacity: 1;}
|
70
|
+
.flex-control-thumbs .active {opacity: 1; cursor: default;}
|
71
|
+
|
72
|
+
@media screen and (max-width: 860px) {
|
73
|
+
.flex-direction-nav .flex-prev {opacity: 1; left: 0;}
|
74
|
+
.flex-direction-nav .flex-next {opacity: 1; right: 0;}
|
75
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SpreeHomePageFeatures
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
def add_javascripts
|
6
|
+
append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_home_page_features\n"
|
7
|
+
append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_home_page_features\n"
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_stylesheets
|
11
|
+
inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_home_page_features\n", :before => /\*\//, :verbose => true
|
12
|
+
inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_home_page_features\n", :before => /\*\//, :verbose => true
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_migrations
|
16
|
+
run 'bundle exec rake railties:install:migrations FROM=spree_home_page_features'
|
17
|
+
end
|
18
|
+
|
19
|
+
def run_migrations
|
20
|
+
res = ask 'Would you like to run the migrations now? [Y/n]'
|
21
|
+
if res == '' || res.downcase == 'y'
|
22
|
+
run 'bundle exec rake db:migrate'
|
23
|
+
else
|
24
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module SpreeHomePageFeatures
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name 'spree_home_page_features'
|
6
|
+
|
7
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
8
|
+
|
9
|
+
# use rspec for tests
|
10
|
+
config.generators do |g|
|
11
|
+
g.test_framework :rspec
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.activate
|
15
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
16
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
config.to_prepare &method(:activate).to_proc
|
21
|
+
end
|
22
|
+
end
|
data/script/rails
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
2
|
+
|
3
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
4
|
+
ENGINE_PATH = File.expand_path('../../lib/spree_home_page_features/engine', __FILE__)
|
5
|
+
|
6
|
+
require 'rails/all'
|
7
|
+
require 'rails/engine/commands'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV['RAILS_ENV'] = 'test'
|
3
|
+
|
4
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
|
+
|
6
|
+
require 'rspec/rails'
|
7
|
+
require 'ffaker'
|
8
|
+
|
9
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
10
|
+
# in spec/support/ and its subdirectories.
|
11
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
12
|
+
|
13
|
+
# Requires factories defined in spree_core
|
14
|
+
require 'spree/core/testing_support/factories'
|
15
|
+
require 'spree/core/url_helpers'
|
16
|
+
|
17
|
+
RSpec.configure do |config|
|
18
|
+
config.include FactoryGirl::Syntax::Methods
|
19
|
+
|
20
|
+
# == URL Helpers
|
21
|
+
#
|
22
|
+
# Allows access to Spree's routes in specs:
|
23
|
+
#
|
24
|
+
# visit spree.admin_path
|
25
|
+
# current_path.should eql(spree.products_path)
|
26
|
+
config.include Spree::Core::UrlHelpers
|
27
|
+
|
28
|
+
# == Mock Framework
|
29
|
+
#
|
30
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
31
|
+
#
|
32
|
+
# config.mock_with :mocha
|
33
|
+
# config.mock_with :flexmock
|
34
|
+
# config.mock_with :rr
|
35
|
+
config.mock_with :rspec
|
36
|
+
|
37
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
38
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
39
|
+
|
40
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
41
|
+
# examples within a transaction, remove the following line or assign false
|
42
|
+
# instead of true.
|
43
|
+
config.use_transactional_fixtures = true
|
44
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
4
|
+
s.name = 'spree_home_page_features'
|
5
|
+
s.version = '1.1.3'
|
6
|
+
s.summary = 'Adds feature articles to the spree home page'
|
7
|
+
s.description = 'Allows you to edit articles in the spree admin, which will be displayed on your homepage'
|
8
|
+
s.required_ruby_version = '>= 1.9.2'
|
9
|
+
|
10
|
+
s.author = 'Robert Oles'
|
11
|
+
s.email = 'robertoles@me.com'
|
12
|
+
s.homepage = 'http://www.lockside.co.uk'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.require_path = 'lib'
|
19
|
+
s.requirements << 'none'
|
20
|
+
|
21
|
+
s.add_dependency 'spree_core', '~> 1.1.3'
|
22
|
+
|
23
|
+
s.add_development_dependency 'capybara', '1.0.1'
|
24
|
+
s.add_development_dependency 'factory_girl', '~> 2.6.4'
|
25
|
+
s.add_development_dependency 'ffaker'
|
26
|
+
s.add_development_dependency 'rspec-rails', '~> 2.9'
|
27
|
+
s.add_development_dependency 'sqlite3'
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spree_home_page_features
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Robert Oles
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-04 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: spree_core
|
16
|
+
requirement: &70143161249460 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.1.3
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70143161249460
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: capybara
|
27
|
+
requirement: &70143161247780 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - =
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.0.1
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70143161247780
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: factory_girl
|
38
|
+
requirement: &70143161245760 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.6.4
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70143161245760
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: ffaker
|
49
|
+
requirement: &70143161243720 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70143161243720
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rspec-rails
|
60
|
+
requirement: &70143161242500 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '2.9'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70143161242500
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3
|
71
|
+
requirement: &70143161240980 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70143161240980
|
80
|
+
description: Allows you to edit articles in the spree admin, which will be displayed
|
81
|
+
on your homepage
|
82
|
+
email: robertoles@me.com
|
83
|
+
executables: []
|
84
|
+
extensions: []
|
85
|
+
extra_rdoc_files: []
|
86
|
+
files:
|
87
|
+
- .gitignore
|
88
|
+
- .rspec
|
89
|
+
- Gemfile
|
90
|
+
- LICENSE
|
91
|
+
- README.md
|
92
|
+
- Rakefile
|
93
|
+
- Versionfile
|
94
|
+
- app/assets/javascripts/admin/spree_home_page_features.js
|
95
|
+
- app/assets/javascripts/store/spree_home_page_features.js.coffee
|
96
|
+
- app/assets/stylesheets/admin/spree_home_page_features.css
|
97
|
+
- app/assets/stylesheets/store/spree_home_page_features.css
|
98
|
+
- app/controllers/spree/admin/home_page_features_controller.rb
|
99
|
+
- app/models/spree/home_page_feature.rb
|
100
|
+
- app/overrides/admin/add_home_page_features_tab.rb
|
101
|
+
- app/overrides/display_on_homepage.rb
|
102
|
+
- app/views/spree/admin/home_page_features/_form.erb
|
103
|
+
- app/views/spree/admin/home_page_features/_tab.erb
|
104
|
+
- app/views/spree/admin/home_page_features/edit.html.erb
|
105
|
+
- app/views/spree/admin/home_page_features/index.html.erb
|
106
|
+
- app/views/spree/admin/home_page_features/new.html.erb
|
107
|
+
- app/views/spree/home_page_features/_features.erb
|
108
|
+
- config/locales/en.yml
|
109
|
+
- config/routes.rb
|
110
|
+
- db/migrate/20120711073050_create_home_page_features.rb
|
111
|
+
- lib/assets/javascripts/jquery.flexslider-min.js
|
112
|
+
- lib/assets/stylesheets/flexslider.css
|
113
|
+
- lib/generators/spree_home_page_features/install/install_generator.rb
|
114
|
+
- lib/spree_home_page_features.rb
|
115
|
+
- lib/spree_home_page_features/engine.rb
|
116
|
+
- script/rails
|
117
|
+
- spec/spec_helper.rb
|
118
|
+
- spree_home_page_features.gemspec
|
119
|
+
homepage: http://www.lockside.co.uk
|
120
|
+
licenses: []
|
121
|
+
post_install_message:
|
122
|
+
rdoc_options: []
|
123
|
+
require_paths:
|
124
|
+
- lib
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
none: false
|
127
|
+
requirements:
|
128
|
+
- - ! '>='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 1.9.2
|
131
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
requirements:
|
138
|
+
- none
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 1.8.11
|
141
|
+
signing_key:
|
142
|
+
specification_version: 3
|
143
|
+
summary: Adds feature articles to the spree home page
|
144
|
+
test_files:
|
145
|
+
- spec/spec_helper.rb
|