spree_maker_variants 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -0
- data/.rspec +1 -0
- data/Gemfile +6 -0
- data/LICENSE +26 -0
- data/README.ja.md +60 -0
- data/README.md +62 -0
- data/Rakefile +15 -0
- data/app/assets/javascripts/admin/spree_maker_variants.js +1 -0
- data/app/assets/javascripts/store/spree_maker_variants.js +1 -0
- data/app/assets/stylesheets/admin/spree_maker_variants.css +3 -0
- data/app/assets/stylesheets/store/spree_maker_variants.css +3 -0
- data/app/controllers/spree/admin/add_on_maker_variants_controller.rb +99 -0
- data/app/controllers/spree/admin/products_controller_decorator.rb +6 -0
- data/app/controllers/spree/admin/variants_controller_decorator.rb +14 -0
- data/app/helpers/spree/admin/products_helper_decorator.rb +12 -0
- data/app/models/spree/ability_decorator.rb +11 -0
- data/app/models/spree/add_on_maker_variant.rb +20 -0
- data/app/models/spree/product_decorator.rb +9 -0
- data/app/models/spree/variant_decorator.rb +21 -0
- data/app/overrides/add_add_on_maker_variant_to_product_menu.rb +9 -0
- data/app/views/spree/admin/add_on_maker_variants/edit.html.erb +72 -0
- data/app/views/spree/admin/add_on_maker_variants/index.html.erb +46 -0
- data/app/views/spree/admin/add_on_maker_variants/new.html.erb +69 -0
- data/bin/rails +7 -0
- data/config/locales/en.yml +21 -0
- data/config/locales/ja.yml +21 -0
- data/config/routes.rb +12 -0
- data/db/migrate/20140414063316_create_spree_maker_variants.rb +14 -0
- data/lib/generators/spree_maker_variants/install/install_generator.rb +31 -0
- data/lib/spree_maker_variants.rb +2 -0
- data/lib/spree_maker_variants/engine.rb +22 -0
- data/lib/spree_maker_variants/factories.rb +6 -0
- data/spec/spec_helper.rb +82 -0
- data/spree_maker_variants.gemspec +33 -0
- metadata +289 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) 2014 [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.ja.md
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
SpreeMakerVariants
|
2
|
+
==================
|
3
|
+
|
4
|
+
Purpose
|
5
|
+
-------
|
6
|
+
* 管理者はメーカーのバリアント情報を管理することができます。
|
7
|
+
* 項目 : "JANコード", "定価", "定価の通貨単位", "最低販売価格","最低販売価格の通貨単位","販売終了"
|
8
|
+
* これらの入出力データはショップ側には影響しません。
|
9
|
+
|
10
|
+
製品のサイドメニューへのリンク「メーカー別情報」表示
|
11
|
+
![MakerVariants](https://raw.githubusercontent.com/wiki/digitalm/spree_maker_variants/images/makervariants1.jpg)
|
12
|
+
|
13
|
+
「メーカー別情報」 - edit(種類を選択)
|
14
|
+
![MakerVariants](https://raw.githubusercontent.com/wiki/digitalm/spree_maker_variants/images/makervariants2.jpg)
|
15
|
+
|
16
|
+
メーカー別情報の管理
|
17
|
+
![MakerVariants](https://raw.githubusercontent.com/wiki/digitalm/spree_maker_variants/images/makervariants3.jpg)
|
18
|
+
|
19
|
+
依存関係
|
20
|
+
------------
|
21
|
+
* [spree_add_on_menu](https://github.com/digitalm/spree_add_on_menu)
|
22
|
+
* [spree_maker_search](https://github.com/digitalm/spree_maker_search)
|
23
|
+
|
24
|
+
Installation
|
25
|
+
------------
|
26
|
+
|
27
|
+
Add spree_maker_variants to your Gemfile:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
gem 'spree_maker_variants'
|
31
|
+
```
|
32
|
+
|
33
|
+
Bundle your dependencies and run the installation generator:
|
34
|
+
|
35
|
+
```shell
|
36
|
+
bundle
|
37
|
+
bundle exec rails g spree_add_on_menu:instal
|
38
|
+
bundle exec rails g spree_maker_search:instal
|
39
|
+
bundle exec rails g spree_maker_variants:install
|
40
|
+
```
|
41
|
+
|
42
|
+
Testing
|
43
|
+
-------
|
44
|
+
|
45
|
+
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
|
46
|
+
|
47
|
+
```shell
|
48
|
+
bundle
|
49
|
+
bundle exec rake test_app
|
50
|
+
bundle exec rspec spec
|
51
|
+
```
|
52
|
+
|
53
|
+
When testing your applications integration with this extension you may use it's factories.
|
54
|
+
Simply add this require statement to your spec_helper:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
require 'spree_maker_variants/factories'
|
58
|
+
```
|
59
|
+
|
60
|
+
Copyright (c) 2014 [Exsight.inc](http://www.exsight.co.jp/) , released under the New BSD License
|
data/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
SpreeMakerVariants
|
2
|
+
==================
|
3
|
+
|
4
|
+
Purpose
|
5
|
+
-------
|
6
|
+
* Admin can enable Maker Variant informations.
|
7
|
+
* Items are : "Article Number", "Maker Price" and currency, "Minimum Selling Price" and currency, "Discontinued"
|
8
|
+
* Nothing does not affect storefront.
|
9
|
+
|
10
|
+
Appears link "MAKER VARIANT" to Product side menu.
|
11
|
+
![MakerVariants](https://raw.githubusercontent.com/wiki/digitalm/spree_maker_variants/images/makervariants1.jpg)
|
12
|
+
|
13
|
+
"MAKER VARIANT" show variant list. Select particular variant and edit
|
14
|
+
![MakerVariants](https://raw.githubusercontent.com/wiki/digitalm/spree_maker_variants/images/makervariants2.jpg)
|
15
|
+
|
16
|
+
Enable to manage.
|
17
|
+
![MakerVariants](https://raw.githubusercontent.com/wiki/digitalm/spree_maker_variants/images/makervariants3.jpg)
|
18
|
+
|
19
|
+
Dependency
|
20
|
+
------------
|
21
|
+
It needs
|
22
|
+
* [spree_add_on_menu](https://github.com/digitalm/spree_add_on_menu) for admin menu tab expanding
|
23
|
+
* [spree_maker_search](https://github.com/digitalm/spree_maker_search) for maker list managing
|
24
|
+
Is there anyone who dont wants maker search?
|
25
|
+
|
26
|
+
Installation
|
27
|
+
------------
|
28
|
+
|
29
|
+
Add spree_maker_variants to your Gemfile:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
gem 'spree_maker_variants'
|
33
|
+
```
|
34
|
+
|
35
|
+
Bundle your dependencies and run the installation generator:
|
36
|
+
|
37
|
+
```shell
|
38
|
+
bundle
|
39
|
+
bundle exec rails g spree_add_on_menu:instal
|
40
|
+
bundle exec rails g spree_maker_search:instal
|
41
|
+
bundle exec rails g spree_maker_variants:install
|
42
|
+
```
|
43
|
+
|
44
|
+
Testing
|
45
|
+
-------
|
46
|
+
|
47
|
+
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
|
48
|
+
|
49
|
+
```shell
|
50
|
+
bundle
|
51
|
+
bundle exec rake test_app
|
52
|
+
bundle exec rspec spec
|
53
|
+
```
|
54
|
+
|
55
|
+
When testing your applications integration with this extension you may use it's factories.
|
56
|
+
Simply add this require statement to your spec_helper:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
require 'spree_maker_variants/factories'
|
60
|
+
```
|
61
|
+
|
62
|
+
Copyright (c) 2014 [Exsight.inc](http://www.exsight.co.jp/) , released under the New BSD License
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'spree/testing_support/extension_rake'
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new
|
8
|
+
|
9
|
+
task :default => [:spec]
|
10
|
+
|
11
|
+
desc 'Generates a dummy app for testing'
|
12
|
+
task :test_app do
|
13
|
+
ENV['LIB_NAME'] = 'spree_maker_variants'
|
14
|
+
Rake::Task['extension:test_app'].invoke
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require admin/spree_backend
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require store/spree_frontend
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
class AddOnMakerVariantsController < ResourceController
|
4
|
+
before_filter :load_data, :except => [:index]
|
5
|
+
|
6
|
+
def show
|
7
|
+
session[:return_to] ||= request.referer
|
8
|
+
redirect_to( :action => :edit )
|
9
|
+
end
|
10
|
+
|
11
|
+
def index
|
12
|
+
session[:return_to] = request.url
|
13
|
+
@product = Spree::Product.where(:permalink => params[:product_id]).includes(:add_on_makers).first
|
14
|
+
|
15
|
+
if @product.has_variants?
|
16
|
+
@variant = @product.variants
|
17
|
+
else
|
18
|
+
@variant = Spree::Variant.where(:id => @product.master.id)
|
19
|
+
end
|
20
|
+
|
21
|
+
@add_on_maker_variant = Spree::AddOnMakerVariant.where(:variant_id => @variant).page(params[:page])
|
22
|
+
render :index
|
23
|
+
end
|
24
|
+
|
25
|
+
def edit
|
26
|
+
session[:return_to] = request.url
|
27
|
+
@product = Spree::Product.find_by_permalink!(params[:product_id])
|
28
|
+
@add_on_maker_variant = Spree::AddOnMakerVariant.where(:variant_id => params[:variant_id]).first_or_initialize
|
29
|
+
render :edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def create
|
33
|
+
@add_on_maker_variant = Spree::AddOnMakerVariant.new(add_on_maker_variant_params.merge(:variant_id => params[:variant_id]))
|
34
|
+
respond_to do |format|
|
35
|
+
if @add_on_maker_variant.save
|
36
|
+
flash[:success] = t('add_on.notice_messages.admin_product_variant_add_on_maker_variant_created')
|
37
|
+
format.html { redirect_to admin_product_variant_add_on_maker_variants_path }
|
38
|
+
format.json { render action: 'index', status: :created, location: @add_on_maker_variant }
|
39
|
+
else
|
40
|
+
flash[:error] = t('add_on.notice_messages.admin_product_variant_add_on_maker_variant_has_error')
|
41
|
+
format.html { render action: 'new' }
|
42
|
+
format.json { render json: @add_on_maker_variant.errors }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def update
|
48
|
+
respond_to do |format|
|
49
|
+
if @add_on_maker_variant.update(add_on_maker_variant_params)
|
50
|
+
flash[:success] = t('add_on.notice_messages.admin_product_variant_add_on_maker_variant_updated')
|
51
|
+
format.html { redirect_to :action => :index }
|
52
|
+
format.json { head :no_content }
|
53
|
+
else
|
54
|
+
flash[:error] = t('add_on.notice_messages.admin_product_variant_add_on_maker_variant_has_error')
|
55
|
+
format.html { render action: 'edit' }
|
56
|
+
format.json { render json: @add_on_maker_variant.errors }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def destroy
|
62
|
+
@variant = Spree::Variant.find(params[:id])
|
63
|
+
if @variant.destroy
|
64
|
+
flash[:success] = Spree.t('notice_messages.variant_deleted')
|
65
|
+
else
|
66
|
+
flash[:success] = Spree.t('notice_messages.variant_not_deleted')
|
67
|
+
end
|
68
|
+
|
69
|
+
respond_with(@variant) do |format|
|
70
|
+
format.html { redirect_to admin_product_maker_variant_path(params[:product_id]) }
|
71
|
+
format.js { render_js_for_destroy }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
protected
|
76
|
+
def variant_includes
|
77
|
+
[:add_on_maker_variants]
|
78
|
+
end
|
79
|
+
|
80
|
+
def load_data
|
81
|
+
@product = Spree::Product.find_by_permalink!(params[:product_id])
|
82
|
+
@taxons = Taxon.order(:name)
|
83
|
+
@option_types = OptionType.order(:name)
|
84
|
+
@tax_categories = TaxCategory.order(:name)
|
85
|
+
@shipping_categories = ShippingCategory.order(:name)
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
def permit_attributes
|
90
|
+
params.require(:add_on_maker_variant).permit!
|
91
|
+
end
|
92
|
+
|
93
|
+
def add_on_maker_variant_params
|
94
|
+
params.require(:add_on_maker_variant).permit(:article_number, :list_price_amount, :list_price_currency, :min_price_amount, :min_price_currency, :is_discontinued)
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Spree::Admin::ProductsController.class_eval do
|
2
|
+
private
|
3
|
+
def product_params
|
4
|
+
params.require(:product).permit(add_on_maker_variant_attributes: [ :artice_number, :list_price_amount, :list_price_currency, :min_price_amount, :min_price_currency, :is_discontinued])
|
5
|
+
end
|
6
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Spree::Admin::VariantsController.class_eval do
|
2
|
+
before_filter :load_add_on_maker_variant, :only => :load_data
|
3
|
+
|
4
|
+
def load_add_on_maker_variant
|
5
|
+
logger.info "##load_add_on_maker_variant##"
|
6
|
+
@add_on_maker_variant = Spree::AddOnMakerVariant.where(:id => params[:id]).first
|
7
|
+
logger.info @add_on_maker_variant
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
def variant_params
|
12
|
+
params.require(:variant).permit(add_on_maker_variant_attributes: [ :artice_number, :list_price_amount, :list_price_currency, :min_price_amount, :min_price_currency, :is_discontinued])
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Spree::Admin::ProductsHelper.class_eval do
|
2
|
+
def add_on_makers_options_for(product)
|
3
|
+
options = @add_on_makers.map do |add_on_maker|
|
4
|
+
selected = product.add_on_makers.include?(add_on_maker)
|
5
|
+
content_tag(:option,
|
6
|
+
:value => add_on_maker.id,
|
7
|
+
:selected => ('selected' if selected)) do
|
8
|
+
add_on_maker.name
|
9
|
+
end
|
10
|
+
end.join("").html_safe
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AbilityDecorator
|
2
|
+
include CanCan::Ability
|
3
|
+
def initialize(user)
|
4
|
+
|
5
|
+
if user.respond_to?(:has_spree_role?) && user.has_spree_role?('admin')
|
6
|
+
can [:admin, :index, :read, :update, :edit], Spree::AddOnMakerVariant
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Spree::Ability.register_ability(AbilityDecorator)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Spree
|
2
|
+
class AddOnMakerVariant < ActiveRecord::Base
|
3
|
+
belongs_to :variant, class_name: 'Spree::Variant', :foreign_key => :variant_id
|
4
|
+
belongs_to :product, class_name: 'Spree::Product'
|
5
|
+
after_initialize :set_defaut_value
|
6
|
+
|
7
|
+
validates :article_number, length: {maximum: 13}, allow_nil: true
|
8
|
+
|
9
|
+
|
10
|
+
validates :list_price_amount, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true
|
11
|
+
validates :min_price_amount, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true
|
12
|
+
|
13
|
+
private
|
14
|
+
def set_defaut_value
|
15
|
+
self.list_price_currency = Spree::Config[:currency] if self.new_record?
|
16
|
+
self.min_price_currency = Spree::Config[:currency] if self.new_record?
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Spree
|
2
|
+
Product.class_eval do
|
3
|
+
has_many :add_on_maker_variants, :through => :variants
|
4
|
+
|
5
|
+
# enable products to CRUD each own add_on_maker_variants by accept nesting as child
|
6
|
+
accepts_nested_attributes_for :add_on_maker_variants, allow_destroy: true
|
7
|
+
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Spree
|
2
|
+
Variant.class_eval do
|
3
|
+
has_one :add_on_maker_variant, class_name: 'Spree::AddOnMakerVariant'
|
4
|
+
|
5
|
+
# builds add_on_maker_variants from created variant ids
|
6
|
+
after_create :create_add_on_maker_variants_from_variants
|
7
|
+
|
8
|
+
# enable variants to CRUD each own add_on_maker_variants by accept nesting as child
|
9
|
+
accepts_nested_attributes_for :add_on_maker_variant, allow_destroy: true
|
10
|
+
|
11
|
+
def create_add_on_maker_variants_from_variants
|
12
|
+
Spree::AddOnMakerVariant.where(variant_id: self.id).first_or_initialize do |a|
|
13
|
+
a.variant_id = self.id
|
14
|
+
a.list_price_currency = Spree::Config[:currency] if a.list_price_currency.blank?
|
15
|
+
a.min_price_currency = Spree::Config[:currency] if a.min_price_currency.blank?
|
16
|
+
a.save!
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Deface::Override.new(:virtual_path => 'spree/admin/shared/_product_tabs',
|
2
|
+
:name => 'add_add_on_maker_variant_to_product_menu',
|
3
|
+
:insert_bottom => "[data-hook='admin_product_tabs']",
|
4
|
+
:text => "
|
5
|
+
<%= content_tag :li, :class => ('active' if current == 'Add On Maker Variants') do %>
|
6
|
+
<%= link_to_with_icon 'icon-edit', t('add_on.add_on_maker_variant'), admin_product_add_on_maker_variants_path(@product) %>
|
7
|
+
<% end if can?(:admin, Spree::AddOnMakerVariant) %>
|
8
|
+
|
9
|
+
")
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
2
|
+
|
3
|
+
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => {:current => 'Add On Maker Variants'} %>
|
4
|
+
|
5
|
+
<% content_for :page_title do %>
|
6
|
+
: <%= @add_on_maker_variant.variant.sku %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% content_for :page_actions do %>
|
10
|
+
<li>
|
11
|
+
<%= button_link_to t('add_on.back_to_product_add_on_maker_variants_list'), admin_product_variant_add_on_maker_variants_path, :icon => 'icon-arrow-left' %>
|
12
|
+
</li>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= form_for [:admin, @product, @variant, @add_on_maker_variant], url: admin_product_variant_add_on_maker_variant_path(:variant_id => params[:variant_id], :id => params[:id]) do |f| %>
|
16
|
+
<div data-hook="admin_inside_add_on_maker_variant_form" class="row">
|
17
|
+
<div class='alpha six columns'>
|
18
|
+
|
19
|
+
<%= f.field_container :article_number do %>
|
20
|
+
<%= f.label :article_number, t('activerecord.attributes.add_on_maker_variant.article_number') %>
|
21
|
+
<%= f.text_field :article_number, :class => 'fullwidth', :autofocus => true %>
|
22
|
+
<%= f.error_message_on :article_number %>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
|
26
|
+
<div class="alpha three columns">
|
27
|
+
<%= f.field_container :list_price_amount do %>
|
28
|
+
<%= f.label :list_price_amount, t('activerecord.attributes.add_on_maker_variant.list_price_amount') %>
|
29
|
+
<%= f.text_field :list_price_amount, :class => 'fullwidth' %>
|
30
|
+
<%= f.error_message_on :list_price_amount %>
|
31
|
+
<% end %>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="omega three columns">
|
35
|
+
<%= f.field_container :list_price_currency do %>
|
36
|
+
<%= f.label :list_price_currency, t('activerecord.attributes.add_on_maker_variant.list_price_currency') %>
|
37
|
+
<%= f.text_field :list_price_currency, :class => 'fullwidth' %>
|
38
|
+
<%= f.error_message_on :list_price_currency %>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div class="alpha three columns">
|
43
|
+
<%= f.field_container :min_price_amount do %>
|
44
|
+
<%= f.label :min_price_amount, t('activerecord.attributes.add_on_maker_variant.min_price_amount') %>
|
45
|
+
<%= f.text_field :min_price_amount, :class => 'fullwidth' %>
|
46
|
+
<%= f.error_message_on :min_price_amount %>
|
47
|
+
<% end %>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div class="omega three columns">
|
51
|
+
<%= f.field_container :min_price_currency do %>
|
52
|
+
<%= f.label :min_price_currency, t('activerecord.attributes.add_on_maker_variant.min_price_currency') %>
|
53
|
+
<%= f.text_field :min_price_currency, :class => 'fullwidth' %>
|
54
|
+
<%= f.error_message_on :min_price_currency %>
|
55
|
+
<% end %>
|
56
|
+
</div>
|
57
|
+
<div class="clear"></div>
|
58
|
+
</div>
|
59
|
+
<div class='omega six columns'>
|
60
|
+
<%= f.field_container :is_discontinued do %>
|
61
|
+
<%= f.label :is_discontinued, t('activerecord.attributes.add_on_maker_variant.is_discontinued') %>
|
62
|
+
<%= f.check_box :is_discontinued, :class => 'fullwidth' %>
|
63
|
+
<%= f.error_message_on :is_discontinued %>
|
64
|
+
<% end %>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
|
69
|
+
<%= f.submit %>
|
70
|
+
|
71
|
+
</div>
|
72
|
+
<% end %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
2
|
+
|
3
|
+
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => {:current => 'Add On Maker Variants'} %>
|
4
|
+
|
5
|
+
<% content_for :page_title do %>
|
6
|
+
<%= t("add_on.listing_add_on_maker_variant") %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% if @product.add_on_makers.blank? %>
|
10
|
+
|
11
|
+
<%= t("add_on.this_product_does_not_have_any_add_on_maker") %><br>
|
12
|
+
<%= link_to t("add_on.please_set_add_on_maker_to_product"), edit_admin_product_path(:id => params[:product_id]) %>
|
13
|
+
|
14
|
+
<% else %>
|
15
|
+
|
16
|
+
<%= paginate @add_on_maker_variant %>
|
17
|
+
|
18
|
+
<table class='index'>
|
19
|
+
<thead>
|
20
|
+
<tr>
|
21
|
+
<th><%= t("activerecord.attributes.variant.id") %></th>
|
22
|
+
<th><%= Spree.t(:options) %></th>
|
23
|
+
<th><%= Spree.t(:price) %></th>
|
24
|
+
<th><%= Spree.t(:sku) %></th>
|
25
|
+
</tr>
|
26
|
+
</thead>
|
27
|
+
|
28
|
+
<tbody>
|
29
|
+
<% for variant in @variant %>
|
30
|
+
<tr class="<%= cycle('odd', 'even') %>">
|
31
|
+
<td class="align-center"><%= variant.id %></td>
|
32
|
+
<td class="align-center"><%= variant.options_text %></td>
|
33
|
+
<td class="align-center"><%= variant.price %></td>
|
34
|
+
<td class="align-center"><%= variant.sku %></td>
|
35
|
+
|
36
|
+
<% if variant.add_on_maker_variant.blank? %>
|
37
|
+
<td class="actions"><%= link_to t("edit"), ("/admin/products/" + params[:product_id] + "/variants/#{variant.id}/add_on_maker_variants/new") , :class => 'edit' %></td>
|
38
|
+
<% else %>
|
39
|
+
<td class="actions"><%= link_to t("edit"), ("/admin/products/" + params[:product_id] + "/variants/#{variant.id}/add_on_maker_variants/#{variant.add_on_maker_variant.id}/edit") , :class => 'edit' %></td>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
</tr>
|
43
|
+
<% end %>
|
44
|
+
</tbody>
|
45
|
+
</table>
|
46
|
+
<% end %>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
2
|
+
|
3
|
+
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => {:current => 'Add On Maker Variants'} %><% content_for :page_title do %>
|
4
|
+
<%= t('add_on.add_on_maker_variant') %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<% content_for :page_actions do %>
|
8
|
+
<li>
|
9
|
+
<%= button_link_to t('add_on.back_to_product_add_on_maker_variants_list'), admin_product_add_on_maker_variants_path, :icon => 'icon-arrow-left' %>
|
10
|
+
</li>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= form_for [:admin, @product, @variant, @add_on_maker_variant], url: admin_product_variant_add_on_maker_variants_path(:variant_id => params[:variant_id]) do |f| %>
|
14
|
+
<div data-hook="admin_inside_add_on_maker_variant_form" class="row">
|
15
|
+
<div class='alpha six columns'>
|
16
|
+
<%= f.field_container :article_number do %>
|
17
|
+
<%= f.label :article_number, t('activerecord.attributes.add_on_maker_variant.article_number') %>
|
18
|
+
<%= f.text_field :article_number, :class => 'fullwidth', :autofocus => true %>
|
19
|
+
<%= f.error_message_on :article_number %>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
|
23
|
+
<div class="alpha three columns">
|
24
|
+
<%= f.field_container :list_price_amount do %>
|
25
|
+
<%= f.label :list_price_amount, t('activerecord.attributes.add_on_maker_variant.list_price_amount') %>
|
26
|
+
<%= f.text_field :list_price_amount, :class => 'fullwidth' %>
|
27
|
+
<%= f.error_message_on :list_price_amount %>
|
28
|
+
<% end %>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="omega three columns">
|
32
|
+
<%= f.field_container :list_price_currency do %>
|
33
|
+
<%= f.label :list_price_currency, t('activerecord.attributes.add_on_maker_variant.list_price_currency') %>
|
34
|
+
<%= f.text_field :list_price_currency, :class => 'fullwidth' %>
|
35
|
+
<%= f.error_message_on :list_price_currency %>
|
36
|
+
<% end %>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="alpha three columns">
|
41
|
+
<%= f.field_container :min_price_amount do %>
|
42
|
+
<%= f.label :min_price_amount, t('activerecord.attributes.add_on_maker_variant.min_price_amount') %>
|
43
|
+
<%= f.text_field :min_price_amount, :class => 'fullwidth' %>
|
44
|
+
<%= f.error_message_on :min_price_amount %>
|
45
|
+
<% end %>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<div class="omega three columns">
|
49
|
+
<%= f.field_container :min_price_currency do %>
|
50
|
+
<%= f.label :min_price_currency, t('activerecord.attributes.add_on_maker_variant.min_price_currency') %>
|
51
|
+
<%= f.text_field :min_price_currency, :class => 'fullwidth' %>
|
52
|
+
<%= f.error_message_on :min_price_currency %>
|
53
|
+
<% end %>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
<div class='omega six columns'>
|
58
|
+
<%= f.field_container :is_discontinued do %>
|
59
|
+
<%= f.label :is_discontinued, t('activerecord.attributes.add_on_maker_variant.is_discontinued') %>
|
60
|
+
<%= f.check_box :is_discontinued, :class => 'fullwidth' %>
|
61
|
+
<%= f.error_message_on :is_discontinued %>
|
62
|
+
<% end %>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<%= f.submit %>
|
67
|
+
|
68
|
+
</div>
|
69
|
+
<% end %>
|
data/bin/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_maker_variants/engine', __FILE__)
|
5
|
+
|
6
|
+
require 'rails/all'
|
7
|
+
require 'rails/engine/commands'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
en:
|
2
|
+
add_on:
|
3
|
+
add_on_maker_variant: Maker Variant
|
4
|
+
listing_add_on_maker_variant: Listing Maker Variants
|
5
|
+
back_to_add_on_maker_variants_list: Back To Maker Variants List
|
6
|
+
back_to_product_add_on_maker_variants_list: Back To Maker Variants List
|
7
|
+
this_product_does_not_have_any_add_on_maker: This product does not have any maker.
|
8
|
+
please_set_add_on_maker_to_product: Please set maker information to this product.
|
9
|
+
notice_messages:
|
10
|
+
admin_product_variant_add_on_maker_variant_created: Maker Variant has been successfully created!
|
11
|
+
admin_product_variant_add_on_maker_variant_has_error: Cannnot save for invalid data.
|
12
|
+
activerecord:
|
13
|
+
attributes:
|
14
|
+
add_on_maker_variant:
|
15
|
+
variant_id: Variant ID
|
16
|
+
article_number: Article Number
|
17
|
+
list_price_amount: List Price
|
18
|
+
list_price_currency: List Price Currency
|
19
|
+
min_price_amount: Minimum Selling Price
|
20
|
+
min_price_currency: Minimum Selling Price Currency
|
21
|
+
is_discontinued: Discontinued (Checked discontinued)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
ja:
|
2
|
+
add_on:
|
3
|
+
add_on_maker_variant: メーカー別情報
|
4
|
+
listing_add_on_maker_variant: メーカー別情報一覧
|
5
|
+
back_to_add_on_maker_variants_list: 登録済メーカー別情報一覧
|
6
|
+
back_to_product_add_on_maker_variants_list: メーカー別情報一覧へ戻る
|
7
|
+
this_product_does_not_have_any_add_on_maker: この商品に登録されているメーカーがありません
|
8
|
+
please_set_add_on_maker_to_product: メーカーを登録してください。
|
9
|
+
notice_messages:
|
10
|
+
admin_product_variant_add_on_maker_variant_created: メーカー別情報を作成しました
|
11
|
+
admin_product_variant_add_on_maker_variant_has_error: エラーが発生しました
|
12
|
+
activerecord:
|
13
|
+
attributes:
|
14
|
+
add_on_maker_variant:
|
15
|
+
variant_id: 種類 ID
|
16
|
+
article_number: JANコード
|
17
|
+
list_price_amount: 定価
|
18
|
+
list_price_currency: 定価の通貨単位
|
19
|
+
min_price_amount: 最低販売価格
|
20
|
+
min_price_currency: 最低販売価格の通貨単位
|
21
|
+
is_discontinued: 販売終了
|
data/config/routes.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Spree::Core::Engine.routes.draw do
|
2
|
+
# Add your extension routes here
|
3
|
+
namespace :admin do
|
4
|
+
resources :products do
|
5
|
+
get 'add_on_maker_variants' => 'add_on_maker_variants#index'
|
6
|
+
resources :variants do
|
7
|
+
resources :add_on_maker_variants do
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSpreeMakerVariants < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :spree_add_on_maker_variants do |t|
|
4
|
+
t.integer :variant_id
|
5
|
+
t.string :article_number, :limit => 13
|
6
|
+
t.decimal :list_price_amount, :precision => 8, :scale => 2
|
7
|
+
t.string :list_price_currency
|
8
|
+
t.decimal :min_price_amount, :precision => 8, :scale => 2
|
9
|
+
t.string :min_price_currency
|
10
|
+
t.boolean :is_discontinued, :default => false
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module SpreeMakerVariants
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
class_option :auto_run_migrations, :type => :boolean, :default => false
|
6
|
+
|
7
|
+
def add_javascripts
|
8
|
+
append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_maker_variants\n"
|
9
|
+
append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_maker_variants\n"
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_stylesheets
|
13
|
+
inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_maker_variants\n", :before => /\*\//, :verbose => true
|
14
|
+
inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_maker_variants\n", :before => /\*\//, :verbose => true
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_migrations
|
18
|
+
run 'bundle exec rake railties:install:migrations FROM=spree_maker_variants'
|
19
|
+
end
|
20
|
+
|
21
|
+
def run_migrations
|
22
|
+
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
|
23
|
+
if run_migrations
|
24
|
+
run 'bundle exec rake db:migrate'
|
25
|
+
else
|
26
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module SpreeMakerVariants
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name 'spree_maker_variants'
|
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
|
@@ -0,0 +1,6 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
|
3
|
+
#
|
4
|
+
# Example adding this to your spec_helper will load these Factories for use:
|
5
|
+
# require 'spree_maker_variants/factories'
|
6
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# Run Coverage report
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_filter 'spec/dummy'
|
5
|
+
add_group 'Controllers', 'app/controllers'
|
6
|
+
add_group 'Helpers', 'app/helpers'
|
7
|
+
add_group 'Mailers', 'app/mailers'
|
8
|
+
add_group 'Models', 'app/models'
|
9
|
+
add_group 'Views', 'app/views'
|
10
|
+
add_group 'Libraries', 'lib'
|
11
|
+
end
|
12
|
+
|
13
|
+
# Configure Rails Environment
|
14
|
+
ENV['RAILS_ENV'] = 'test'
|
15
|
+
|
16
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
17
|
+
|
18
|
+
require 'rspec/rails'
|
19
|
+
require 'database_cleaner'
|
20
|
+
require 'ffaker'
|
21
|
+
|
22
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
23
|
+
# in spec/support/ and its subdirectories.
|
24
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
25
|
+
|
26
|
+
# Requires factories defined in spree_core
|
27
|
+
require 'spree/testing_support/factories'
|
28
|
+
require 'spree/testing_support/controller_requests'
|
29
|
+
require 'spree/testing_support/authorization_helpers'
|
30
|
+
require 'spree/testing_support/url_helpers'
|
31
|
+
|
32
|
+
# Requires factories defined in lib/spree_maker_variants/factories.rb
|
33
|
+
require 'spree_maker_variants/factories'
|
34
|
+
|
35
|
+
RSpec.configure do |config|
|
36
|
+
config.include FactoryGirl::Syntax::Methods
|
37
|
+
|
38
|
+
# == URL Helpers
|
39
|
+
#
|
40
|
+
# Allows access to Spree's routes in specs:
|
41
|
+
#
|
42
|
+
# visit spree.admin_path
|
43
|
+
# current_path.should eql(spree.products_path)
|
44
|
+
config.include Spree::TestingSupport::UrlHelpers
|
45
|
+
|
46
|
+
# == Mock Framework
|
47
|
+
#
|
48
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
49
|
+
#
|
50
|
+
# config.mock_with :mocha
|
51
|
+
# config.mock_with :flexmock
|
52
|
+
# config.mock_with :rr
|
53
|
+
config.mock_with :rspec
|
54
|
+
config.color = true
|
55
|
+
|
56
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
57
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
58
|
+
|
59
|
+
# Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
|
60
|
+
# to cleanup after each test instead. Without transactional fixtures set to false the records created
|
61
|
+
# to setup a test will be unavailable to the browser, which runs under a seperate server instance.
|
62
|
+
config.use_transactional_fixtures = false
|
63
|
+
|
64
|
+
# Ensure Suite is set to use transactions for speed.
|
65
|
+
config.before :suite do
|
66
|
+
DatabaseCleaner.strategy = :transaction
|
67
|
+
DatabaseCleaner.clean_with :truncation
|
68
|
+
end
|
69
|
+
|
70
|
+
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
|
71
|
+
config.before :each do
|
72
|
+
DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
|
73
|
+
DatabaseCleaner.start
|
74
|
+
end
|
75
|
+
|
76
|
+
# After each spec clean the database.
|
77
|
+
config.after :each do
|
78
|
+
DatabaseCleaner.clean
|
79
|
+
end
|
80
|
+
|
81
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
82
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
4
|
+
s.name = 'spree_maker_variants'
|
5
|
+
s.version = '0.1.0'
|
6
|
+
s.summary = 'Spree Extension : Enable to manage maker variant informations.'
|
7
|
+
s.description = 'Admin can enable Maker Variant informations such as "Article Number", "List Price", "Minimum Selling Price", "Discontinued".'
|
8
|
+
s.required_ruby_version = '>= 1.9.3'
|
9
|
+
|
10
|
+
s.author = 'Mika Mizuno'
|
11
|
+
s.email = 'mika.mizuno@exsight.co.jp'
|
12
|
+
s.homepage = 'http://www.exsight.co.jp'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.require_path = 'lib'
|
17
|
+
s.requirements << 'none'
|
18
|
+
|
19
|
+
s.add_dependency 'spree_core', '~> 2.1.4'
|
20
|
+
s.add_dependency 'spree_add_on_menu', '~> 0.1'
|
21
|
+
s.add_dependency 'spree_maker_search', '~> 0.1'
|
22
|
+
|
23
|
+
s.add_development_dependency 'capybara', '~> 2.1'
|
24
|
+
s.add_development_dependency 'coffee-rails'
|
25
|
+
s.add_development_dependency 'database_cleaner'
|
26
|
+
s.add_development_dependency 'factory_girl', '~> 4.2'
|
27
|
+
s.add_development_dependency 'ffaker'
|
28
|
+
s.add_development_dependency 'rspec-rails', '~> 2.13'
|
29
|
+
s.add_development_dependency 'sass-rails'
|
30
|
+
s.add_development_dependency 'selenium-webdriver'
|
31
|
+
s.add_development_dependency 'simplecov'
|
32
|
+
s.add_development_dependency 'sqlite3'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,289 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spree_maker_variants
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mika Mizuno
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: spree_core
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.1.4
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.1.4
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: spree_add_on_menu
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0.1'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0.1'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: spree_maker_search
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.1'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.1'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: capybara
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.1'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '2.1'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: coffee-rails
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: database_cleaner
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: factory_girl
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '4.2'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '4.2'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: ffaker
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rspec-rails
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ~>
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '2.13'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '2.13'
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: sass-rails
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: selenium-webdriver
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
type: :development
|
183
|
+
prerelease: false
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
name: simplecov
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - ! '>='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
type: :development
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ! '>='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
name: sqlite3
|
208
|
+
requirement: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
210
|
+
requirements:
|
211
|
+
- - ! '>='
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '0'
|
214
|
+
type: :development
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
218
|
+
requirements:
|
219
|
+
- - ! '>='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
description: Admin can enable Maker Variant informations such as "Article Number",
|
223
|
+
"List Price", "Minimum Selling Price", "Discontinued".
|
224
|
+
email: mika.mizuno@exsight.co.jp
|
225
|
+
executables: []
|
226
|
+
extensions: []
|
227
|
+
extra_rdoc_files: []
|
228
|
+
files:
|
229
|
+
- .gitignore
|
230
|
+
- .rspec
|
231
|
+
- Gemfile
|
232
|
+
- LICENSE
|
233
|
+
- README.ja.md
|
234
|
+
- README.md
|
235
|
+
- Rakefile
|
236
|
+
- app/assets/javascripts/admin/spree_maker_variants.js
|
237
|
+
- app/assets/javascripts/store/spree_maker_variants.js
|
238
|
+
- app/assets/stylesheets/admin/spree_maker_variants.css
|
239
|
+
- app/assets/stylesheets/store/spree_maker_variants.css
|
240
|
+
- app/controllers/spree/admin/add_on_maker_variants_controller.rb
|
241
|
+
- app/controllers/spree/admin/products_controller_decorator.rb
|
242
|
+
- app/controllers/spree/admin/variants_controller_decorator.rb
|
243
|
+
- app/helpers/spree/admin/products_helper_decorator.rb
|
244
|
+
- app/models/spree/ability_decorator.rb
|
245
|
+
- app/models/spree/add_on_maker_variant.rb
|
246
|
+
- app/models/spree/product_decorator.rb
|
247
|
+
- app/models/spree/variant_decorator.rb
|
248
|
+
- app/overrides/add_add_on_maker_variant_to_product_menu.rb
|
249
|
+
- app/views/spree/admin/add_on_maker_variants/edit.html.erb
|
250
|
+
- app/views/spree/admin/add_on_maker_variants/index.html.erb
|
251
|
+
- app/views/spree/admin/add_on_maker_variants/new.html.erb
|
252
|
+
- bin/rails
|
253
|
+
- config/locales/en.yml
|
254
|
+
- config/locales/ja.yml
|
255
|
+
- config/routes.rb
|
256
|
+
- db/migrate/20140414063316_create_spree_maker_variants.rb
|
257
|
+
- lib/generators/spree_maker_variants/install/install_generator.rb
|
258
|
+
- lib/spree_maker_variants.rb
|
259
|
+
- lib/spree_maker_variants/engine.rb
|
260
|
+
- lib/spree_maker_variants/factories.rb
|
261
|
+
- spec/spec_helper.rb
|
262
|
+
- spree_maker_variants.gemspec
|
263
|
+
homepage: http://www.exsight.co.jp
|
264
|
+
licenses: []
|
265
|
+
post_install_message:
|
266
|
+
rdoc_options: []
|
267
|
+
require_paths:
|
268
|
+
- lib
|
269
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
270
|
+
none: false
|
271
|
+
requirements:
|
272
|
+
- - ! '>='
|
273
|
+
- !ruby/object:Gem::Version
|
274
|
+
version: 1.9.3
|
275
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
276
|
+
none: false
|
277
|
+
requirements:
|
278
|
+
- - ! '>='
|
279
|
+
- !ruby/object:Gem::Version
|
280
|
+
version: '0'
|
281
|
+
requirements:
|
282
|
+
- none
|
283
|
+
rubyforge_project:
|
284
|
+
rubygems_version: 1.8.23
|
285
|
+
signing_key:
|
286
|
+
specification_version: 3
|
287
|
+
summary: ! 'Spree Extension : Enable to manage maker variant informations.'
|
288
|
+
test_files:
|
289
|
+
- spec/spec_helper.rb
|