shoppe 1.0.7 → 1.0.8

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/shoppe/application.coffee +4 -0
  3. data/app/assets/stylesheets/shoppe/application.scss +3 -3
  4. data/app/controllers/shoppe/addresses_controller.rb +47 -0
  5. data/app/controllers/shoppe/customers_controller.rb +55 -0
  6. data/app/controllers/shoppe/orders_controller.rb +29 -0
  7. data/app/controllers/shoppe/product_category_localisations_controller.rb +58 -0
  8. data/app/controllers/shoppe/product_localisations_controller.rb +58 -0
  9. data/app/controllers/shoppe/products_controller.rb +1 -1
  10. data/app/models/shoppe/address.rb +44 -0
  11. data/app/models/shoppe/customer.rb +41 -0
  12. data/app/models/shoppe/order.rb +7 -0
  13. data/app/models/shoppe/product.rb +6 -3
  14. data/app/models/shoppe/product/variants.rb +1 -1
  15. data/app/models/shoppe/product_category.rb +3 -3
  16. data/app/views/shoppe/addresses/_form.html.haml +33 -0
  17. data/app/views/shoppe/addresses/edit.html.haml +5 -0
  18. data/app/views/shoppe/addresses/new.html.haml +5 -0
  19. data/app/views/shoppe/customers/_addresses.html.haml +20 -0
  20. data/app/views/shoppe/customers/_form.html.haml +30 -0
  21. data/app/views/shoppe/customers/_search_form.html.haml +13 -0
  22. data/app/views/shoppe/customers/edit.html.haml +5 -0
  23. data/app/views/shoppe/customers/index.html.haml +32 -0
  24. data/app/views/shoppe/customers/new.html.haml +5 -0
  25. data/app/views/shoppe/customers/show.html.haml +53 -0
  26. data/app/views/shoppe/orders/_form.html.haml +3 -0
  27. data/app/views/shoppe/product_categories/_form.html.haml +1 -2
  28. data/app/views/shoppe/product_categories/edit.html.haml +3 -1
  29. data/app/views/shoppe/product_categories/index.html.haml +7 -0
  30. data/app/views/shoppe/product_category_localisations/form.html.haml +29 -0
  31. data/app/views/shoppe/product_category_localisations/index.html.haml +26 -0
  32. data/app/views/shoppe/product_localisations/form.html.haml +32 -0
  33. data/app/views/shoppe/product_localisations/index.html.haml +26 -0
  34. data/app/views/shoppe/products/edit.html.haml +1 -0
  35. data/app/views/shoppe/variants/form.html.haml +3 -1
  36. data/config/locales/en.yml +82 -1
  37. data/config/routes.rb +10 -1
  38. data/db/migrate/20141013192427_create_shoppe_customers.rb +14 -0
  39. data/db/migrate/20141027215005_create_shoppe_addresses.rb +17 -0
  40. data/db/migrate/20150315215633_add_customer_to_shoppe_orders.rb +5 -0
  41. data/db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb +17 -0
  42. data/db/migrate/20150519173350_create_shoppe_product_translation_table.rb +18 -0
  43. data/db/schema.rb +42 -1
  44. data/lib/shoppe.rb +1 -0
  45. data/lib/shoppe/default_navigation.rb +1 -0
  46. data/lib/shoppe/version.rb +1 -1
  47. metadata +41 -2
@@ -1,9 +1,18 @@
1
1
  Shoppe::Engine.routes.draw do
2
2
 
3
3
  get 'attachment/:id/:filename.:extension' => 'attachments#show'
4
- resources :product_categories
4
+
5
+ resources :customers do
6
+ post :search, :on => :collection
7
+ resources :addresses
8
+ end
9
+
10
+ resources :product_categories do
11
+ resources :localisations, controller: "product_category_localisations"
12
+ end
5
13
  resources :products do
6
14
  resources :variants
15
+ resources :localisations, controller: "product_localisations"
7
16
  collection do
8
17
  get :import
9
18
  post :import
@@ -0,0 +1,14 @@
1
+ class CreateShoppeCustomers < ActiveRecord::Migration
2
+ def change
3
+ create_table :shoppe_customers do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+ t.string :company
7
+ t.string :email
8
+ t.string :phone
9
+ t.string :mobile
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ class CreateShoppeAddresses < ActiveRecord::Migration
2
+ def change
3
+ create_table :shoppe_addresses do |t|
4
+ t.belongs_to :customer, index: true
5
+ t.string :address_type
6
+ t.boolean :default
7
+ t.string :address1
8
+ t.string :address2
9
+ t.string :address3
10
+ t.string :address4
11
+ t.string :postcode
12
+ t.integer :country_id
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ class AddCustomerToShoppeOrders < ActiveRecord::Migration
2
+ def change
3
+ add_column :shoppe_orders, :customer_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ class CreateShoppeProductCategoryTranslationTable < ActiveRecord::Migration
2
+ def up
3
+ Shoppe::ProductCategory.create_translation_table! :name => :string, :permalink => :string, :description => :text
4
+
5
+ Shoppe::ProductCategory.all.each do |pc|
6
+ l = pc.translations.new
7
+ l.locale = "en"
8
+ l.name = pc.name
9
+ l.permalink = pc.permalink
10
+ l.description = pc.description
11
+ l.save!
12
+ end
13
+ end
14
+ def down
15
+ Shoppe::ProductCategory.drop_translation_table!
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ class CreateShoppeProductTranslationTable < ActiveRecord::Migration
2
+ def up
3
+ Shoppe::Product.create_translation_table! :name => :string, :permalink => :string, :description => :text, :short_description => :text
4
+
5
+ Shoppe::Product.all.each do |p|
6
+ l = p.translations.new
7
+ l.locale = "en"
8
+ l.name = p.name
9
+ l.permalink = p.permalink
10
+ l.description = p.description
11
+ l.short_description = p.short_description
12
+ l.save!
13
+ end
14
+ end
15
+ def down
16
+ Shoppe::Product.drop_translation_table!
17
+ end
18
+ end
@@ -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: 20141026181718) do
14
+ ActiveRecord::Schema.define(version: 20150315223628) do
15
15
 
16
16
  create_table "nifty_attachments", force: true do |t|
17
17
  t.integer "parent_id"
@@ -34,6 +34,35 @@ ActiveRecord::Schema.define(version: 20141026181718) do
34
34
  t.string "value"
35
35
  end
36
36
 
37
+ create_table "shoppe_addresses", force: true do |t|
38
+ t.integer "customer_id"
39
+ t.string "address_type"
40
+ t.boolean "default"
41
+ t.string "address1"
42
+ t.string "address2"
43
+ t.string "address3"
44
+ t.string "address4"
45
+ t.string "postcode"
46
+ t.integer "country_id"
47
+ t.datetime "created_at"
48
+ t.datetime "updated_at"
49
+ end
50
+
51
+ add_index "shoppe_addresses", ["customer_id"], name: "index_shoppe_addresses_on_customer_id", using: :btree
52
+
53
+ create_table "shoppe_attachments", force: true do |t|
54
+ t.integer "parent_id", null: false
55
+ t.string "parent_type", null: false
56
+ t.string "token"
57
+ t.string "file", null: false
58
+ t.string "file_name"
59
+ t.integer "file_size"
60
+ t.string "file_type"
61
+ t.string "role"
62
+ t.datetime "created_at"
63
+ t.datetime "updated_at"
64
+ end
65
+
37
66
  create_table "shoppe_countries", force: true do |t|
38
67
  t.string "name"
39
68
  t.string "code2"
@@ -44,6 +73,17 @@ ActiveRecord::Schema.define(version: 20141026181718) do
44
73
  t.boolean "eu_member", default: false
45
74
  end
46
75
 
76
+ create_table "shoppe_customers", force: true do |t|
77
+ t.string "first_name"
78
+ t.string "last_name"
79
+ t.string "company"
80
+ t.string "email"
81
+ t.string "phone"
82
+ t.string "mobile"
83
+ t.datetime "created_at"
84
+ t.datetime "updated_at"
85
+ end
86
+
47
87
  create_table "shoppe_delivery_service_prices", force: true do |t|
48
88
  t.integer "delivery_service_id"
49
89
  t.string "code"
@@ -134,6 +174,7 @@ ActiveRecord::Schema.define(version: 20141026181718) do
134
174
  t.decimal "amount_paid", precision: 8, scale: 2, default: 0.0
135
175
  t.boolean "exported", default: false
136
176
  t.string "invoice_number"
177
+ t.integer "customer_id"
137
178
  end
138
179
 
139
180
  add_index "shoppe_orders", ["delivery_service_id"], name: "index_shoppe_orders_on_delivery_service_id", using: :btree
@@ -6,6 +6,7 @@ require 'bcrypt'
6
6
  require 'dynamic_form'
7
7
  require 'kaminari'
8
8
  require 'ransack'
9
+ require "globalize"
9
10
 
10
11
  require 'nifty/utils'
11
12
  require 'nifty/key_value_store'
@@ -9,6 +9,7 @@ require 'shoppe/navigation_manager'
9
9
  # This is the default navigation manager for the admin interface.
10
10
  #
11
11
  Shoppe::NavigationManager.build(:admin_primary) do
12
+ add_item :customers
12
13
  add_item :orders
13
14
  add_item :products
14
15
  add_item :product_categories
@@ -1,3 +1,3 @@
1
1
  module Shoppe
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
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.7
4
+ version: 1.0.8
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-05-19 00:00:00.000000000 Z
11
+ date: 2015-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -184,6 +184,20 @@ dependencies:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
186
  version: 3.0.1
187
+ - !ruby/object:Gem::Dependency
188
+ name: globalize
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ type: :runtime
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
187
201
  - !ruby/object:Gem::Dependency
188
202
  name: nifty-key-value-store
189
203
  requirement: !ruby/object:Gem::Requirement
@@ -439,15 +453,19 @@ files:
439
453
  - app/assets/stylesheets/shoppe/reset.scss
440
454
  - app/assets/stylesheets/shoppe/sub.scss
441
455
  - app/assets/stylesheets/shoppe/variables.scss
456
+ - app/controllers/shoppe/addresses_controller.rb
442
457
  - app/controllers/shoppe/application_controller.rb
443
458
  - app/controllers/shoppe/attachments_controller.rb
444
459
  - app/controllers/shoppe/countries_controller.rb
460
+ - app/controllers/shoppe/customers_controller.rb
445
461
  - app/controllers/shoppe/dashboard_controller.rb
446
462
  - app/controllers/shoppe/delivery_service_prices_controller.rb
447
463
  - app/controllers/shoppe/delivery_services_controller.rb
448
464
  - app/controllers/shoppe/orders_controller.rb
449
465
  - app/controllers/shoppe/payments_controller.rb
450
466
  - app/controllers/shoppe/product_categories_controller.rb
467
+ - app/controllers/shoppe/product_category_localisations_controller.rb
468
+ - app/controllers/shoppe/product_localisations_controller.rb
451
469
  - app/controllers/shoppe/products_controller.rb
452
470
  - app/controllers/shoppe/sessions_controller.rb
453
471
  - app/controllers/shoppe/settings_controller.rb
@@ -459,7 +477,9 @@ files:
459
477
  - app/helpers/shoppe/product_category_helper.rb
460
478
  - app/mailers/shoppe/order_mailer.rb
461
479
  - app/mailers/shoppe/user_mailer.rb
480
+ - app/models/shoppe/address.rb
462
481
  - app/models/shoppe/country.rb
482
+ - app/models/shoppe/customer.rb
463
483
  - app/models/shoppe/delivery_service.rb
464
484
  - app/models/shoppe/delivery_service_price.rb
465
485
  - app/models/shoppe/order.rb
@@ -483,10 +503,20 @@ files:
483
503
  - app/views/layouts/shoppe/application.html.haml
484
504
  - app/views/layouts/shoppe/printable.html.haml
485
505
  - app/views/layouts/shoppe/sub.html.haml
506
+ - app/views/shoppe/addresses/_form.html.haml
507
+ - app/views/shoppe/addresses/edit.html.haml
508
+ - app/views/shoppe/addresses/new.html.haml
486
509
  - app/views/shoppe/countries/_form.html.haml
487
510
  - app/views/shoppe/countries/edit.html.haml
488
511
  - app/views/shoppe/countries/index.html.haml
489
512
  - app/views/shoppe/countries/new.html.haml
513
+ - app/views/shoppe/customers/_addresses.html.haml
514
+ - app/views/shoppe/customers/_form.html.haml
515
+ - app/views/shoppe/customers/_search_form.html.haml
516
+ - app/views/shoppe/customers/edit.html.haml
517
+ - app/views/shoppe/customers/index.html.haml
518
+ - app/views/shoppe/customers/new.html.haml
519
+ - app/views/shoppe/customers/show.html.haml
490
520
  - app/views/shoppe/delivery_service_prices/_form.html.haml
491
521
  - app/views/shoppe/delivery_service_prices/edit.html.haml
492
522
  - app/views/shoppe/delivery_service_prices/index.html.haml
@@ -517,6 +547,10 @@ files:
517
547
  - app/views/shoppe/product_categories/edit.html.haml
518
548
  - app/views/shoppe/product_categories/index.html.haml
519
549
  - app/views/shoppe/product_categories/new.html.haml
550
+ - app/views/shoppe/product_category_localisations/form.html.haml
551
+ - app/views/shoppe/product_category_localisations/index.html.haml
552
+ - app/views/shoppe/product_localisations/form.html.haml
553
+ - app/views/shoppe/product_localisations/index.html.haml
520
554
  - app/views/shoppe/products/_form.html.haml
521
555
  - app/views/shoppe/products/_table.html.haml
522
556
  - app/views/shoppe/products/edit.html.haml
@@ -548,6 +582,7 @@ files:
548
582
  - db/migrate/20131024201501_add_address_type_to_shoppe_tax_rates.rb
549
583
  - db/migrate/20131024204815_create_shoppe_payments.rb
550
584
  - db/migrate/20131102143930_remove_default_on_order_item_weight.rb
585
+ - db/migrate/20141013192427_create_shoppe_customers.rb
551
586
  - db/migrate/20141026175622_add_indexes_to_shoppe_order_items.rb
552
587
  - db/migrate/20141026175943_add_indexes_to_shoppe_orders.rb
553
588
  - db/migrate/20141026180333_add_indexes_to_shoppe_payments.rb
@@ -560,6 +595,10 @@ files:
560
595
  - db/migrate/20141026181716_add_indexes_to_shoppe_delivery_services.rb
561
596
  - db/migrate/20141026181717_allow_multiple_shoppe_products_per_shoppe_product_category.rb
562
597
  - db/migrate/20141026181718_add_nested_to_product_categories.rb
598
+ - db/migrate/20141027215005_create_shoppe_addresses.rb
599
+ - db/migrate/20150315215633_add_customer_to_shoppe_orders.rb
600
+ - db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb
601
+ - db/migrate/20150519173350_create_shoppe_product_translation_table.rb
563
602
  - db/schema.rb
564
603
  - db/seeds.rb
565
604
  - db/seeds_data/poe400.jpg