shoppe 1.0.5 → 1.0.6
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.
- checksums.yaml +4 -4
- data/README.md +55 -0
- data/app/assets/stylesheets/shoppe/application.scss +16 -0
- data/app/controllers/shoppe/product_categories_controller.rb +2 -2
- data/app/controllers/shoppe/products_controller.rb +2 -2
- data/app/helpers/shoppe/product_category_helper.rb +36 -0
- data/app/models/shoppe/payment.rb +14 -8
- data/app/models/shoppe/product.rb +25 -9
- data/app/models/shoppe/product_categorization.rb +14 -0
- data/app/models/shoppe/product_category.rb +49 -4
- data/app/views/shoppe/product_categories/_form.html.haml +29 -4
- data/app/views/shoppe/product_categories/index.html.haml +3 -2
- data/app/views/shoppe/products/_form.html.haml +2 -2
- data/config/locales/de.yml +650 -0
- data/config/locales/en.yml +10 -0
- data/config/locales/pl.yml +9 -0
- data/config/locales/pt-BR.yml +9 -0
- data/db/migrate/20141026181717_allow_multiple_shoppe_products_per_shoppe_product_category.rb +46 -0
- data/db/migrate/20141026181718_add_nested_to_product_categories.rb +30 -0
- data/db/schema.rb +24 -10
- data/lib/shoppe/version.rb +1 -1
- metadata +22 -2
data/config/locales/en.yml
CHANGED
@@ -387,17 +387,27 @@ en:
|
|
387
387
|
attachments: Attachments
|
388
388
|
back_to_categories: Back to categories list
|
389
389
|
category_details: Category Details
|
390
|
+
choose_product_category: Choose a product category
|
390
391
|
create_notice: Category has been created successfully
|
391
392
|
delete_confirmation: Are you sure you wish to remove this category?
|
392
393
|
description: Description
|
393
394
|
destroy_notice: Category has been removed successfully
|
395
|
+
destroy_alert: Category could not be removed
|
394
396
|
image: Image
|
395
397
|
name: Name
|
396
398
|
new_category: New category
|
397
399
|
no_categories: No categories to display.
|
398
400
|
permalink: Permalink
|
401
|
+
permalink_includes_ancestors: Prefix links in store with ancestor categories
|
399
402
|
product_categories: Product categories
|
400
403
|
update_notice: Category has been updated successfully
|
404
|
+
nesting:
|
405
|
+
blank_option: None
|
406
|
+
category_nesting: Nesting
|
407
|
+
category_parent: Parent
|
408
|
+
current_category: Current
|
409
|
+
no_children: No Children
|
410
|
+
hierarchy: Hierarchy
|
401
411
|
|
402
412
|
products:
|
403
413
|
add_attribute: Add attribute
|
data/config/locales/pl.yml
CHANGED
@@ -393,6 +393,7 @@ pl:
|
|
393
393
|
attachments: Załączniki
|
394
394
|
back_to_categories: Powrót do listy kategorii
|
395
395
|
category_details: Szczegóły kategorii
|
396
|
+
choose_product_category: Wybierz kategorię produktu
|
396
397
|
create_notice: Kategoria została utworzona
|
397
398
|
delete_confirmation: Czy na pewno usunąć kategorię?
|
398
399
|
description: Opis
|
@@ -402,8 +403,16 @@ pl:
|
|
402
403
|
new_category: Nowa kategoria
|
403
404
|
no_categories: Brak kategorii do wyświetlenia
|
404
405
|
permalink: Permalink
|
406
|
+
permalink_includes_ancestors: Prefix links in store with ancestor categories
|
405
407
|
product_categories: Kategorie produktów
|
406
408
|
update_notice: Kategoria została zaktualizowana
|
409
|
+
nesting:
|
410
|
+
blank_option: None
|
411
|
+
category_nesting: Nesting
|
412
|
+
category_parent: Parent
|
413
|
+
current_category: Current
|
414
|
+
no_children: No Children
|
415
|
+
hierarchy: Hierarchy
|
407
416
|
|
408
417
|
products:
|
409
418
|
add_attribute: Dodaj atrybut
|
data/config/locales/pt-BR.yml
CHANGED
@@ -380,6 +380,7 @@ pt-BR:
|
|
380
380
|
attachments: Anexos
|
381
381
|
back_to_categories: Voltar para a lista de categorias
|
382
382
|
category_details: Detalhes da Categoria
|
383
|
+
choose_product_category: Escolha uma categoria de produto
|
383
384
|
create_notice: A Categoria foi criada com sucesso
|
384
385
|
delete_confirmation: Você tem certeza que deseja remover esta categoria?
|
385
386
|
description: Descrição
|
@@ -389,8 +390,16 @@ pt-BR:
|
|
389
390
|
new_category: Nova categoria
|
390
391
|
no_categories: Nenhuma categoria para mostrar.
|
391
392
|
permalink: Permalink
|
393
|
+
permalink_includes_ancestors: Prefix links in store with ancestor categories
|
392
394
|
product_categories: Categorias de Produto
|
393
395
|
update_notice: A Categoria foi atualizada com sucesso
|
396
|
+
nesting:
|
397
|
+
blank_option: None
|
398
|
+
category_nesting: Nesting
|
399
|
+
category_parent: Parent
|
400
|
+
current_category: Current
|
401
|
+
no_children: No Children
|
402
|
+
hierarchy: Hierarchy
|
394
403
|
|
395
404
|
products:
|
396
405
|
add_attribute: Adicionar atributo
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class AllowMultipleShoppeProductsPerShoppeProductCategory < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
# create our join table first before we migrate
|
4
|
+
# we have an id to allow :restrict_with_exception on product_category
|
5
|
+
create_table :shoppe_product_categorizations do |t|
|
6
|
+
t.integer :product_id, null: false
|
7
|
+
t.integer :product_category_id, null: false
|
8
|
+
end
|
9
|
+
add_index :shoppe_product_categorizations, :product_id, name: 'categorization_by_product_id'
|
10
|
+
add_index :shoppe_product_categorizations, :product_category_id, name: 'categorization_by_product_category_id'
|
11
|
+
# define the old belongs_to association (as it's no longer on the model)
|
12
|
+
Shoppe::Product.class_eval do
|
13
|
+
belongs_to :old_category,
|
14
|
+
:class_name => "Shoppe::ProductCategory",
|
15
|
+
:foreign_key => "product_category_id"
|
16
|
+
end
|
17
|
+
# migrate over to our new join table
|
18
|
+
Shoppe::Product.all.each do |product|
|
19
|
+
product.product_categories << product.old_category
|
20
|
+
product.save
|
21
|
+
end
|
22
|
+
# lastly, remove the old product_category_id and associated index
|
23
|
+
remove_index :shoppe_products, :product_category_id if index_exists?(:shoppe_products, :product_category_id)
|
24
|
+
remove_column :shoppe_products, :product_category_id
|
25
|
+
end
|
26
|
+
|
27
|
+
def down
|
28
|
+
# first, we re-add our column so we've got something to populate
|
29
|
+
add_column :shoppe_products, :product_category_id, :integer
|
30
|
+
add_index :shoppe_products, :product_category_id
|
31
|
+
# define the old belongs_to association once again as we're going to re-add our goodies
|
32
|
+
Shoppe::Product.class_eval do
|
33
|
+
belongs_to :new_category,
|
34
|
+
:class_name => "Shoppe::ProductCategory",
|
35
|
+
:foreign_key => "product_category_id"
|
36
|
+
end
|
37
|
+
# migrate over from the new table to the old association
|
38
|
+
Shoppe::Product.all.each do |product|
|
39
|
+
next unless product.product_categories.count
|
40
|
+
product.new_category = product.product_categories.first
|
41
|
+
product.save
|
42
|
+
end
|
43
|
+
# drop our join table
|
44
|
+
drop_table :shoppe_product_categorizations
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class AddNestedToProductCategories < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :shoppe_product_categories, :parent_id, :integer
|
4
|
+
add_column :shoppe_product_categories, :lft, :integer
|
5
|
+
add_column :shoppe_product_categories, :rgt, :integer
|
6
|
+
add_column :shoppe_product_categories, :depth, :integer
|
7
|
+
|
8
|
+
add_index :shoppe_product_categories, :lft
|
9
|
+
add_index :shoppe_product_categories, :rgt
|
10
|
+
|
11
|
+
add_column :shoppe_product_categories, :ancestral_permalink, :string
|
12
|
+
add_column :shoppe_product_categories, :permalink_includes_ancestors, :boolean, default: false
|
13
|
+
|
14
|
+
Shoppe::ProductCategory.reset_column_information
|
15
|
+
Shoppe::ProductCategory.rebuild!
|
16
|
+
end
|
17
|
+
|
18
|
+
def down
|
19
|
+
remove_column :shoppe_product_categories, :ancestral_permalink
|
20
|
+
remove_column :shoppe_product_categories, :permalink_includes_ancestors
|
21
|
+
|
22
|
+
remove_index :shoppe_product_categories, :lft
|
23
|
+
remove_index :shoppe_product_categories, :rgt
|
24
|
+
|
25
|
+
remove_column :shoppe_product_categories, :parent_id
|
26
|
+
remove_column :shoppe_product_categories, :lft
|
27
|
+
remove_column :shoppe_product_categories, :rgt
|
28
|
+
remove_column :shoppe_product_categories, :depth
|
29
|
+
end
|
30
|
+
end
|
data/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20141026181718) do
|
15
15
|
|
16
16
|
create_table "nifty_attachments", force: true do |t|
|
17
17
|
t.integer "parent_id"
|
@@ -178,34 +178,48 @@ ActiveRecord::Schema.define(version: 20141026181716) do
|
|
178
178
|
t.text "description"
|
179
179
|
t.datetime "created_at"
|
180
180
|
t.datetime "updated_at"
|
181
|
+
t.integer "parent_id"
|
182
|
+
t.integer "lft"
|
183
|
+
t.integer "rgt"
|
184
|
+
t.integer "depth"
|
185
|
+
t.string "ancestral_permalink"
|
186
|
+
t.boolean "permalink_includes_ancestors", default: false
|
181
187
|
end
|
182
188
|
|
189
|
+
add_index "shoppe_product_categories", ["lft"], name: "index_shoppe_product_categories_on_lft", using: :btree
|
183
190
|
add_index "shoppe_product_categories", ["permalink"], name: "index_shoppe_product_categories_on_permalink", using: :btree
|
191
|
+
add_index "shoppe_product_categories", ["rgt"], name: "index_shoppe_product_categories_on_rgt", using: :btree
|
192
|
+
|
193
|
+
create_table "shoppe_product_categorizations", force: true do |t|
|
194
|
+
t.integer "product_id", null: false
|
195
|
+
t.integer "product_category_id", null: false
|
196
|
+
end
|
197
|
+
|
198
|
+
add_index "shoppe_product_categorizations", ["product_category_id"], name: "categorization_by_product_category_id", using: :btree
|
199
|
+
add_index "shoppe_product_categorizations", ["product_id"], name: "categorization_by_product_id", using: :btree
|
184
200
|
|
185
201
|
create_table "shoppe_products", force: true do |t|
|
186
202
|
t.integer "parent_id"
|
187
|
-
t.integer "product_category_id"
|
188
203
|
t.string "name"
|
189
204
|
t.string "sku"
|
190
205
|
t.string "permalink"
|
191
206
|
t.text "description"
|
192
207
|
t.text "short_description"
|
193
|
-
t.boolean "active",
|
194
|
-
t.decimal "weight",
|
195
|
-
t.decimal "price",
|
196
|
-
t.decimal "cost_price",
|
208
|
+
t.boolean "active", default: true
|
209
|
+
t.decimal "weight", precision: 8, scale: 3, default: 0.0
|
210
|
+
t.decimal "price", precision: 8, scale: 2, default: 0.0
|
211
|
+
t.decimal "cost_price", precision: 8, scale: 2, default: 0.0
|
197
212
|
t.integer "tax_rate_id"
|
198
213
|
t.datetime "created_at"
|
199
214
|
t.datetime "updated_at"
|
200
|
-
t.boolean "featured",
|
215
|
+
t.boolean "featured", default: false
|
201
216
|
t.text "in_the_box"
|
202
|
-
t.boolean "stock_control",
|
203
|
-
t.boolean "default",
|
217
|
+
t.boolean "stock_control", default: true
|
218
|
+
t.boolean "default", default: false
|
204
219
|
end
|
205
220
|
|
206
221
|
add_index "shoppe_products", ["parent_id"], name: "index_shoppe_products_on_parent_id", using: :btree
|
207
222
|
add_index "shoppe_products", ["permalink"], name: "index_shoppe_products_on_permalink", using: :btree
|
208
|
-
add_index "shoppe_products", ["product_category_id"], name: "index_shoppe_products_on_product_category_id", using: :btree
|
209
223
|
add_index "shoppe_products", ["sku"], name: "index_shoppe_products_on_sku", using: :btree
|
210
224
|
|
211
225
|
create_table "shoppe_settings", force: true do |t|
|
data/lib/shoppe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoppe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -170,6 +170,20 @@ dependencies:
|
|
170
170
|
- - "<"
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '1.14'
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: awesome_nested_set
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - "~>"
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: 3.0.1
|
180
|
+
type: :runtime
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - "~>"
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: 3.0.1
|
173
187
|
- !ruby/object:Gem::Dependency
|
174
188
|
name: nifty-key-value-store
|
175
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -371,6 +385,7 @@ extensions: []
|
|
371
385
|
extra_rdoc_files: []
|
372
386
|
files:
|
373
387
|
- MIT-LICENSE
|
388
|
+
- README.md
|
374
389
|
- Rakefile
|
375
390
|
- app/assets/images/shoppe/chosen-sprite.png
|
376
391
|
- app/assets/images/shoppe/chosen-sprite@2x.png
|
@@ -441,6 +456,7 @@ files:
|
|
441
456
|
- app/controllers/shoppe/users_controller.rb
|
442
457
|
- app/controllers/shoppe/variants_controller.rb
|
443
458
|
- app/helpers/shoppe/application_helper.rb
|
459
|
+
- app/helpers/shoppe/product_category_helper.rb
|
444
460
|
- app/mailers/shoppe/order_mailer.rb
|
445
461
|
- app/mailers/shoppe/user_mailer.rb
|
446
462
|
- app/models/shoppe/country.rb
|
@@ -457,6 +473,7 @@ files:
|
|
457
473
|
- app/models/shoppe/product/product_attributes.rb
|
458
474
|
- app/models/shoppe/product/variants.rb
|
459
475
|
- app/models/shoppe/product_attribute.rb
|
476
|
+
- app/models/shoppe/product_categorization.rb
|
460
477
|
- app/models/shoppe/product_category.rb
|
461
478
|
- app/models/shoppe/setting.rb
|
462
479
|
- app/models/shoppe/stock_level_adjustment.rb
|
@@ -520,6 +537,7 @@ files:
|
|
520
537
|
- app/views/shoppe/users/new.html.haml
|
521
538
|
- app/views/shoppe/variants/form.html.haml
|
522
539
|
- app/views/shoppe/variants/index.html.haml
|
540
|
+
- config/locales/de.yml
|
523
541
|
- config/locales/en.yml
|
524
542
|
- config/locales/es.yml
|
525
543
|
- config/locales/pl.yml
|
@@ -540,6 +558,8 @@ files:
|
|
540
558
|
- db/migrate/20141026181354_add_indexes_to_shoppe_stock_level_adjustments.rb
|
541
559
|
- db/migrate/20141026181559_add_indexes_to_shoppe_users.rb
|
542
560
|
- db/migrate/20141026181716_add_indexes_to_shoppe_delivery_services.rb
|
561
|
+
- db/migrate/20141026181717_allow_multiple_shoppe_products_per_shoppe_product_category.rb
|
562
|
+
- db/migrate/20141026181718_add_nested_to_product_categories.rb
|
543
563
|
- db/schema.rb
|
544
564
|
- db/seeds.rb
|
545
565
|
- db/seeds_data/poe400.jpg
|