kylekthompson_shoppe 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +55 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/images/kylekthompson_shoppe/chosen-sprite.png +0 -0
  6. data/app/assets/images/kylekthompson_shoppe/chosen-sprite@2x.png +0 -0
  7. data/app/assets/images/kylekthompson_shoppe/document.svg +1 -0
  8. data/app/assets/images/kylekthompson_shoppe/icons/bag.svg +1 -0
  9. data/app/assets/images/kylekthompson_shoppe/icons/balance.svg +1 -0
  10. data/app/assets/images/kylekthompson_shoppe/icons/box.svg +1 -0
  11. data/app/assets/images/kylekthompson_shoppe/icons/building.svg +1 -0
  12. data/app/assets/images/kylekthompson_shoppe/icons/chart.svg +1 -0
  13. data/app/assets/images/kylekthompson_shoppe/icons/chat.svg +1 -0
  14. data/app/assets/images/kylekthompson_shoppe/icons/checkbox.svg +1 -0
  15. data/app/assets/images/kylekthompson_shoppe/icons/checkbox2.svg +1 -0
  16. data/app/assets/images/kylekthompson_shoppe/icons/cloud.svg +1 -0
  17. data/app/assets/images/kylekthompson_shoppe/icons/cone.svg +1 -0
  18. data/app/assets/images/kylekthompson_shoppe/icons/credit_card.svg +1 -0
  19. data/app/assets/images/kylekthompson_shoppe/icons/currency.svg +1 -0
  20. data/app/assets/images/kylekthompson_shoppe/icons/edit.svg +14 -0
  21. data/app/assets/images/kylekthompson_shoppe/icons/flowchart.svg +1 -0
  22. data/app/assets/images/kylekthompson_shoppe/icons/gift.svg +1 -0
  23. data/app/assets/images/kylekthompson_shoppe/icons/globe.svg +1 -0
  24. data/app/assets/images/kylekthompson_shoppe/icons/id.svg +1 -0
  25. data/app/assets/images/kylekthompson_shoppe/icons/id2.svg +1 -0
  26. data/app/assets/images/kylekthompson_shoppe/icons/locked.svg +1 -0
  27. data/app/assets/images/kylekthompson_shoppe/icons/report.svg +1 -0
  28. data/app/assets/images/kylekthompson_shoppe/icons/search.svg +1 -0
  29. data/app/assets/images/kylekthompson_shoppe/icons/support.svg +1 -0
  30. data/app/assets/images/kylekthompson_shoppe/icons/tags.svg +1 -0
  31. data/app/assets/images/kylekthompson_shoppe/icons/toolbox.svg +1 -0
  32. data/app/assets/images/kylekthompson_shoppe/icons/unlocked.svg +1 -0
  33. data/app/assets/images/kylekthompson_shoppe/icons/wallet.svg +1 -0
  34. data/app/assets/images/kylekthompson_shoppe/kylekthompson_shoppe.svg +25 -0
  35. data/app/assets/images/kylekthompson_shoppe/logo.svg +47 -0
  36. data/app/assets/images/kylekthompson_shoppe/move.svg +1 -0
  37. data/app/assets/images/kylekthompson_shoppe/square.svg +9 -0
  38. data/app/assets/images/kylekthompson_shoppe/statuses/accepted.svg +14 -0
  39. data/app/assets/images/kylekthompson_shoppe/statuses/paid.svg +16 -0
  40. data/app/assets/images/kylekthompson_shoppe/statuses/received.svg +15 -0
  41. data/app/assets/images/kylekthompson_shoppe/statuses/rejected.svg +14 -0
  42. data/app/assets/images/kylekthompson_shoppe/statuses/shipped.svg +14 -0
  43. data/app/assets/images/kylekthompson_shoppe/table-tear-off.png +0 -0
  44. data/app/assets/javascripts/kylekthompson_shoppe/application.coffee +123 -0
  45. data/app/assets/javascripts/kylekthompson_shoppe/chosen.jquery.js +1166 -0
  46. data/app/assets/javascripts/kylekthompson_shoppe/jquery_ui.js +6 -0
  47. data/app/assets/javascripts/kylekthompson_shoppe/mousetrap.js +9 -0
  48. data/app/assets/javascripts/kylekthompson_shoppe/order_form.coffee +47 -0
  49. data/app/assets/stylesheets/kylekthompson_shoppe/application.scss +601 -0
  50. data/app/assets/stylesheets/kylekthompson_shoppe/chosen.scss +424 -0
  51. data/app/assets/stylesheets/kylekthompson_shoppe/dialog.scss +25 -0
  52. data/app/assets/stylesheets/kylekthompson_shoppe/elements.scss +79 -0
  53. data/app/assets/stylesheets/kylekthompson_shoppe/printable.scss +67 -0
  54. data/app/assets/stylesheets/kylekthompson_shoppe/reset.scss +93 -0
  55. data/app/assets/stylesheets/kylekthompson_shoppe/sub.scss +106 -0
  56. data/app/assets/stylesheets/kylekthompson_shoppe/variables.scss +1 -0
  57. data/app/controllers/kylekthompson_shoppe/addresses_controller.rb +47 -0
  58. data/app/controllers/kylekthompson_shoppe/application_controller.rb +46 -0
  59. data/app/controllers/kylekthompson_shoppe/attachments_controller.rb +14 -0
  60. data/app/controllers/kylekthompson_shoppe/countries_controller.rb +47 -0
  61. data/app/controllers/kylekthompson_shoppe/customers_controller.rb +55 -0
  62. data/app/controllers/kylekthompson_shoppe/dashboard_controller.rb +9 -0
  63. data/app/controllers/kylekthompson_shoppe/delivery_service_prices_controller.rb +45 -0
  64. data/app/controllers/kylekthompson_shoppe/delivery_services_controller.rb +47 -0
  65. data/app/controllers/kylekthompson_shoppe/orders_controller.rb +119 -0
  66. data/app/controllers/kylekthompson_shoppe/payments_controller.rb +33 -0
  67. data/app/controllers/kylekthompson_shoppe/product_categories_controller.rb +47 -0
  68. data/app/controllers/kylekthompson_shoppe/product_category_localisations_controller.rb +58 -0
  69. data/app/controllers/kylekthompson_shoppe/product_localisations_controller.rb +58 -0
  70. data/app/controllers/kylekthompson_shoppe/products_controller.rb +58 -0
  71. data/app/controllers/kylekthompson_shoppe/sessions_controller.rb +34 -0
  72. data/app/controllers/kylekthompson_shoppe/settings_controller.rb +16 -0
  73. data/app/controllers/kylekthompson_shoppe/stock_level_adjustments_controller.rb +40 -0
  74. data/app/controllers/kylekthompson_shoppe/tax_rates_controller.rb +49 -0
  75. data/app/controllers/kylekthompson_shoppe/users_controller.rb +53 -0
  76. data/app/controllers/kylekthompson_shoppe/variants_controller.rb +50 -0
  77. data/app/helpers/kylekthompson_shoppe/application_helper.rb +60 -0
  78. data/app/helpers/kylekthompson_shoppe/product_category_helper.rb +36 -0
  79. data/app/mailers/kylekthompson_shoppe/order_mailer.rb +25 -0
  80. data/app/mailers/kylekthompson_shoppe/user_mailer.rb +10 -0
  81. data/app/models/kylekthompson_shoppe/address.rb +44 -0
  82. data/app/models/kylekthompson_shoppe/country.rb +27 -0
  83. data/app/models/kylekthompson_shoppe/customer.rb +41 -0
  84. data/app/models/kylekthompson_shoppe/delivery_service.rb +33 -0
  85. data/app/models/kylekthompson_shoppe/delivery_service_price.rb +31 -0
  86. data/app/models/kylekthompson_shoppe/order/actions.rb +94 -0
  87. data/app/models/kylekthompson_shoppe/order/billing.rb +105 -0
  88. data/app/models/kylekthompson_shoppe/order/delivery.rb +229 -0
  89. data/app/models/kylekthompson_shoppe/order/states.rb +69 -0
  90. data/app/models/kylekthompson_shoppe/order.rb +100 -0
  91. data/app/models/kylekthompson_shoppe/order_item.rb +239 -0
  92. data/app/models/kylekthompson_shoppe/payment.rb +86 -0
  93. data/app/models/kylekthompson_shoppe/product/product_attributes.rb +20 -0
  94. data/app/models/kylekthompson_shoppe/product/variants.rb +51 -0
  95. data/app/models/kylekthompson_shoppe/product.rb +189 -0
  96. data/app/models/kylekthompson_shoppe/product_attribute.rb +66 -0
  97. data/app/models/kylekthompson_shoppe/product_categorization.rb +14 -0
  98. data/app/models/kylekthompson_shoppe/product_category.rb +75 -0
  99. data/app/models/kylekthompson_shoppe/setting.rb +68 -0
  100. data/app/models/kylekthompson_shoppe/stock_level_adjustment.rb +19 -0
  101. data/app/models/kylekthompson_shoppe/tax_rate.rb +46 -0
  102. data/app/models/kylekthompson_shoppe/user.rb +49 -0
  103. data/app/validators/permalink_validator.rb +7 -0
  104. data/app/views/kylekthompson_shoppe/addresses/_form.html.haml +33 -0
  105. data/app/views/kylekthompson_shoppe/addresses/edit.html.haml +5 -0
  106. data/app/views/kylekthompson_shoppe/addresses/new.html.haml +5 -0
  107. data/app/views/kylekthompson_shoppe/countries/_form.html.haml +35 -0
  108. data/app/views/kylekthompson_shoppe/countries/edit.html.haml +6 -0
  109. data/app/views/kylekthompson_shoppe/countries/index.html.haml +25 -0
  110. data/app/views/kylekthompson_shoppe/countries/new.html.haml +7 -0
  111. data/app/views/kylekthompson_shoppe/customers/_addresses.html.haml +20 -0
  112. data/app/views/kylekthompson_shoppe/customers/_form.html.haml +30 -0
  113. data/app/views/kylekthompson_shoppe/customers/_search_form.html.haml +13 -0
  114. data/app/views/kylekthompson_shoppe/customers/edit.html.haml +5 -0
  115. data/app/views/kylekthompson_shoppe/customers/index.html.haml +32 -0
  116. data/app/views/kylekthompson_shoppe/customers/new.html.haml +5 -0
  117. data/app/views/kylekthompson_shoppe/customers/show.html.haml +53 -0
  118. data/app/views/kylekthompson_shoppe/delivery_service_prices/_form.html.haml +44 -0
  119. data/app/views/kylekthompson_shoppe/delivery_service_prices/edit.html.haml +6 -0
  120. data/app/views/kylekthompson_shoppe/delivery_service_prices/index.html.haml +23 -0
  121. data/app/views/kylekthompson_shoppe/delivery_service_prices/new.html.haml +6 -0
  122. data/app/views/kylekthompson_shoppe/delivery_services/_form.html.haml +38 -0
  123. data/app/views/kylekthompson_shoppe/delivery_services/edit.html.haml +9 -0
  124. data/app/views/kylekthompson_shoppe/delivery_services/index.html.haml +27 -0
  125. data/app/views/kylekthompson_shoppe/delivery_services/new.html.haml +6 -0
  126. data/app/views/kylekthompson_shoppe/order_mailer/accepted.text.erb +12 -0
  127. data/app/views/kylekthompson_shoppe/order_mailer/received.text.erb +9 -0
  128. data/app/views/kylekthompson_shoppe/order_mailer/rejected.text.erb +10 -0
  129. data/app/views/kylekthompson_shoppe/order_mailer/shipped.text.erb +16 -0
  130. data/app/views/kylekthompson_shoppe/orders/_form.html.haml +58 -0
  131. data/app/views/kylekthompson_shoppe/orders/_order_details.html.haml +57 -0
  132. data/app/views/kylekthompson_shoppe/orders/_order_items.html.haml +38 -0
  133. data/app/views/kylekthompson_shoppe/orders/_order_items_form.html.haml +61 -0
  134. data/app/views/kylekthompson_shoppe/orders/_payments_form.html.haml +15 -0
  135. data/app/views/kylekthompson_shoppe/orders/_payments_table.html.haml +37 -0
  136. data/app/views/kylekthompson_shoppe/orders/_search_form.html.haml +24 -0
  137. data/app/views/kylekthompson_shoppe/orders/_status_bar.html.haml +35 -0
  138. data/app/views/kylekthompson_shoppe/orders/despatch_note.html.haml +45 -0
  139. data/app/views/kylekthompson_shoppe/orders/edit.html.haml +21 -0
  140. data/app/views/kylekthompson_shoppe/orders/index.html.haml +39 -0
  141. data/app/views/kylekthompson_shoppe/orders/new.html.haml +14 -0
  142. data/app/views/kylekthompson_shoppe/orders/show.html.haml +25 -0
  143. data/app/views/kylekthompson_shoppe/payments/refund.html.haml +13 -0
  144. data/app/views/kylekthompson_shoppe/product_categories/_form.html.haml +50 -0
  145. data/app/views/kylekthompson_shoppe/product_categories/edit.html.haml +8 -0
  146. data/app/views/kylekthompson_shoppe/product_categories/index.html.haml +27 -0
  147. data/app/views/kylekthompson_shoppe/product_categories/new.html.haml +6 -0
  148. data/app/views/kylekthompson_shoppe/product_category_localisations/form.html.haml +29 -0
  149. data/app/views/kylekthompson_shoppe/product_category_localisations/index.html.haml +26 -0
  150. data/app/views/kylekthompson_shoppe/product_localisations/form.html.haml +32 -0
  151. data/app/views/kylekthompson_shoppe/product_localisations/index.html.haml +26 -0
  152. data/app/views/kylekthompson_shoppe/products/_form.html.haml +118 -0
  153. data/app/views/kylekthompson_shoppe/products/_table.html.haml +42 -0
  154. data/app/views/kylekthompson_shoppe/products/edit.html.haml +9 -0
  155. data/app/views/kylekthompson_shoppe/products/import.html.haml +67 -0
  156. data/app/views/kylekthompson_shoppe/products/index.html.haml +9 -0
  157. data/app/views/kylekthompson_shoppe/products/new.html.haml +7 -0
  158. data/app/views/kylekthompson_shoppe/sessions/new.html.haml +12 -0
  159. data/app/views/kylekthompson_shoppe/sessions/reset.html.haml +12 -0
  160. data/app/views/kylekthompson_shoppe/settings/edit.html.haml +19 -0
  161. data/app/views/kylekthompson_shoppe/shared/error.html.haml +6 -0
  162. data/app/views/kylekthompson_shoppe/stock_level_adjustments/index.html.haml +40 -0
  163. data/app/views/kylekthompson_shoppe/tax_rates/form.html.haml +28 -0
  164. data/app/views/kylekthompson_shoppe/tax_rates/index.html.haml +17 -0
  165. data/app/views/kylekthompson_shoppe/user_mailer/new_password.text.erb +9 -0
  166. data/app/views/kylekthompson_shoppe/users/_form.html.haml +27 -0
  167. data/app/views/kylekthompson_shoppe/users/edit.html.haml +5 -0
  168. data/app/views/kylekthompson_shoppe/users/index.html.haml +17 -0
  169. data/app/views/kylekthompson_shoppe/users/new.html.haml +7 -0
  170. data/app/views/kylekthompson_shoppe/variants/form.html.haml +68 -0
  171. data/app/views/kylekthompson_shoppe/variants/index.html.haml +33 -0
  172. data/app/views/layouts/kylekthompson_shoppe/application.html.haml +34 -0
  173. data/app/views/layouts/kylekthompson_shoppe/printable.html.haml +11 -0
  174. data/app/views/layouts/kylekthompson_shoppe/sub.html.haml +10 -0
  175. data/config/locales/de.yml +653 -0
  176. data/config/locales/en.yml +744 -0
  177. data/config/locales/es.yml +653 -0
  178. data/config/locales/pl.yml +662 -0
  179. data/config/locales/pt-BR.yml +655 -0
  180. data/config/routes.rb +53 -0
  181. data/db/countries.txt +252 -0
  182. data/db/migrate/20130926094549_create_kylekthompson_shoppe_initial_schema.rb +175 -0
  183. data/db/migrate/20131024201501_add_address_type_to_kylekthompson_shoppe_tax_rates.rb +5 -0
  184. data/db/migrate/20131024204815_create_kylekthompson_shoppe_payments.rb +32 -0
  185. data/db/migrate/20131102143930_remove_default_on_order_item_weight.rb +9 -0
  186. data/db/migrate/20141013192427_create_kylekthompson_shoppe_customers.rb +14 -0
  187. data/db/migrate/20141026175622_add_indexes_to_kylekthompson_shoppe_order_items.rb +6 -0
  188. data/db/migrate/20141026175943_add_indexes_to_kylekthompson_shoppe_orders.rb +7 -0
  189. data/db/migrate/20141026180333_add_indexes_to_kylekthompson_shoppe_payments.rb +6 -0
  190. data/db/migrate/20141026180835_add_indexes_to_kylekthompson_shoppe_product_attributes.rb +7 -0
  191. data/db/migrate/20141026180952_add_indexes_to_kylekthompson_shoppe_product_categories.rb +5 -0
  192. data/db/migrate/20141026181040_add_indexes_to_kylekthompson_shoppe_products.rb +8 -0
  193. data/db/migrate/20141026181312_add_indexes_to_kylekthompson_shoppe_settings.rb +5 -0
  194. data/db/migrate/20141026181354_add_indexes_to_kylekthompson_shoppe_stock_level_adjustments.rb +6 -0
  195. data/db/migrate/20141026181559_add_indexes_to_kylekthompson_shoppe_users.rb +5 -0
  196. data/db/migrate/20141026181716_add_indexes_to_kylekthompson_shoppe_delivery_services.rb +9 -0
  197. data/db/migrate/20141026181717_allow_multiple_kylekthompson_shoppe_products_per_shoppe_product_category.rb +46 -0
  198. data/db/migrate/20141026181718_add_nested_to_product_categories.rb +30 -0
  199. data/db/migrate/20141027215005_create_kylekthompson_shoppe_addresses.rb +17 -0
  200. data/db/migrate/20150315215633_add_customer_to_kylekthompson_shoppe_orders.rb +5 -0
  201. data/db/migrate/20150513171350_create_kylekthompson_shoppe_product_category_translation_table.rb +17 -0
  202. data/db/migrate/20150519173350_create_kylekthompson_shoppe_product_translation_table.rb +18 -0
  203. data/db/schema.rb +308 -0
  204. data/db/seeds.rb +137 -0
  205. data/db/seeds_data/poe400.jpg +0 -0
  206. data/db/seeds_data/snom-870-blk.jpg +0 -0
  207. data/db/seeds_data/snom-870-grey.jpg +0 -0
  208. data/db/seeds_data/snom-mm2.jpg +0 -0
  209. data/db/seeds_data/spa303.jpg +0 -0
  210. data/db/seeds_data/t18p.jpg +0 -0
  211. data/db/seeds_data/t20p.jpg +0 -0
  212. data/db/seeds_data/t22p.jpg +0 -0
  213. data/db/seeds_data/t26p.jpg +0 -0
  214. data/db/seeds_data/t41pn.jpg +0 -0
  215. data/db/seeds_data/t46gn.jpg +0 -0
  216. data/db/seeds_data/w52p.jpg +0 -0
  217. data/db/seeds_data/yhs32.jpg +0 -0
  218. data/lib/kylekthompson_shoppe/associated_countries.rb +20 -0
  219. data/lib/kylekthompson_shoppe/country_importer.rb +15 -0
  220. data/lib/kylekthompson_shoppe/default_navigation.rb +21 -0
  221. data/lib/kylekthompson_shoppe/engine.rb +55 -0
  222. data/lib/kylekthompson_shoppe/error.rb +21 -0
  223. data/lib/kylekthompson_shoppe/errors/inappropriate_delivery_service.rb +6 -0
  224. data/lib/kylekthompson_shoppe/errors/insufficient_stock_to_fulfil.rb +15 -0
  225. data/lib/kylekthompson_shoppe/errors/invalid_configuration.rb +6 -0
  226. data/lib/kylekthompson_shoppe/errors/not_enough_stock.rb +15 -0
  227. data/lib/kylekthompson_shoppe/errors/payment_declined.rb +6 -0
  228. data/lib/kylekthompson_shoppe/errors/refund_failed.rb +6 -0
  229. data/lib/kylekthompson_shoppe/errors/unorderable_item.rb +6 -0
  230. data/lib/kylekthompson_shoppe/navigation_manager.rb +81 -0
  231. data/lib/kylekthompson_shoppe/orderable_item.rb +39 -0
  232. data/lib/kylekthompson_shoppe/settings.rb +26 -0
  233. data/lib/kylekthompson_shoppe/settings_loader.rb +16 -0
  234. data/lib/kylekthompson_shoppe/setup_generator.rb +10 -0
  235. data/lib/kylekthompson_shoppe/version.rb +3 -0
  236. data/lib/kylekthompson_shoppe/view_helpers.rb +16 -0
  237. data/lib/kylekthompson_shoppe.rb +60 -0
  238. data/lib/tasks/kylekthompson_shoppe.rake +29 -0
  239. metadata +662 -0
@@ -0,0 +1,24 @@
1
+ .orderSearch{:style => action_name == 'search' ? "display:block" : ''}
2
+ = search_form_for @query, :url => search_orders_path, :html => { :method => :post } do |f|
3
+ %dl.left
4
+ %dt= f.label :id_eq, t('kylekthompson_shoppe.orders.order_number')
5
+ %dd= f.text_field :id_eq
6
+ %dt= f.label :first_name_or_last_name_or_company_cont, t('kylekthompson_shoppe.orders.customer')
7
+ %dd= f.text_field :first_name_or_last_name_or_company_cont
8
+ %dt= f.label :address1_or_address2_or_address3_or_address4_or_postcode_cont, t('kylekthompson_shoppe.orders.billing_address')
9
+ %dd= f.text_field :billing_address1_or_billing_address2_or_billing_address3_or_billing_address4_or_billing_postcode_cont
10
+ %dt= f.label :consignment_number_cont, t('kylekthompson_shoppe.orders.consignment_number')
11
+ %dd= f.text_field :consignment_number_cont
12
+ %dt= f.label :received_at_eq, t('kylekthompson_shoppe.orders.received_between')
13
+ %dd
14
+ = f.text_field :received_at_gteq, :class => 'small'
15
+ →
16
+ = f.text_field :received_at_lteq, :class => 'small'
17
+ %dl.right
18
+ %dt= f.label :email_address_cont, t('kylekthompson_shoppe.orders.email_address')
19
+ %dd= f.text_field :email_address_cont
20
+ %dt= f.label :phone_number_cont, t('kylekthompson_shoppe.orders.phone_number')
21
+ %dd= f.text_field :phone_number_cont
22
+ %dt= f.label :status_eq, t('kylekthompson_shoppe.orders.status')
23
+ %dd= f.select :status_eq, [nil] + KylekthompsonShoppe::Order::STATUSES.map { |s| [t("kylekthompson_shoppe.orders.statuses.#{s}"), s]}
24
+ %dd= f.submit t('kylekthompson_shoppe.orders.search'), :class => 'button green button'
@@ -0,0 +1,35 @@
1
+ .status-bar
2
+ %ul
3
+ - if @order.received?
4
+ %li.received
5
+ %h4= t('kylekthompson_shoppe.orders.order_received')
6
+ %p
7
+ = t('kylekthompson_shoppe.orders.status_bar.on_date', on: @order.received_at.to_s(:short))
8
+ = t('kylekthompson_shoppe.orders.status_bar.from_ip', ip: @order.ip_address)
9
+
10
+ - if @order.accepted?
11
+ %li.accepted
12
+ %h4= t('kylekthompson_shoppe.orders.order_accepted')
13
+ %p
14
+ = t('kylekthompson_shoppe.orders.status_bar.on_date', on: @order.accepted_at.to_s(:short))
15
+ - if @order.accepter
16
+ = t('kylekthompson_shoppe.orders.status_bar.by_user', user: @order.accepter.short_name)
17
+
18
+ - elsif @order.rejected?
19
+ %li.rejected
20
+ %h4= t('kylekthompson_shoppe.orders.order_rejected')
21
+ %p
22
+ = t('kylekthompson_shoppe.orders.status_bar.on_date', on: @order.rejected_at.to_s(:short))
23
+ - if @order.rejecter
24
+ = t('kylekthompson_shoppe.orders.status_bar.by_user', user: @order.rejecter.short_name)
25
+
26
+ - if @order.shipped?
27
+ %li.shipped
28
+ %h4= t('kylekthompson_shoppe.orders.order_shipped')
29
+ %p
30
+ = t('kylekthompson_shoppe.orders.status_bar.on_date', on: @order.shipped_at.to_s(:short))
31
+ = t('kylekthompson_shoppe.orders.status_bar.by_user', user: @order.shipper.try(:short_name) || 'Unknown')
32
+ - if @order.delivery_service && @order.courier_tracking_url
33
+ %p= link_to t('kylekthompson_shoppe.orders.status_bar.tracking_url'), @order.courier_tracking_url
34
+ - else
35
+ %p= t('kylekthompson_shoppe.orders.status_bar.consignment_no_html', consignment_number: @order.consignment_number)
@@ -0,0 +1,45 @@
1
+ - @page_title = "#{t('kylekthompson_shoppe.orders.despatch_note.order_number')} #{@order.number}"
2
+
3
+ .despatchNote
4
+ %header
5
+ %h1= KylekthompsonShoppe.settings.store_name
6
+ %h2= t("kylekthompson_shoppe.orders.despatch_note.despatch_note")
7
+ .address
8
+ %p.name= @order.delivery_name
9
+ %p= @order.delivery_address1
10
+ %p= @order.delivery_address2
11
+ %p= @order.delivery_address3
12
+ %p= @order.delivery_address4
13
+ %p= @order.delivery_postcode
14
+ %p= @order.delivery_country.try(:name)
15
+
16
+ %table.details
17
+ %tr
18
+ %th= t("kylekthompson_shoppe.orders.despatch_note.order_number")
19
+ %th= t("kylekthompson_shoppe.orders.despatch_note.order_placed")
20
+ %th= t("kylekthompson_shoppe.orders.despatch_note.total_weight")
21
+ %th= t("kylekthompson_shoppe.orders.despatch_note.telephone")
22
+ %tr
23
+ %td= @order.number
24
+ %td= @order.received? ? @order.received_at.to_s(:long) : 'n/a'
25
+ %td= number_to_weight @order.total_weight
26
+ %td= @order.phone_number
27
+
28
+ %table.items
29
+ %thead
30
+ %tr
31
+ %th= t("kylekthompson_shoppe.orders.despatch_note.quantity")
32
+ %th= t("kylekthompson_shoppe.orders.despatch_note.product")
33
+ %th= t("kylekthompson_shoppe.orders.despatch_note.sku")
34
+ %th= t("kylekthompson_shoppe.orders.despatch_note.weight")
35
+ %th= t("kylekthompson_shoppe.orders.despatch_note.packed?")
36
+ %tbody
37
+ - for item in @order.order_items
38
+ %tr
39
+ %td= item.quantity
40
+ %td= item.ordered_item.full_name
41
+ %td= item.ordered_item.sku
42
+ %td= number_to_weight item.weight
43
+ %td.check
44
+
45
+ %p.footer= t('kylekthompson_shoppe.orders.despatch_note.footer', :default => "Thank you for your order!")
@@ -0,0 +1,21 @@
1
+ - @page_title = "#{t('kylekthompson_shoppe.orders.edit_order')} ##{@order.number}"
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('kylekthompson_shoppe.orders.back_to_order'), @order, :class => 'button grey'
6
+ %h2.orders "#{t('kylekthompson_shoppe.orders.edit_order')} <b>##{@order.number}</b>"
7
+
8
+ = form_for @order, :html => {:class => 'orderForm'} do |f|
9
+ = f.error_messages
10
+ = render 'form', :f => f
11
+
12
+ = field_set_tag t('kylekthompson_shoppe.orders.notes') do
13
+ %dl
14
+ %dd= f.text_area :notes, :class => 'text'
15
+
16
+ = field_set_tag t('kylekthompson_shoppe.orders.ordered_products'), :class => 'padded' do
17
+ = render 'order_items_form', :f => f
18
+
19
+ %p.submit
20
+ = f.submit t('kylekthompson_shoppe.orders.save_order') , :class => 'button green'
21
+ = link_to t('kylekthompson_shoppe.cancel'), @order, :class => 'button'
@@ -0,0 +1,39 @@
1
+ - @page_title = t('kylekthompson_shoppe.orders.orders')
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('kylekthompson_shoppe.orders.new_order'), :new_order, :class => 'button green'
6
+ = link_to t('kylekthompson_shoppe.orders.search_orders'), '#', :class => 'button', :rel => 'searchOrders'
7
+ %h2.orders
8
+ = t('kylekthompson_shoppe.orders.orders')
9
+ %span= page_entries_info @orders
10
+
11
+ = render 'search_form'
12
+
13
+ .table
14
+ %table.data
15
+ %thead
16
+ %tr
17
+ %th= t('kylekthompson_shoppe.orders.number')
18
+ %th= t('kylekthompson_shoppe.orders.customer')
19
+ %th= t('kylekthompson_shoppe.orders.status')
20
+ %th= t('kylekthompson_shoppe.orders.products')
21
+ %th= t('kylekthompson_shoppe.orders.total')
22
+ %th= t('kylekthompson_shoppe.orders.payment')
23
+ %tbody
24
+ - if @orders.empty?
25
+ %tr.empty
26
+ %td{:colspan => 6}= t('kylekthompson_shoppe.orders.no_orders')
27
+ - else
28
+ - for order in @orders
29
+ %tr
30
+ %td= link_to order.number, order
31
+ %td= order.customer_name
32
+ %td= status_tag order.status
33
+ %td
34
+ %ul
35
+ - for item in order.order_items
36
+ %li #{item.quantity} x #{item.ordered_item.full_name}
37
+ %td= number_to_currency order.total
38
+ %td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
39
+ = paginate @orders
@@ -0,0 +1,14 @@
1
+ - @page_title = t('kylekthompson_shoppe.orders.new_order')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('kylekthompson_shoppe.orders.back_to_orders'), :orders, :class => 'button grey'
5
+ %h2.orders= t('kylekthompson_shoppe.orders.new_order')
6
+
7
+ = form_for @order, :html => {:class => 'orderForm newOrder'} do |f|
8
+ = f.error_messages
9
+ = render 'form', :f => f
10
+ = field_set_tag t('kylekthompson_shoppe.orders.ordered_products'), :class => 'padded' do
11
+ = render 'order_items_form', :f => f
12
+ %p.submit
13
+ = f.submit t('kylekthompson_shoppe.orders.create_order'), :class => 'button green'
14
+ = link_to t('kylekthompson_shoppe.cancel'), :orders, :class => 'button grey'
@@ -0,0 +1,25 @@
1
+ - @page_title = "#{t('kylekthompson_shoppe.orders.order')} ##{@order.number}"
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('kylekthompson_shoppe.edit'), [:edit, @order], :class => 'button'
6
+ - if @order.accepted?
7
+ = link_to t('kylekthompson_shoppe.orders.despatch_note.despatch_note'), [:despatch_note, @order], :class => 'button', :rel => 'print'
8
+ = link_to t('kylekthompson_shoppe.orders.back_to_orders'), :orders, :class => 'button grey'
9
+ %h2.orders= t('kylekthompson_shoppe.orders.order_no_html', order_number: @order.number)
10
+
11
+ #order
12
+
13
+ - if @order.received?
14
+ = render 'order_details'
15
+ = render 'status_bar'
16
+ - else
17
+ %p.warning= t('kylekthompson_shoppe.orders.in_progress_warning')
18
+
19
+ = field_set_tag t('kylekthompson_shoppe.orders.order_items'), :class => 'padded' do
20
+ = render 'order_items'
21
+
22
+ - if @order.received?
23
+ = field_set_tag t('kylekthompson_shoppe.orders.payments'), :class => 'padded orderPayments' do
24
+ = render 'payments_table'
25
+ = render 'payments_form'
@@ -0,0 +1,13 @@
1
+
2
+ = form_tag [:refund, @order, @payment], :class => 'refundForm' do
3
+ %h2= t('kylekthompson_shoppe.refund.issue_refund')
4
+ %p.intro
5
+ = t('kylekthompson_shoppe.refund.intro_html', amount: number_to_currency(@payment.refundable_amount))
6
+
7
+ .moneyInput
8
+ .currency= KylekthompsonShoppe.settings.currency_unit.html_safe
9
+ = text_field_tag 'amount', @payment.refundable_amount, :class => 'text'
10
+ %p.submit
11
+ = submit_tag t('kylekthompson_shoppe.refund.refund'), :class => 'button green'
12
+ = link_to t('kylekthompson_shoppe.close'), '#', :class => 'button grey', :rel => 'closeDialog'
13
+
@@ -0,0 +1,50 @@
1
+ = form_for @product_category do |f|
2
+ = f.error_messages
3
+
4
+ = field_set_tag t('kylekthompson_shoppe.product_category.category_details') do
5
+ %dl
6
+ %dt= f.label :name, t('kylekthompson_shoppe.product_category.name')
7
+ %dd= f.text_field :name, :class => 'focus text'
8
+ .splitContainer
9
+ %dl.half
10
+ %dt= f.label :permalink, t('kylekthompson_shoppe.product_category.permalink')
11
+ %dd= f.text_field :permalink, :class => 'text'
12
+ %dl.half
13
+ %dt &nbsp;
14
+ %dd.checkbox
15
+ = f.check_box :permalink_includes_ancestors
16
+ = f.label :permalink_includes_ancestors, t('kylekthompson_shoppe.product_category.permalink_includes_ancestors')
17
+ %dl.cleared
18
+ %dt= f.label :description, t('kylekthompson_shoppe.product_category.description')
19
+ %dd= f.text_area :description, :class => 'text'
20
+
21
+ = field_set_tag t('kylekthompson_shoppe.product_category.nesting.category_nesting') do
22
+ %dl
23
+ %dt= f.label :parent_id, t('kylekthompson_shoppe.product_category.nesting.category_parent')
24
+ %dd= f.collection_select :parent_id, KylekthompsonShoppe::ProductCategory.except_descendants(@product_category).ordered, :id, :name, {:include_blank => t('kylekthompson_shoppe.product_category.nesting.blank_option')}, {:class => 'chosen'}
25
+ %dl
26
+ %dt= f.label :child_ids, t('kylekthompson_shoppe.product_category.nesting.hierarchy')
27
+ %dd
28
+ %table.categoryChildren
29
+ %tbody
30
+ - if @product_category.children.count == 0
31
+ %tr
32
+ %td
33
+ = t('kylekthompson_shoppe.product_category.nesting.no_children')
34
+ - else
35
+ %tr
36
+ %td
37
+ = "#{@product_category.name} (#{t('kylekthompson_shoppe.product_category.nesting.current_category')})"
38
+ = nested_product_category_rows(@product_category, current_category = @product_category, link_to_current = false, relative_depth = @product_category.depth)
39
+
40
+ = field_set_tag t('kylekthompson_shoppe.product_category.attachments') do
41
+ %dl
42
+ %dt= f.label :image_file, t('kylekthompson_shoppe.product_category.image')
43
+ %dd
44
+ = attachment_preview @product_category.image
45
+ %p= f.file_field :image_file
46
+
47
+ %p.submit
48
+ - unless @product_category.new_record?
49
+ %span.right= link_to t('kylekthompson_shoppe.delete') , @product_category, :class => 'button purple', :method => :delete, :data => {:confirm => t('kylekthompson_shoppe.product_category.delete_confirmation') }
50
+ = f.submit t('kylekthompson_shoppe.submit'), :class => 'button green'
@@ -0,0 +1,8 @@
1
+ - @page_title = t('kylekthompson_shoppe.product_category.product_categories')
2
+ = content_for :header do
3
+ %p.buttons
4
+ = link_to t('kylekthompson_shoppe.localisations.localisations') , [@product_category, :localisations], :class => 'button'
5
+ = link_to t('kylekthompson_shoppe.product_category.back_to_categories'), :product_categories, :class => 'button'
6
+ %h2.products= t('kylekthompson_shoppe.product_category.product_categories')
7
+ = render 'form'
8
+
@@ -0,0 +1,27 @@
1
+ - @page_title = t('kylekthompson_shoppe.product_category.product_categories')
2
+
3
+ = content_for :header do
4
+ %p.buttons=link_to t('kylekthompson_shoppe.product_category.new_category'), :new_product_category, :class => 'button green'
5
+ %h2.products= t('kylekthompson_shoppe.product_category.product_categories')
6
+
7
+ .table
8
+ %table.data
9
+ %thead
10
+ %tr
11
+ %th= t('kylekthompson_shoppe.product_category.name')
12
+ - I18n.available_locales.each do |i|
13
+ %th
14
+ %tbody
15
+ - if @product_categories_without_parent.empty?
16
+ %tr.empty
17
+ %td= t('kylekthompson_shoppe.product_category.no_categories')
18
+ - else
19
+ - for cat in @product_categories_without_parent
20
+ %tr
21
+ %td= link_to cat.name, [:edit, cat]
22
+ - I18n.available_locales.each do |i|
23
+ - if cat.translations.where(locale: i).count >= 1
24
+ %td= link_to i, edit_product_category_localisation_path(cat, cat.translations.where(locale: i).first.id)
25
+ - else
26
+ %td= link_to i, new_product_category_localisation_path(cat, locale_field: i)
27
+ = nested_product_category_rows(cat)
@@ -0,0 +1,6 @@
1
+ - @page_title = t('kylekthompson_shoppe.product_category.product_categories')
2
+ = content_for :header do
3
+ %p.buttons= link_to t('kylekthompson_shoppe.product_category.back_to_categories'), :product_categories, :class => 'button'
4
+ %h2.products= t('kylekthompson_shoppe.product_category.product_categories')
5
+
6
+ = render 'form'
@@ -0,0 +1,29 @@
1
+ - @page_title = "#{t('kylekthompson_shoppe.localisations.localisations')} - #{@product_category.name}"
2
+ = content_for :header do
3
+ %p.buttons= link_to t('kylekthompson_shoppe.localisations.back_to_localisations'), [@product_category, :localisations], :class => 'button'
4
+ %h2.products= t('kylekthompson_shoppe.localisations.localisations_of', name: @product_category.name)
5
+
6
+ - loc = @localisation.new_record? ? :en : @localisation.locale.to_sym
7
+ - Globalize.with_locale(loc) do
8
+ = form_for [@product_category, @localisation], :url => @localisation.new_record? ? product_category_localisations_path(@product_category) : product_category_localisation_path(@product_category, @localisation), :html => {:multipart => true} do |f|
9
+ = f.error_messages
10
+
11
+ = field_set_tag t('kylekthompson_shoppe.product_category.category_details') do
12
+ .splitContainer
13
+ %dl.half
14
+ %dt= f.label :name, t('kylekthompson_shoppe.product_category.name')
15
+ %dd= f.text_field :name, :class => 'focus text'
16
+ %dl.half
17
+ %dt= f.label :locale
18
+ %dd= f.select :locale, I18n.available_locales, {selected: @localisation.locale || params[:locale_field]}, {class: "chosen"}
19
+ %dl
20
+ %dt= f.label :permalink, t('kylekthompson_shoppe.product_category.permalink')
21
+ %dd= f.text_field :permalink, :class => 'text'
22
+ %dl.cleared
23
+ %dt= f.label :description, t('kylekthompson_shoppe.product_category.description')
24
+ %dd= f.text_area :description, :class => 'text'
25
+
26
+ %p.submit
27
+ - unless @localisation.new_record?
28
+ %span.right= link_to t('kylekthompson_shoppe.delete'), product_category_localisation_path(@product_category, @localisation), :class => 'button purple', :method => :delete, :data => {:confirm => t('kylekthompson_shoppe.localisations.delete_confirmation')}
29
+ = f.submit t('kylekthompson_shoppe.localisations.save_localisation'), :class => 'button green'
@@ -0,0 +1,26 @@
1
+ - @page_title = "#{t('kylekthompson_shoppe.localisations.localisations')} - #{@product_category.name}"
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('kylekthompson_shoppe.localisations.back'), product_categories_path, :class => 'button'
6
+ = link_to t('kylekthompson_shoppe.localisations.new_localisation'), [:new, @product_category, :localisation], :class => 'button green'
7
+
8
+ %h2.products= t('kylekthompson_shoppe.localisations.localisations_of', name: @product_category.name)
9
+
10
+ .table
11
+ %table.data
12
+ %thead
13
+ %tr
14
+ %th{:width => '20%'}= t('kylekthompson_shoppe.localisations.language')
15
+ %th{:width => '50%'}= t('kylekthompson_shoppe.products.name')
16
+ %th{:width => '15%'}= t('kylekthompson_shoppe.products.permalink')
17
+ %tbody
18
+ - if @localisations.empty?
19
+ %tr.empty
20
+ %td{:colspan => 4}= t('kylekthompson_shoppe.localisations.no_localisations')
21
+ - else
22
+ - for localisation in @localisations
23
+ %tr
24
+ %td= localisation.locale
25
+ %td= link_to localisation.name, edit_product_category_localisation_path(@product_category, localisation)
26
+ %td= localisation.permalink
@@ -0,0 +1,32 @@
1
+ - @page_title = "#{t('kylekthompson_shoppe.localisations.localisations')} - #{@product.name}"
2
+ = content_for :header do
3
+ %p.buttons= link_to t('kylekthompson_shoppe.localisations.back_to_localisations'), [@product, :localisations], :class => 'button'
4
+ %h2.products= t('kylekthompson_shoppe.localisations.localisations_of', name: @product.name)
5
+
6
+ - loc = @localisation.new_record? ? :en : @localisation.locale.to_sym
7
+ - Globalize.with_locale(loc) do
8
+ = form_for [@product, @localisation], :url => @localisation.new_record? ? product_localisations_path(@product) : product_localisation_path(@product, @localisation), :html => {:multipart => true} do |f|
9
+ = f.error_messages
10
+
11
+ = field_set_tag t('kylekthompson_shoppe.product.category_details') do
12
+ .splitContainer
13
+ %dl.half
14
+ %dt= f.label :name, t('kylekthompson_shoppe.product.name')
15
+ %dd= f.text_field :name, :class => 'focus text'
16
+ %dl.half
17
+ %dt= f.label :locale
18
+ %dd= f.select :locale, I18n.available_locales, {}, {class: "chosen"}
19
+ %dl
20
+ %dt= f.label :permalink, t('kylekthompson_shoppe.product.permalink')
21
+ %dd= f.text_field :permalink, :class => 'text'
22
+ %dl.cleared
23
+ %dt= f.label :description, t('kylekthompson_shoppe.product.description')
24
+ %dd= f.text_area :description, :class => 'text'
25
+ %dl.cleared
26
+ %dt= f.label :short_description, t('kylekthompson_shoppe.product.short_description')
27
+ %dd= f.text_area :short_description, :class => 'text'
28
+
29
+ %p.submit
30
+ - unless @localisation.new_record?
31
+ %span.right= link_to t('kylekthompson_shoppe.delete'), product_localisation_path(@product, @localisation), :class => 'button purple', :method => :delete, :data => {:confirm => t('kylekthompson_shoppe.localisations.delete_confirmation')}
32
+ = f.submit t('kylekthompson_shoppe.localisations.save_localisation'), :class => 'button green'
@@ -0,0 +1,26 @@
1
+ - @page_title = "#{t('kylekthompson_shoppe.localisations.localisations')} - #{@product.name}"
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('kylekthompson_shoppe.localisations.back'), [:edit, @product], :class => 'button'
6
+ = link_to t('kylekthompson_shoppe.localisations.new_localisation'), [:new, @product, :localisation], :class => 'button green'
7
+
8
+ %h2.products= t('kylekthompson_shoppe.localisations.localisations_of', name: @product.name)
9
+
10
+ .table
11
+ %table.data
12
+ %thead
13
+ %tr
14
+ %th{:width => '20%'}= t('kylekthompson_shoppe.localisations.language')
15
+ %th{:width => '50%'}= t('kylekthompson_shoppe.products.name')
16
+ %th{:width => '15%'}= t('kylekthompson_shoppe.products.permalink')
17
+ %tbody
18
+ - if @localisations.empty?
19
+ %tr.empty
20
+ %td{:colspan => 4}= t('kylekthompson_shoppe.localisations.no_localisations')
21
+ - else
22
+ - for localisation in @localisations
23
+ %tr
24
+ %td= localisation.locale
25
+ %td= link_to localisation.name, edit_product_localisation_path(@product, localisation)
26
+ %td= localisation.permalink