kkt_shoppe 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +0 -0
  3. data/README.md +1 -0
  4. data/Rakefile +0 -0
  5. data/app/assets/images/kkt_shoppe/icons/edit.svg +0 -0
  6. data/app/assets/images/kkt_shoppe/kkt_shoppe.svg +0 -0
  7. data/app/assets/images/kkt_shoppe/logo.svg +0 -0
  8. data/app/assets/images/kkt_shoppe/square.svg +0 -0
  9. data/app/assets/images/kkt_shoppe/statuses/accepted.svg +0 -0
  10. data/app/assets/images/kkt_shoppe/statuses/paid.svg +0 -0
  11. data/app/assets/images/kkt_shoppe/statuses/received.svg +0 -0
  12. data/app/assets/images/kkt_shoppe/statuses/rejected.svg +0 -0
  13. data/app/assets/images/kkt_shoppe/statuses/shipped.svg +0 -0
  14. data/app/assets/images/kkt_shoppe/table-tear-off.png +0 -0
  15. data/app/assets/javascripts/kkt_shoppe/application.coffee +0 -5
  16. data/app/assets/javascripts/kkt_shoppe/mousetrap.js +0 -0
  17. data/app/assets/javascripts/kkt_shoppe/order_form.coffee +0 -0
  18. data/app/assets/stylesheets/kkt_shoppe/application.scss +1 -12
  19. data/app/assets/stylesheets/kkt_shoppe/dialog.scss +0 -0
  20. data/app/assets/stylesheets/kkt_shoppe/elements.scss +0 -0
  21. data/app/assets/stylesheets/kkt_shoppe/printable.scss +1 -1
  22. data/app/assets/stylesheets/kkt_shoppe/reset.scss +0 -0
  23. data/app/assets/stylesheets/kkt_shoppe/sub.scss +1 -1
  24. data/app/assets/stylesheets/kkt_shoppe/variables.scss +0 -0
  25. data/app/controllers/kkt_shoppe/addresses_controller.rb +1 -1
  26. data/app/controllers/kkt_shoppe/application_controller.rb +0 -0
  27. data/app/controllers/kkt_shoppe/attachments_controller.rb +1 -1
  28. data/app/controllers/kkt_shoppe/countries_controller.rb +0 -0
  29. data/app/controllers/kkt_shoppe/customers_controller.rb +1 -1
  30. data/app/controllers/kkt_shoppe/dashboard_controller.rb +0 -0
  31. data/app/controllers/kkt_shoppe/delivery_service_prices_controller.rb +0 -0
  32. data/app/controllers/kkt_shoppe/delivery_services_controller.rb +0 -0
  33. data/app/controllers/kkt_shoppe/orders_controller.rb +0 -0
  34. data/app/controllers/kkt_shoppe/payments_controller.rb +0 -0
  35. data/app/controllers/kkt_shoppe/product_categories_controller.rb +0 -0
  36. data/app/controllers/kkt_shoppe/product_category_localisations_controller.rb +0 -0
  37. data/app/controllers/kkt_shoppe/product_localisations_controller.rb +0 -0
  38. data/app/controllers/kkt_shoppe/products_controller.rb +2 -3
  39. data/app/controllers/kkt_shoppe/sessions_controller.rb +0 -0
  40. data/app/controllers/kkt_shoppe/settings_controller.rb +0 -0
  41. data/app/controllers/kkt_shoppe/stock_level_adjustments_controller.rb +0 -0
  42. data/app/controllers/kkt_shoppe/tax_rates_controller.rb +0 -0
  43. data/app/controllers/kkt_shoppe/users_controller.rb +0 -0
  44. data/app/controllers/kkt_shoppe/variants_controller.rb +0 -0
  45. data/app/helpers/kkt_shoppe/application_helper.rb +4 -4
  46. data/app/helpers/kkt_shoppe/product_category_helper.rb +1 -1
  47. data/app/mailers/kkt_shoppe/order_mailer.rb +0 -0
  48. data/app/mailers/kkt_shoppe/user_mailer.rb +0 -0
  49. data/app/models/kkt_shoppe/address.rb +0 -0
  50. data/app/models/kkt_shoppe/country.rb +0 -0
  51. data/app/models/kkt_shoppe/customer.rb +1 -1
  52. data/app/models/kkt_shoppe/delivery_service.rb +0 -0
  53. data/app/models/kkt_shoppe/delivery_service_price.rb +0 -0
  54. data/app/models/kkt_shoppe/order/actions.rb +2 -2
  55. data/app/models/kkt_shoppe/order/billing.rb +0 -0
  56. data/app/models/kkt_shoppe/order/delivery.rb +1 -1
  57. data/app/models/kkt_shoppe/order/states.rb +0 -0
  58. data/app/models/kkt_shoppe/order.rb +0 -0
  59. data/app/models/kkt_shoppe/order_item.rb +0 -0
  60. data/app/models/kkt_shoppe/payment.rb +0 -0
  61. data/app/models/kkt_shoppe/product/product_attributes.rb +0 -0
  62. data/app/models/kkt_shoppe/product/variants.rb +0 -0
  63. data/app/models/kkt_shoppe/product.rb +3 -23
  64. data/app/models/kkt_shoppe/product_attribute.rb +0 -0
  65. data/app/models/kkt_shoppe/product_categorization.rb +0 -0
  66. data/app/models/kkt_shoppe/product_category.rb +2 -9
  67. data/app/models/kkt_shoppe/setting.rb +0 -0
  68. data/app/models/kkt_shoppe/stock_level_adjustment.rb +0 -0
  69. data/app/models/kkt_shoppe/tax_rate.rb +0 -0
  70. data/app/models/kkt_shoppe/user.rb +0 -0
  71. data/app/validators/permalink_validator.rb +0 -0
  72. data/app/views/kkt_shoppe/addresses/_form.html.haml +0 -0
  73. data/app/views/kkt_shoppe/addresses/edit.html.haml +0 -0
  74. data/app/views/kkt_shoppe/addresses/new.html.haml +0 -0
  75. data/app/views/kkt_shoppe/countries/_form.html.haml +0 -0
  76. data/app/views/kkt_shoppe/countries/edit.html.haml +0 -0
  77. data/app/views/kkt_shoppe/countries/index.html.haml +0 -0
  78. data/app/views/kkt_shoppe/countries/new.html.haml +0 -0
  79. data/app/views/kkt_shoppe/customers/_addresses.html.haml +0 -0
  80. data/app/views/kkt_shoppe/customers/_form.html.haml +0 -0
  81. data/app/views/kkt_shoppe/customers/_search_form.html.haml +0 -0
  82. data/app/views/kkt_shoppe/customers/edit.html.haml +0 -0
  83. data/app/views/kkt_shoppe/customers/index.html.haml +0 -0
  84. data/app/views/kkt_shoppe/customers/new.html.haml +0 -0
  85. data/app/views/kkt_shoppe/customers/show.html.haml +1 -1
  86. data/app/views/kkt_shoppe/delivery_service_prices/_form.html.haml +0 -0
  87. data/app/views/kkt_shoppe/delivery_service_prices/edit.html.haml +0 -0
  88. data/app/views/kkt_shoppe/delivery_service_prices/index.html.haml +0 -0
  89. data/app/views/kkt_shoppe/delivery_service_prices/new.html.haml +0 -0
  90. data/app/views/kkt_shoppe/delivery_services/_form.html.haml +0 -0
  91. data/app/views/kkt_shoppe/delivery_services/edit.html.haml +0 -0
  92. data/app/views/kkt_shoppe/delivery_services/index.html.haml +0 -0
  93. data/app/views/kkt_shoppe/delivery_services/new.html.haml +0 -0
  94. data/app/views/kkt_shoppe/order_mailer/accepted.text.erb +0 -0
  95. data/app/views/kkt_shoppe/order_mailer/received.text.erb +5 -2
  96. data/app/views/kkt_shoppe/order_mailer/rejected.text.erb +0 -0
  97. data/app/views/kkt_shoppe/order_mailer/shipped.text.erb +0 -0
  98. data/app/views/kkt_shoppe/orders/_form.html.haml +0 -0
  99. data/app/views/kkt_shoppe/orders/_order_details.html.haml +0 -0
  100. data/app/views/kkt_shoppe/orders/_order_items.html.haml +0 -0
  101. data/app/views/kkt_shoppe/orders/_order_items_form.html.haml +0 -0
  102. data/app/views/kkt_shoppe/orders/_payments_form.html.haml +0 -0
  103. data/app/views/kkt_shoppe/orders/_payments_table.html.haml +0 -0
  104. data/app/views/kkt_shoppe/orders/_search_form.html.haml +0 -0
  105. data/app/views/kkt_shoppe/orders/_status_bar.html.haml +0 -0
  106. data/app/views/kkt_shoppe/orders/despatch_note.html.haml +0 -0
  107. data/app/views/kkt_shoppe/orders/edit.html.haml +0 -0
  108. data/app/views/kkt_shoppe/orders/index.html.haml +0 -0
  109. data/app/views/kkt_shoppe/orders/new.html.haml +0 -0
  110. data/app/views/kkt_shoppe/orders/show.html.haml +0 -0
  111. data/app/views/kkt_shoppe/payments/refund.html.haml +0 -0
  112. data/app/views/kkt_shoppe/product_categories/_form.html.haml +1 -1
  113. data/app/views/kkt_shoppe/product_categories/edit.html.haml +0 -0
  114. data/app/views/kkt_shoppe/product_categories/index.html.haml +0 -0
  115. data/app/views/kkt_shoppe/product_categories/new.html.haml +0 -0
  116. data/app/views/kkt_shoppe/product_category_localisations/form.html.haml +0 -0
  117. data/app/views/kkt_shoppe/product_category_localisations/index.html.haml +0 -0
  118. data/app/views/kkt_shoppe/product_localisations/form.html.haml +1 -1
  119. data/app/views/kkt_shoppe/product_localisations/index.html.haml +0 -0
  120. data/app/views/kkt_shoppe/products/_form.html.haml +4 -24
  121. data/app/views/kkt_shoppe/products/_table.html.haml +0 -0
  122. data/app/views/kkt_shoppe/products/edit.html.haml +0 -0
  123. data/app/views/kkt_shoppe/products/import.html.haml +0 -0
  124. data/app/views/kkt_shoppe/products/index.html.haml +0 -0
  125. data/app/views/kkt_shoppe/products/new.html.haml +0 -0
  126. data/app/views/kkt_shoppe/sessions/new.html.haml +0 -0
  127. data/app/views/kkt_shoppe/sessions/reset.html.haml +0 -0
  128. data/app/views/kkt_shoppe/settings/edit.html.haml +0 -0
  129. data/app/views/kkt_shoppe/shared/error.html.haml +0 -0
  130. data/app/views/kkt_shoppe/stock_level_adjustments/index.html.haml +0 -0
  131. data/app/views/kkt_shoppe/tax_rates/form.html.haml +0 -0
  132. data/app/views/kkt_shoppe/tax_rates/index.html.haml +0 -0
  133. data/app/views/kkt_shoppe/user_mailer/new_password.text.erb +0 -0
  134. data/app/views/kkt_shoppe/users/_form.html.haml +0 -0
  135. data/app/views/kkt_shoppe/users/edit.html.haml +0 -0
  136. data/app/views/kkt_shoppe/users/index.html.haml +0 -0
  137. data/app/views/kkt_shoppe/users/new.html.haml +0 -0
  138. data/app/views/kkt_shoppe/variants/form.html.haml +0 -0
  139. data/app/views/kkt_shoppe/variants/index.html.haml +0 -0
  140. data/app/views/layouts/kkt_shoppe/application.html.haml +0 -0
  141. data/app/views/layouts/kkt_shoppe/printable.html.haml +1 -1
  142. data/app/views/layouts/kkt_shoppe/sub.html.haml +0 -0
  143. data/config/locales/de.yml +0 -3
  144. data/config/locales/en.yml +0 -1
  145. data/config/locales/es.yml +0 -1
  146. data/config/locales/pl.yml +0 -1
  147. data/config/locales/pt-BR.yml +1 -2
  148. data/config/routes.rb +0 -0
  149. data/db/countries.txt +0 -0
  150. data/db/migrate/20130926094549_create_kkt_shoppe_initial_schema.rb +0 -0
  151. data/db/migrate/20131024201501_add_address_type_to_kkt_shoppe_tax_rates.rb +1 -1
  152. data/db/migrate/20131024204815_create_kkt_shoppe_payments.rb +1 -1
  153. data/db/migrate/20131102143930_remove_default_on_order_item_weight.rb +1 -1
  154. data/db/migrate/20141013192427_create_kkt_shoppe_customers.rb +0 -0
  155. data/db/migrate/20141026175622_add_indexes_to_kkt_shoppe_order_items.rb +0 -0
  156. data/db/migrate/20141026175943_add_indexes_to_kkt_shoppe_orders.rb +0 -0
  157. data/db/migrate/20141026180333_add_indexes_to_kkt_shoppe_payments.rb +0 -0
  158. data/db/migrate/20141026180835_add_indexes_to_kkt_shoppe_product_attributes.rb +0 -0
  159. data/db/migrate/20141026180952_add_indexes_to_kkt_shoppe_product_categories.rb +0 -0
  160. data/db/migrate/20141026181040_add_indexes_to_kkt_shoppe_products.rb +0 -0
  161. data/db/migrate/20141026181312_add_indexes_to_kkt_shoppe_settings.rb +0 -0
  162. data/db/migrate/20141026181354_add_indexes_to_kkt_shoppe_stock_level_adjustments.rb +0 -0
  163. data/db/migrate/20141026181559_add_indexes_to_kkt_shoppe_users.rb +0 -0
  164. data/db/migrate/20141026181716_add_indexes_to_kkt_shoppe_delivery_services.rb +0 -0
  165. data/db/migrate/20141026181717_allow_multiple_kkt_shoppe_products_per_kkt_shoppe_product_category.rb +0 -0
  166. data/db/migrate/20141026181718_add_nested_to_product_categories.rb +0 -0
  167. data/db/migrate/20141027215005_create_kkt_shoppe_addresses.rb +0 -0
  168. data/db/migrate/20150315215633_add_customer_to_kkt_shoppe_orders.rb +1 -1
  169. data/db/migrate/20150513171350_create_kkt_shoppe_product_category_translation_table.rb +0 -0
  170. data/db/migrate/20150519173350_create_kkt_shoppe_product_translation_table.rb +0 -0
  171. data/db/schema.rb +42 -56
  172. data/db/seeds.rb +0 -0
  173. data/db/seeds_data/poe400.jpg +0 -0
  174. data/db/seeds_data/snom-870-blk.jpg +0 -0
  175. data/db/seeds_data/snom-870-grey.jpg +0 -0
  176. data/db/seeds_data/snom-mm2.jpg +0 -0
  177. data/db/seeds_data/spa303.jpg +0 -0
  178. data/db/seeds_data/t18p.jpg +0 -0
  179. data/db/seeds_data/t20p.jpg +0 -0
  180. data/db/seeds_data/t22p.jpg +0 -0
  181. data/db/seeds_data/t26p.jpg +0 -0
  182. data/db/seeds_data/t41pn.jpg +0 -0
  183. data/db/seeds_data/t46gn.jpg +0 -0
  184. data/db/seeds_data/w52p.jpg +0 -0
  185. data/db/seeds_data/yhs32.jpg +0 -0
  186. data/lib/kkt_shoppe/associated_countries.rb +1 -1
  187. data/lib/kkt_shoppe/country_importer.rb +0 -0
  188. data/lib/kkt_shoppe/default_navigation.rb +0 -0
  189. data/lib/kkt_shoppe/engine.rb +11 -15
  190. data/lib/kkt_shoppe/error.rb +0 -0
  191. data/lib/kkt_shoppe/errors/inappropriate_delivery_service.rb +1 -1
  192. data/lib/kkt_shoppe/errors/insufficient_stock_to_fulfil.rb +1 -1
  193. data/lib/kkt_shoppe/errors/invalid_configuration.rb +1 -1
  194. data/lib/kkt_shoppe/errors/not_enough_stock.rb +1 -1
  195. data/lib/kkt_shoppe/errors/payment_declined.rb +1 -1
  196. data/lib/kkt_shoppe/errors/refund_failed.rb +1 -1
  197. data/lib/kkt_shoppe/errors/unorderable_item.rb +1 -1
  198. data/lib/kkt_shoppe/navigation_manager.rb +0 -0
  199. data/lib/kkt_shoppe/orderable_item.rb +0 -0
  200. data/lib/kkt_shoppe/settings.rb +0 -0
  201. data/lib/kkt_shoppe/settings_loader.rb +0 -0
  202. data/lib/kkt_shoppe/setup_generator.rb +0 -0
  203. data/lib/kkt_shoppe/version.rb +1 -1
  204. data/lib/kkt_shoppe/view_helpers.rb +0 -0
  205. data/lib/kkt_shoppe.rb +1 -1
  206. data/lib/tasks/{kylekthompson_shoppe.rake → kkt_shoppe.rake} +1 -1
  207. metadata +4 -9
  208. data/app/models/shoppe/attachment.rb +0 -48
  209. data/app/uploaders/shoppe/attachment_uploader.rb +0 -29
  210. data/db/migrate/20150315223628_create_kkt_shoppe_attachments.rb +0 -16
  211. data/lib/kkt_shoppe/model_extension.rb +0 -44
  212. data/lib/shoppe/model_extension.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb53752d16704023abdca027c6e387744b60e4c9
4
- data.tar.gz: 58f330c325c07e7e3e06d6cc4a3252a07889034d
3
+ metadata.gz: 719a80796260e15ea218d4a78869c737d6eceed4
4
+ data.tar.gz: 2189a7d3cdb909664b826bd1d0e6b1e11ce0b456
5
5
  SHA512:
6
- metadata.gz: 98dd5d416ce71c145558bb2188a9898cc97f513d232a9b75d9ed8edf9bb9c69733ec85f3df2e69e3f503db3f8b824421c6c301e816bf6e4f212190bb5666d8ff
7
- data.tar.gz: b1d45698bf1f00c6b78eb29342751cb5d821d63f328995d0fb731737297c97b7646b90c1723d8df9a980ed527ee8c4a37d2236429bb3b628019af3f46b031597
6
+ metadata.gz: 47b89d3a16cf2a107ab4759b913e587d29d707d3ce27da1d131cf6cae0d7b2eca6bea5544903fa73f11e19dfeb648a93a60371b0931378cb1b959afa093859c5
7
+ data.tar.gz: 1b77c3b4d1e15fee2b434d101f9f7d6bfbd13fbe68ada0293c3d3c02f499fc2b5ae41704fc9509bc36aef3f75bd2b51286ca8b22ccea10c203fc77905a8ea949
data/MIT-LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -39,6 +39,7 @@ instructions below and you'll be up and running in minutes.
39
39
  echo "gem 'kkt_shoppe', '~> 1.0'" >> Gemfile
40
40
  bundle
41
41
  rails generate kkt_shoppe:setup
42
+ rails generate nifty:attachments:migration
42
43
  rails generate nifty:key_value_store:migration
43
44
  rake db:migrate kkt_shoppe:setup
44
45
  rails server
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -42,11 +42,6 @@ $ ->
42
42
  helper.children().each (index)->
43
43
  $(this).width(originals.eq(index).width())
44
44
  helper
45
-
46
- $('a[data-behavior=addAttachmentToExtraAttachments]').on 'click', (event) ->
47
- event.preventDefault();
48
- $('div.extraAttachments').show();
49
- $(this).hide();
50
45
 
51
46
  # Chosen
52
47
  $('select.chosen').chosen()
File without changes
File without changes
@@ -183,7 +183,7 @@ header.main {
183
183
  width:49%;
184
184
  margin:0;
185
185
  float:left;
186
- &:nth-child(2) { float:right;}
186
+ &:last-child { float:right;}
187
187
  }
188
188
 
189
189
  &.third {
@@ -299,17 +299,6 @@ header.main {
299
299
  }
300
300
  }
301
301
 
302
- div.extraAttachments{
303
- display: none;
304
-
305
- dl.half { margin-top: 15px; }
306
- }
307
-
308
- p.addAttachments {
309
- float: right;
310
- margin: 15px 25px 0 0;
311
- }
312
-
313
302
  //
314
303
  // attachment preview
315
304
  //
File without changes
File without changes
@@ -64,4 +64,4 @@ div.despatchNote {
64
64
  html { background:none;}
65
65
  body {margin:5%;}
66
66
  #content { margin:0; padding:0; outline:0;}
67
- }
67
+ }
File without changes
@@ -103,4 +103,4 @@ html.login {
103
103
  }
104
104
  }
105
105
 
106
- }
106
+ }
File without changes
@@ -44,4 +44,4 @@ module KktShoppe
44
44
  end
45
45
 
46
46
  end
47
- end
47
+ end
File without changes
@@ -2,7 +2,7 @@ module KktShoppe
2
2
  class AttachmentsController < KktShoppe::ApplicationController
3
3
 
4
4
  def destroy
5
- @attachment = Shoppe::Attachment.find_by!(token: params[:id])
5
+ @attachment = Nifty::Attachments::Attachment.find(params[:id])
6
6
  @attachment.destroy
7
7
  respond_to do |wants|
8
8
  wants.html { redirect_to request.referer, :notice => t('kkt_shoppe.attachments.remove_notice')}
File without changes
@@ -52,4 +52,4 @@ module KktShoppe
52
52
  end
53
53
 
54
54
  end
55
- end
55
+ end
File without changes
File without changes
File without changes
@@ -5,7 +5,7 @@ module KktShoppe
5
5
  before_filter { params[:id] && @product = KktShoppe::Product.root.find(params[:id]) }
6
6
 
7
7
  def index
8
- @products = KktShoppe::Product.root.includes(:translations, :stock_level_adjustments, :product_categories, :variants).order(:name).group_by(&:product_category).sort_by { |cat,pro| cat.name }
8
+ @products = KktShoppe::Product.root.includes(:translations, :stock_level_adjustments, :default_image, :product_categories, :variants).order(:name).group_by(&:product_category).sort_by { |cat,pro| cat.name }
9
9
  end
10
10
 
11
11
  def new
@@ -51,8 +51,7 @@ module KktShoppe
51
51
  private
52
52
 
53
53
  def safe_params
54
- file_params = [:file, :parent_id, :role, :parent_type, :file => []]
55
- params[:product].permit(:name, :sku, :permalink, :description, :short_description, :weight, :price, :cost_price, :tax_rate_id, :stock_control, :active, :featured, :in_the_box, :attachments => [:default_image => file_params, :data_sheet => file_params, :extra => file_params], :product_attributes_array => [:key, :value, :searchable, :public], :product_category_ids => [])
54
+ params[:product].permit(:name, :sku, :permalink, :description, :short_description, :weight, :price, :cost_price, :tax_rate_id, :stock_control, :default_image_file, :data_sheet_file, :active, :featured, :in_the_box, :product_attributes_array => [:key, :value, :searchable, :public], :product_category_ids => [])
56
55
  end
57
56
 
58
57
  end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -10,19 +10,19 @@ module KktShoppe
10
10
  end
11
11
 
12
12
  def attachment_preview(attachment, options = {})
13
- if attachment.present? and attachment.token.present?
13
+ if attachment
14
14
  String.new.tap do |s|
15
15
  if attachment.image?
16
- style = "style='background-image:url(#{attachment.file.thumb.url})'"
16
+ style = "style='background-image:url(#{attachment.path})'"
17
17
  else
18
18
  style = ''
19
19
  end
20
20
  s << "<div class='attachmentPreview #{attachment.image? ? 'image' : 'doc'}'>"
21
21
  s << "<div class='imgContainer'><div class='img' #{style}></div></div>"
22
22
  s << "<div class='desc'>"
23
- s << "<span class='filename'><a href='#{attachment.file.url}'>#{attachment.file_name}</a></span>"
23
+ s << "<span class='filename'><a href='#{attachment_path(attachment)}'>#{attachment.file_name}</a></span>"
24
24
  s << "<span class='delete'>"
25
- s << link_to(t('helpers.attachment_preview.delete', :default => 'Delete this file?'), attachment_path(attachment.token), :method => :delete, :data => {:confirm => t('helpers.attachment_preview.delete_confirm', :default => "Are you sure you wish to remove this attachment?")})
25
+ s << link_to(t('helpers.attachment_preview.delete', :default => 'Delete this file?'), attachment_path(attachment), :method => :delete, :data => {:confirm => t('helpers.attachment_preview.delete_confirm', :default => "Are you sure you wish to remove this attachment?")})
26
26
  s << "</span>"
27
27
  s << "</div>"
28
28
  s << "</div>"
@@ -33,4 +33,4 @@ module KktShoppe
33
33
  end
34
34
 
35
35
  end
36
- end
36
+ end
File without changes
File without changes
File without changes
File without changes
@@ -38,4 +38,4 @@ module KktShoppe
38
38
  end
39
39
 
40
40
  end
41
- end
41
+ end
File without changes
File without changes
@@ -60,7 +60,7 @@ module KktShoppe
60
60
  self.status = 'accepted'
61
61
  self.save!
62
62
  self.order_items.each(&:accept!)
63
- #deliver_accepted_order_email
63
+ deliver_accepted_order_email
64
64
  end
65
65
  end
66
66
 
@@ -74,7 +74,7 @@ module KktShoppe
74
74
  self.status = 'rejected'
75
75
  self.save!
76
76
  self.order_items.each(&:reject!)
77
- #deliver_rejected_order_email
77
+ deliver_rejected_order_email
78
78
  end
79
79
  end
80
80
 
File without changes
@@ -221,7 +221,7 @@ module KktShoppe
221
221
  self.status = 'shipped'
222
222
  self.consignment_number = consignment_number
223
223
  self.save!
224
- #KktShoppe::OrderMailer.shipped(self).deliver_now
224
+ KktShoppe::OrderMailer.shipped(self).deliver_now
225
225
  end
226
226
  end
227
227
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -10,8 +10,9 @@ module KktShoppe
10
10
  require_dependency 'kkt_shoppe/product/product_attributes'
11
11
  require_dependency 'kkt_shoppe/product/variants'
12
12
 
13
- # Attachments for this product
14
- has_many :attachments, :as => :parent, :dependent => :destroy, :autosave => true, :class_name => "Shoppe::Attachment"
13
+ # Products have a default_image and a data_sheet
14
+ attachment :default_image
15
+ attachment :data_sheet
15
16
 
16
17
  # The product's categorizations
17
18
  #
@@ -62,13 +63,6 @@ module KktShoppe
62
63
  translates :name, :permalink, :description, :short_description
63
64
  scope :ordered, -> { includes(:translations).order(:name) }
64
65
 
65
- def attachments=(attrs)
66
- if attrs["default_image"]["file"].present? then self.attachments.build(attrs["default_image"]) end
67
- if attrs["data_sheet"]["file"].present? then self.attachments.build(attrs["data_sheet"]) end
68
-
69
- if attrs["extra"]["file"].present? then attrs["extra"]["file"].each { |attr| self.attachments.build(file: attr, parent_id: attrs["extra"]["parent_id"], parent_type: attrs["extra"]["parent_type"]) } end
70
- end
71
-
72
66
  # Return the name of the product
73
67
  #
74
68
  # @return [String]
@@ -114,20 +108,6 @@ module KktShoppe
114
108
  self.product_categories.first rescue nil
115
109
  end
116
110
 
117
- # Return attachment for the default_image role
118
- #
119
- # @return [String]
120
- def default_image
121
- self.attachments.for("default_image")
122
- end
123
-
124
- # Return attachment for the data_sheet role
125
- #
126
- # @return [String]
127
- def data_sheet
128
- self.attachments.for("data_sheet")
129
- end
130
-
131
111
  # Search for products which include the given attributes and return an active record
132
112
  # scope of these products. Chainable with other scopes and with_attributes methods.
133
113
  # For example:
File without changes
File without changes
@@ -12,8 +12,8 @@ module KktShoppe
12
12
 
13
13
  self.table_name = 'kkt_shoppe_product_categories'
14
14
 
15
- # Attachments for this product category
16
- has_many :attachments, :as => :parent, :dependent => :destroy, :class_name => "Shoppe::Attachment"
15
+ # Categories have an image attachment
16
+ attachment :image
17
17
 
18
18
  # All products within this category
19
19
  has_many :product_categorizations, dependent: :restrict_with_exception, class_name: 'KktShoppe::ProductCategorization', inverse_of: :product_category
@@ -51,13 +51,6 @@ module KktShoppe
51
51
  parent.hierarchy_array.concat [self]
52
52
  end
53
53
 
54
- # Attachment with the role image
55
- #
56
- # @return [String]
57
- def image
58
- self.attachments.for("image")
59
- end
60
-
61
54
  private
62
55
 
63
56
  def set_permalink
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -50,4 +50,4 @@
50
50
  - for item in order.order_items
51
51
  %li #{item.quantity} x #{item.ordered_item.full_name}
52
52
  %td= number_to_currency order.total
53
- %td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
53
+ %td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
File without changes
File without changes
@@ -2,8 +2,11 @@ Hello <%=@order.first_name%>!
2
2
 
3
3
  Re: Order #<%=@order.number%>
4
4
 
5
- We're just emailing you to let you know that we have received your order!
5
+ We're pleased to let you know that we have received your order and one of our team will be accepting it shortly.
6
+
7
+ We will e-mail you again when your order has been accepted.
8
+
9
+ Many thanks,
6
10
 
7
- Thanks,
8
11
  <%=KktShoppe.settings.store_name%>
9
12
  <%=KktShoppe.settings.email_address%>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -47,4 +47,4 @@
47
47
  %p.submit
48
48
  - unless @product_category.new_record?
49
49
  %span.right= link_to t('kkt_shoppe.delete') , @product_category, :class => 'button purple', :method => :delete, :data => {:confirm => t('kkt_shoppe.product_category.delete_confirmation') }
50
- = f.submit t('kkt_shoppe.submit'), :class => 'button green'
50
+ = f.submit t('kkt_shoppe.submit'), :class => 'button green'
@@ -29,4 +29,4 @@
29
29
  %p.submit
30
30
  - unless @localisation.new_record?
31
31
  %span.right= link_to t('kkt_shoppe.delete'), product_localisation_path(@product, @localisation), :class => 'button purple', :method => :delete, :data => {:confirm => t('kkt_shoppe.localisations.delete_confirmation')}
32
- = f.submit t('kkt_shoppe.localisations.save_localisation'), :class => 'button green'
32
+ = f.submit t('kkt_shoppe.localisations.save_localisation'), :class => 'button green'
@@ -57,35 +57,15 @@
57
57
  = field_set_tag t('kkt_shoppe.products.attachments') do
58
58
  .splitContainer
59
59
  %dl.half
60
- %dt= f.label "attachments[default_image][file]", t('kkt_shoppe.products.default_image')
60
+ %dt= f.label :default_image_file, t('kkt_shoppe.products.default_image')
61
61
  %dd
62
62
  = attachment_preview @product.default_image
63
- %p= f.file_field "attachments[default_image][file]"
64
- = f.hidden_field "attachments[default_image][role]", value: "default_image"
65
- = f.hidden_field "attachments[default_image][parent_id]", value: @product.id
63
+ %p= f.file_field :default_image_file
66
64
  %dl.half
67
- %dt= f.label "attachments[data_sheet][file]", t('kkt_shoppe.products.datasheet')
65
+ %dt= f.label :data_sheet_file, t('kkt_shoppe.products.datasheet')
68
66
  %dd
69
67
  = attachment_preview @product.data_sheet
70
- %p= f.file_field "attachments[data_sheet][file]"
71
- = f.hidden_field "attachments[data_sheet][role]", value: "data_sheet"
72
- = f.hidden_field "attachments[data_sheet][parent_id]", value: @product.id
73
-
74
- .splitContainer.extraAttachments
75
- %dl.half
76
- %dd
77
- = attachment_preview nil, hide_if_blank: false
78
- %p= f.file_field "attachments[extra][file]", :multiple => true
79
- = f.hidden_field "attachments[extra][parent_type]", value: "KktShoppe::Product"
80
- = f.hidden_field "attachments[extra][parent_id]", value: @product.id
81
-
82
- - @product.attachments.each do |attachment|
83
- - unless ["default_image", "data_sheet"].include?(attachment.role)
84
- %dl.half
85
- %dd
86
- = attachment_preview attachment
87
-
88
- %p.addAttachments= link_to t('kkt_shoppe.products.add_attachments') , '#', :data => {:behavior => 'addAttachmentToExtraAttachments'}, :class => 'button button-mini green'
68
+ %p= f.file_field :data_sheet_file
89
69
 
90
70
  - unless @product.has_variants?
91
71
  = field_set_tag t('kkt_shoppe.products.pricing') do
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes