shoppe 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/app/assets/javascripts/shoppe/application.coffee +57 -1
  2. data/app/assets/javascripts/shoppe/mousetrap.js +9 -0
  3. data/app/assets/stylesheets/shoppe/application.scss +70 -59
  4. data/app/assets/stylesheets/shoppe/dialog.scss +10 -0
  5. data/app/assets/stylesheets/shoppe/sub.scss +15 -0
  6. data/app/controllers/shoppe/application_controller.rb +13 -1
  7. data/app/controllers/shoppe/attachments_controller.rb +10 -8
  8. data/app/controllers/shoppe/dashboard_controller.rb +6 -4
  9. data/app/controllers/shoppe/delivery_service_prices_controller.rb +33 -31
  10. data/app/controllers/shoppe/delivery_services_controller.rb +34 -32
  11. data/app/controllers/shoppe/orders_controller.rb +40 -38
  12. data/app/controllers/shoppe/product_categories_controller.rb +34 -32
  13. data/app/controllers/shoppe/products_controller.rb +32 -44
  14. data/app/controllers/shoppe/sessions_controller.rb +24 -22
  15. data/app/controllers/shoppe/stock_level_adjustments_controller.rb +40 -0
  16. data/app/controllers/shoppe/tax_rates_controller.rb +35 -33
  17. data/app/controllers/shoppe/users_controller.rb +40 -33
  18. data/app/controllers/shoppe/variants_controller.rb +50 -0
  19. data/app/helpers/shoppe/shoppe_helper.rb +2 -2
  20. data/app/mailers/shoppe/order_mailer.rb +20 -18
  21. data/app/models/shoppe/country.rb +1 -1
  22. data/app/models/shoppe/delivery_service.rb +17 -15
  23. data/app/models/shoppe/delivery_service_price.rb +18 -16
  24. data/app/models/shoppe/order.rb +293 -290
  25. data/app/models/shoppe/order_item.rb +115 -113
  26. data/app/models/shoppe/product.rb +76 -54
  27. data/app/models/shoppe/product/product_attributes.rb +12 -10
  28. data/app/models/shoppe/product/variants.rb +26 -0
  29. data/app/models/shoppe/product_attribute.rb +40 -38
  30. data/app/models/shoppe/product_category.rb +16 -14
  31. data/app/models/shoppe/stock_level_adjustment.rb +1 -2
  32. data/app/models/shoppe/tax_rate.rb +2 -2
  33. data/app/models/shoppe/user.rb +34 -32
  34. data/app/views/shoppe/orders/index.html.haml +3 -4
  35. data/app/views/shoppe/orders/show.html.haml +5 -5
  36. data/app/views/shoppe/products/_form.html.haml +28 -27
  37. data/app/views/shoppe/products/_table.html.haml +42 -0
  38. data/app/views/shoppe/products/edit.html.haml +2 -1
  39. data/app/views/shoppe/products/index.html.haml +1 -24
  40. data/app/views/shoppe/shared/error.html.haml +4 -0
  41. data/app/views/shoppe/{products/stock_levels.html.haml → stock_level_adjustments/index.html.haml} +12 -6
  42. data/app/views/shoppe/variants/form.html.haml +64 -0
  43. data/app/views/shoppe/variants/index.html.haml +33 -0
  44. data/config/routes.rb +2 -1
  45. data/config/shoppe.example.yml +16 -2
  46. data/db/migrate/20131022090919_refactor_order_items_to_allow_any_product.rb +6 -0
  47. data/db/migrate/20131022092904_rename_product_title_to_name.rb +5 -0
  48. data/db/migrate/20131022093538_stock_level_adjustments_should_be_polymorphic.rb +6 -0
  49. data/db/migrate/20131022135331_add_parent_id_to_products.rb +5 -0
  50. data/db/migrate/20131022145653_cost_price_should_be_default_to_zero.rb +9 -0
  51. data/db/seeds.rb +20 -20
  52. data/lib/shoppe.rb +2 -0
  53. data/lib/shoppe/errors/not_enough_stock.rb +1 -1
  54. data/lib/shoppe/errors/unorderable_item.rb +11 -0
  55. data/lib/shoppe/orderable_item.rb +39 -0
  56. data/lib/shoppe/version.rb +1 -1
  57. data/test/dummy/db/schema.rb +14 -11
  58. data/test/dummy/log/development.log +75 -0
  59. metadata +37 -5
@@ -1085,3 +1085,78 @@ Migrating to AddNotesToOrders (20131021135208)
1085
1085
  SQL (1.7ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131021135208')
1086
1086
   (0.4ms) COMMIT
1087
1087
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1088
+ ActiveRecord::SchemaMigration Load (11.5ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1089
+ Migrating to RefactorOrderItemsToAllowAnyProduct (20131022090919)
1090
+  (69.6ms) ALTER TABLE `shoppe_order_items` CHANGE `product_id` `ordered_item_id` int(11) DEFAULT NULL
1091
+  (28.9ms) ALTER TABLE `shoppe_order_items` ADD `ordered_item_type` varchar(255)
1092
+  (0.1ms) BEGIN
1093
+ SQL (6.0ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131022090919')
1094
+  (0.3ms) COMMIT
1095
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1096
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1097
+ Migrating to RenameProductTitleToName (20131022092904)
1098
+  (25.0ms) ALTER TABLE `shoppe_products` CHANGE `title` `name` varchar(255) DEFAULT NULL
1099
+  (0.1ms) BEGIN
1100
+ SQL (1.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131022092904')
1101
+  (0.3ms) COMMIT
1102
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1103
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1104
+ Migrating to StockLevelAdjustmentsShouldBePolymorphic (20131022093538)
1105
+  (25.5ms) ALTER TABLE `shoppe_stock_level_adjustments` CHANGE `product_id` `item_id` int(11) DEFAULT NULL
1106
+  (20.0ms) ALTER TABLE `shoppe_stock_level_adjustments` ADD `item_type` varchar(255)
1107
+  (0.1ms) BEGIN
1108
+ SQL (2.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131022093538')
1109
+  (0.2ms) COMMIT
1110
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1111
+  (22.1ms) DROP DATABASE IF EXISTS `shoppe_dummy`
1112
+  (21.4ms) DROP DATABASE IF EXISTS `shoppe_dummy_test`
1113
+  (0.3ms) CREATE DATABASE `shoppe_dummy` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
1114
+  (0.3ms) CREATE DATABASE `shoppe_dummy_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
1115
+  (21.5ms) CREATE TABLE `nifty_attachments` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `parent_id` int(11), `parent_type` varchar(255), `token` varchar(255), `digest` varchar(255), `role` varchar(255), `file_name` varchar(255), `file_type` varchar(255), `data` blob(16777215), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
1116
+  (26.6ms) CREATE TABLE `nifty_key_value_store` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `parent_id` int(11), `parent_type` varchar(255), `group` varchar(255), `name` varchar(255), `value` varchar(255)) ENGINE=InnoDB
1117
+  (13.8ms) CREATE TABLE `shoppe_countries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `code2` varchar(255), `code3` varchar(255), `continent` varchar(255), `tld` varchar(255), `currency` varchar(255), `eu_member` tinyint(1) DEFAULT 0) ENGINE=InnoDB
1118
+  (21.7ms) CREATE TABLE `shoppe_delivery_service_prices` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `delivery_service_id` int(11), `code` varchar(255), `price` decimal(8,2), `tax_rate_id` int(11), `min_weight` decimal(8,2), `max_weight` decimal(8,2), `created_at` datetime, `updated_at` datetime, `cost_price` decimal(8,2), `country_ids` text) ENGINE=InnoDB
1119
+  (15.8ms) CREATE TABLE `shoppe_delivery_services` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `code` varchar(255), `default` tinyint(1) DEFAULT 0, `active` tinyint(1) DEFAULT 1, `created_at` datetime, `updated_at` datetime, `courier` varchar(255), `tracking_url` varchar(255)) ENGINE=InnoDB
1120
+  (20.6ms) CREATE TABLE `shoppe_order_items` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `order_id` int(11), `ordered_item_id` int(11), `quantity` int(11) DEFAULT 1, `unit_price` decimal(8,2), `tax_amount` decimal(8,2), `tax_rate` decimal(8,2), `weight` decimal(8,3) DEFAULT 0.0, `created_at` datetime, `updated_at` datetime, `unit_cost_price` decimal(8,2), `ordered_item_type` varchar(255)) ENGINE=InnoDB
1121
+  (14.4ms) CREATE TABLE `shoppe_orders` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `token` varchar(255), `first_name` varchar(255), `last_name` varchar(255), `company` varchar(255), `address1` varchar(255), `address2` varchar(255), `address3` varchar(255), `address4` varchar(255), `postcode` varchar(255), `country_id` int(11), `email_address` varchar(255), `phone_number` varchar(255), `status` varchar(255), `received_at` datetime, `accepted_at` datetime, `shipped_at` datetime, `created_at` datetime, `updated_at` datetime, `delivery_service_id` int(11), `delivery_price` decimal(8,2), `delivery_tax_rate` decimal(8,2), `delivery_tax_amount` decimal(8,2), `paid_at` datetime, `accepted_by` int(11), `shipped_by` int(11), `consignment_number` varchar(255), `rejected_at` datetime, `rejected_by` int(11), `ip_address` varchar(255), `payment_reference` varchar(255), `payment_method` varchar(255), `delivery_cost_price` decimal(8,2), `notes` text) ENGINE=InnoDB
1122
+  (16.6ms) CREATE TABLE `shoppe_product_attributes` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `product_id` int(11), `key` varchar(255), `value` varchar(255), `position` int(11) DEFAULT 1, `searchable` tinyint(1) DEFAULT 1, `created_at` datetime, `updated_at` datetime, `public` tinyint(1) DEFAULT 1) ENGINE=InnoDB
1123
+  (21.3ms) CREATE TABLE `shoppe_product_categories` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `permalink` varchar(255), `description` text, `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
1124
+  (21.9ms) CREATE TABLE `shoppe_products` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `product_category_id` int(11), `name` varchar(255), `sku` varchar(255), `permalink` varchar(255), `description` text, `short_description` text, `active` tinyint(1) DEFAULT 1, `weight` decimal(8,3) DEFAULT 0.0, `price` decimal(8,2) DEFAULT 0.0, `tax_rate_id` int(11), `created_at` datetime, `updated_at` datetime, `featured` tinyint(1) DEFAULT 0, `in_the_box` text, `cost_price` decimal(8,2), `stock_control` tinyint(1) DEFAULT 1) ENGINE=InnoDB
1125
+  (12.0ms) CREATE TABLE `shoppe_stock_level_adjustments` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `item_id` int(11), `description` varchar(255), `adjustment` int(11) DEFAULT 0, `parent_type` varchar(255), `parent_id` int(11), `created_at` datetime, `updated_at` datetime, `item_type` varchar(255)) ENGINE=InnoDB
1126
+  (15.0ms) CREATE TABLE `shoppe_tax_rates` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `rate` decimal(8,2), `created_at` datetime, `updated_at` datetime, `country_ids` text) ENGINE=InnoDB
1127
+  (16.5ms) CREATE TABLE `shoppe_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `email_address` varchar(255), `password_digest` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
1128
+  (12.5ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
1129
+  (14.1ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`) 
1130
+  (0.2ms) SELECT version FROM `schema_migrations`
1131
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131022093538')
1132
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131017165217')
1133
+  (0.6ms) INSERT INTO `schema_migrations` (version) VALUES ('20131017165222')
1134
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20130926094549')
1135
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20131012123829')
1136
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131012163301')
1137
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131013123937')
1138
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20131013131658')
1139
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131017144430')
1140
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131017180920')
1141
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131017183211')
1142
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131020204719')
1143
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131021135208')
1144
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20131022090919')
1145
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20131022092904')
1146
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1147
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1148
+ Migrating to AddParentIdToProducts (20131022135331)
1149
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1150
+ Migrating to AddParentIdToProducts (20131022135331)
1151
+  (11.9ms) ALTER TABLE `shoppe_products` ADD `parent_id` int(11) AFTER `id`
1152
+  (0.1ms) BEGIN
1153
+ SQL (1.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131022135331')
1154
+  (0.3ms) COMMIT
1155
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1156
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1157
+ Migrating to CostPriceShouldBeDefaultToZero (20131022145653)
1158
+  (24.2ms) ALTER TABLE `shoppe_products` CHANGE `cost_price` `cost_price` decimal(8,2) DEFAULT 0.0
1159
+  (0.1ms) BEGIN
1160
+ SQL (1.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131022145653')
1161
+  (0.3ms) COMMIT
1162
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoppe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-21 00:00:00.000000000 Z
12
+ date: 2013-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -219,6 +219,22 @@ dependencies:
219
219
  - - ~>
220
220
  - !ruby/object:Gem::Version
221
221
  version: 1.0.0
222
+ - !ruby/object:Gem::Dependency
223
+ name: nifty-dialog
224
+ requirement: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ~>
228
+ - !ruby/object:Gem::Version
229
+ version: 1.0.0
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
234
+ requirements:
235
+ - - ~>
236
+ - !ruby/object:Gem::Version
237
+ version: 1.0.0
222
238
  - !ruby/object:Gem::Dependency
223
239
  name: sqlite3
224
240
  requirement: !ruby/object:Gem::Requirement
@@ -300,8 +316,10 @@ files:
300
316
  - app/assets/javascripts/shoppe/application.coffee
301
317
  - app/assets/javascripts/shoppe/chosen.jquery.js
302
318
  - app/assets/javascripts/shoppe/jquery_ui.js
319
+ - app/assets/javascripts/shoppe/mousetrap.js
303
320
  - app/assets/stylesheets/shoppe/application.scss
304
321
  - app/assets/stylesheets/shoppe/chosen.css
322
+ - app/assets/stylesheets/shoppe/dialog.scss
305
323
  - app/assets/stylesheets/shoppe/elements.scss
306
324
  - app/assets/stylesheets/shoppe/reset.scss
307
325
  - app/assets/stylesheets/shoppe/sub.scss
@@ -315,8 +333,10 @@ files:
315
333
  - app/controllers/shoppe/product_categories_controller.rb
316
334
  - app/controllers/shoppe/products_controller.rb
317
335
  - app/controllers/shoppe/sessions_controller.rb
336
+ - app/controllers/shoppe/stock_level_adjustments_controller.rb
318
337
  - app/controllers/shoppe/tax_rates_controller.rb
319
338
  - app/controllers/shoppe/users_controller.rb
339
+ - app/controllers/shoppe/variants_controller.rb
320
340
  - app/helpers/shoppe/application_helper.rb
321
341
  - app/helpers/shoppe/shoppe_helper.rb
322
342
  - app/mailers/shoppe/order_mailer.rb
@@ -327,6 +347,7 @@ files:
327
347
  - app/models/shoppe/order.rb
328
348
  - app/models/shoppe/order_item.rb
329
349
  - app/models/shoppe/product/product_attributes.rb
350
+ - app/models/shoppe/product/variants.rb
330
351
  - app/models/shoppe/product.rb
331
352
  - app/models/shoppe/product_attribute.rb
332
353
  - app/models/shoppe/product_category.rb
@@ -354,12 +375,14 @@ files:
354
375
  - app/views/shoppe/product_categories/index.html.haml
355
376
  - app/views/shoppe/product_categories/new.html.haml
356
377
  - app/views/shoppe/products/_form.html.haml
378
+ - app/views/shoppe/products/_table.html.haml
357
379
  - app/views/shoppe/products/edit.html.haml
358
380
  - app/views/shoppe/products/index.html.haml
359
381
  - app/views/shoppe/products/new.html.haml
360
- - app/views/shoppe/products/stock_levels.html.haml
361
382
  - app/views/shoppe/sessions/new.html.haml
362
383
  - app/views/shoppe/sessions/reset.html.haml
384
+ - app/views/shoppe/shared/error.html.haml
385
+ - app/views/shoppe/stock_level_adjustments/index.html.haml
363
386
  - app/views/shoppe/tax_rates/form.html.haml
364
387
  - app/views/shoppe/tax_rates/index.html.haml
365
388
  - app/views/shoppe/user_mailer/new_password.text.erb
@@ -367,6 +390,8 @@ files:
367
390
  - app/views/shoppe/users/edit.html.haml
368
391
  - app/views/shoppe/users/index.html.haml
369
392
  - app/views/shoppe/users/new.html.haml
393
+ - app/views/shoppe/variants/form.html.haml
394
+ - app/views/shoppe/variants/index.html.haml
370
395
  - config/routes.rb
371
396
  - config/shoppe.example.yml
372
397
  - db/countries.txt
@@ -380,6 +405,11 @@ files:
380
405
  - db/migrate/20131017183211_create_shoppe_tax_rates.rb
381
406
  - db/migrate/20131020204719_add_countries_to_tax_rates_and_delivery_prices.rb
382
407
  - db/migrate/20131021135208_add_notes_to_orders.rb
408
+ - db/migrate/20131022090919_refactor_order_items_to_allow_any_product.rb
409
+ - db/migrate/20131022092904_rename_product_title_to_name.rb
410
+ - db/migrate/20131022093538_stock_level_adjustments_should_be_polymorphic.rb
411
+ - db/migrate/20131022135331_add_parent_id_to_products.rb
412
+ - db/migrate/20131022145653_cost_price_should_be_default_to_zero.rb
383
413
  - db/seeds.rb
384
414
  - db/seeds_data/poe400.jpg
385
415
  - db/seeds_data/snom-870-blk.jpg
@@ -402,6 +432,8 @@ files:
402
432
  - lib/shoppe/errors/invalid_configuration.rb
403
433
  - lib/shoppe/errors/not_enough_stock.rb
404
434
  - lib/shoppe/errors/payment_declined.rb
435
+ - lib/shoppe/errors/unorderable_item.rb
436
+ - lib/shoppe/orderable_item.rb
405
437
  - lib/shoppe/setup_generator.rb
406
438
  - lib/shoppe/version.rb
407
439
  - lib/shoppe.rb
@@ -465,7 +497,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
465
497
  version: '0'
466
498
  segments:
467
499
  - 0
468
- hash: -144390531799540250
500
+ hash: 404704541590521889
469
501
  required_rubygems_version: !ruby/object:Gem::Requirement
470
502
  none: false
471
503
  requirements:
@@ -474,7 +506,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
474
506
  version: '0'
475
507
  segments:
476
508
  - 0
477
- hash: -144390531799540250
509
+ hash: 404704541590521889
478
510
  requirements: []
479
511
  rubyforge_project:
480
512
  rubygems_version: 1.8.23