goca-spree-backend 3.1.14.rails.5.0

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 (439) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +6 -0
  3. data/Rakefile +15 -0
  4. data/app/assets/images/admin/payment_banner.png +0 -0
  5. data/app/assets/images/admin/progress.gif +0 -0
  6. data/app/assets/images/credit_cards/credit_card.gif +0 -0
  7. data/app/assets/javascripts/spree/backend/address_states.js +33 -0
  8. data/app/assets/javascripts/spree/backend/adjustments.js.coffee +17 -0
  9. data/app/assets/javascripts/spree/backend/admin.js +402 -0
  10. data/app/assets/javascripts/spree/backend/calculator.js +16 -0
  11. data/app/assets/javascripts/spree/backend/checkouts/edit.js +89 -0
  12. data/app/assets/javascripts/spree/backend/gateway.js +13 -0
  13. data/app/assets/javascripts/spree/backend/general_settings.js.coffee +13 -0
  14. data/app/assets/javascripts/spree/backend/handlebar_extensions.js +7 -0
  15. data/app/assets/javascripts/spree/backend/line_items.js.coffee +64 -0
  16. data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +49 -0
  17. data/app/assets/javascripts/spree/backend/nested-attribute.js +27 -0
  18. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +43 -0
  19. data/app/assets/javascripts/spree/backend/option_value_picker.js +45 -0
  20. data/app/assets/javascripts/spree/backend/orders/edit.js +5 -0
  21. data/app/assets/javascripts/spree/backend/orders/edit_form.js +21 -0
  22. data/app/assets/javascripts/spree/backend/payments/edit.js.coffee +145 -0
  23. data/app/assets/javascripts/spree/backend/payments/new.js +50 -0
  24. data/app/assets/javascripts/spree/backend/product_picker.js +49 -0
  25. data/app/assets/javascripts/spree/backend/progress.js.coffee +6 -0
  26. data/app/assets/javascripts/spree/backend/promotions.js +170 -0
  27. data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.coffee +4 -0
  28. data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +35 -0
  29. data/app/assets/javascripts/spree/backend/shipments.js.erb +334 -0
  30. data/app/assets/javascripts/spree/backend/spree-select2.js +7 -0
  31. data/app/assets/javascripts/spree/backend/states.js +11 -0
  32. data/app/assets/javascripts/spree/backend/stock_management.js.coffee +9 -0
  33. data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +19 -0
  34. data/app/assets/javascripts/spree/backend/stock_transfer.js.coffee +198 -0
  35. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +52 -0
  36. data/app/assets/javascripts/spree/backend/taxon_tree_menu.js.coffee +22 -0
  37. data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +149 -0
  38. data/app/assets/javascripts/spree/backend/taxons.js.coffee +87 -0
  39. data/app/assets/javascripts/spree/backend/user_picker.js +40 -0
  40. data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee +38 -0
  41. data/app/assets/javascripts/spree/backend/variant_management.js.coffee +10 -0
  42. data/app/assets/javascripts/spree/backend/zone.js.coffee +43 -0
  43. data/app/assets/javascripts/spree/backend.js +79 -0
  44. data/app/assets/javascripts/spree/frontend/backend.js +1 -0
  45. data/app/assets/stylesheets/spree/backend/components/_buttons.scss +37 -0
  46. data/app/assets/stylesheets/spree/backend/components/_filters.scss +26 -0
  47. data/app/assets/stylesheets/spree/backend/components/_icons.scss +257 -0
  48. data/app/assets/stylesheets/spree/backend/components/_labels.scss +53 -0
  49. data/app/assets/stylesheets/spree/backend/components/_main.scss +11 -0
  50. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +14 -0
  51. data/app/assets/stylesheets/spree/backend/components/_page_header.scss +32 -0
  52. data/app/assets/stylesheets/spree/backend/components/_panels.scss +3 -0
  53. data/app/assets/stylesheets/spree/backend/components/_progress.scss +22 -0
  54. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +122 -0
  55. data/app/assets/stylesheets/spree/backend/components/_spinner.scss +95 -0
  56. data/app/assets/stylesheets/spree/backend/components/_tables.scss +56 -0
  57. data/app/assets/stylesheets/spree/backend/components/_taxon_products_view.scss +70 -0
  58. data/app/assets/stylesheets/spree/backend/components/_variables.scss +12 -0
  59. data/app/assets/stylesheets/spree/backend/components/_wells.scss +3 -0
  60. data/app/assets/stylesheets/spree/backend/global/_variables.scss +37 -0
  61. data/app/assets/stylesheets/spree/backend/plugins/_jquery_ui.scss +109 -0
  62. data/app/assets/stylesheets/spree/backend/plugins/_js_tree.scss +0 -0
  63. data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +127 -0
  64. data/app/assets/stylesheets/spree/backend/sections/_account.scss +16 -0
  65. data/app/assets/stylesheets/spree/backend/shared/_base.scss +25 -0
  66. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +59 -0
  67. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +5 -0
  68. data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +28 -0
  69. data/app/assets/stylesheets/spree/backend.css +11 -0
  70. data/app/assets/stylesheets/spree/frontend/backend.css +1 -0
  71. data/app/controllers/spree/admin/adjustments_controller.rb +38 -0
  72. data/app/controllers/spree/admin/base_controller.rb +67 -0
  73. data/app/controllers/spree/admin/countries_controller.rb +11 -0
  74. data/app/controllers/spree/admin/customer_returns_controller.rb +68 -0
  75. data/app/controllers/spree/admin/general_settings_controller.rb +40 -0
  76. data/app/controllers/spree/admin/images_controller.rb +50 -0
  77. data/app/controllers/spree/admin/log_entries_controller.rb +19 -0
  78. data/app/controllers/spree/admin/option_types_controller.rb +48 -0
  79. data/app/controllers/spree/admin/option_values_controller.rb +11 -0
  80. data/app/controllers/spree/admin/orders/customer_details_controller.rb +74 -0
  81. data/app/controllers/spree/admin/orders_controller.rb +147 -0
  82. data/app/controllers/spree/admin/payment_methods_controller.rb +72 -0
  83. data/app/controllers/spree/admin/payments_controller.rb +103 -0
  84. data/app/controllers/spree/admin/product_properties_controller.rb +18 -0
  85. data/app/controllers/spree/admin/products_controller.rb +156 -0
  86. data/app/controllers/spree/admin/promotion_actions_controller.rb +45 -0
  87. data/app/controllers/spree/admin/promotion_categories_controller.rb +6 -0
  88. data/app/controllers/spree/admin/promotion_rules_controller.rb +50 -0
  89. data/app/controllers/spree/admin/promotions_controller.rb +36 -0
  90. data/app/controllers/spree/admin/properties_controller.rb +23 -0
  91. data/app/controllers/spree/admin/prototypes_controller.rb +27 -0
  92. data/app/controllers/spree/admin/refund_reasons_controller.rb +6 -0
  93. data/app/controllers/spree/admin/refunds_controller.rb +38 -0
  94. data/app/controllers/spree/admin/reimbursement_types_controller.rb +6 -0
  95. data/app/controllers/spree/admin/reimbursements_controller.rb +45 -0
  96. data/app/controllers/spree/admin/reports_controller.rb +65 -0
  97. data/app/controllers/spree/admin/resource_controller.rb +260 -0
  98. data/app/controllers/spree/admin/return_authorization_reasons_controller.rb +6 -0
  99. data/app/controllers/spree/admin/return_authorizations_controller.rb +51 -0
  100. data/app/controllers/spree/admin/return_index_controller.rb +28 -0
  101. data/app/controllers/spree/admin/return_items_controller.rb +9 -0
  102. data/app/controllers/spree/admin/roles_controller.rb +6 -0
  103. data/app/controllers/spree/admin/root_controller.rb +18 -0
  104. data/app/controllers/spree/admin/search_controller.rb +41 -0
  105. data/app/controllers/spree/admin/shipping_categories_controller.rb +6 -0
  106. data/app/controllers/spree/admin/shipping_methods_controller.rb +46 -0
  107. data/app/controllers/spree/admin/state_changes_controller.rb +18 -0
  108. data/app/controllers/spree/admin/states_controller.rb +29 -0
  109. data/app/controllers/spree/admin/stock_items_controller.rb +51 -0
  110. data/app/controllers/spree/admin/stock_locations_controller.rb +16 -0
  111. data/app/controllers/spree/admin/stock_movements_controller.rb +39 -0
  112. data/app/controllers/spree/admin/stock_transfers_controller.rb +51 -0
  113. data/app/controllers/spree/admin/store_credit_categories_controller.rb +6 -0
  114. data/app/controllers/spree/admin/store_credits_controller.rb +94 -0
  115. data/app/controllers/spree/admin/tax_categories_controller.rb +6 -0
  116. data/app/controllers/spree/admin/tax_rates_controller.rb +15 -0
  117. data/app/controllers/spree/admin/taxonomies_controller.rb +15 -0
  118. data/app/controllers/spree/admin/taxons_controller.rb +126 -0
  119. data/app/controllers/spree/admin/trackers_controller.rb +6 -0
  120. data/app/controllers/spree/admin/users_controller.rb +145 -0
  121. data/app/controllers/spree/admin/variants_controller.rb +57 -0
  122. data/app/controllers/spree/admin/variants_including_master_controller.rb +16 -0
  123. data/app/controllers/spree/admin/zones_controller.rb +26 -0
  124. data/app/helpers/spree/admin/adjustments_helper.rb +37 -0
  125. data/app/helpers/spree/admin/base_helper.rb +157 -0
  126. data/app/helpers/spree/admin/customer_returns_helper.rb +9 -0
  127. data/app/helpers/spree/admin/general_settings_helper.rb +13 -0
  128. data/app/helpers/spree/admin/images_helper.rb +18 -0
  129. data/app/helpers/spree/admin/inventory_settings_helper.rb +9 -0
  130. data/app/helpers/spree/admin/navigation_helper.rb +248 -0
  131. data/app/helpers/spree/admin/orders_helper.rb +69 -0
  132. data/app/helpers/spree/admin/payments_helper.rb +11 -0
  133. data/app/helpers/spree/admin/products_helper.rb +29 -0
  134. data/app/helpers/spree/admin/reimbursement_type_helper.rb +9 -0
  135. data/app/helpers/spree/admin/reimbursements_helper.rb +14 -0
  136. data/app/helpers/spree/admin/stock_locations_helper.rb +15 -0
  137. data/app/helpers/spree/admin/stock_movements_helper.rb +24 -0
  138. data/app/helpers/spree/admin/tables_helper.rb +15 -0
  139. data/app/helpers/spree/admin/taxons_helper.rb +9 -0
  140. data/app/helpers/spree/promotion_rules_helper.rb +13 -0
  141. data/app/models/spree/admin/resource.rb +35 -0
  142. data/app/models/spree/backend_configuration.rb +21 -0
  143. data/app/views/kaminari/_first_page.html.erb +11 -0
  144. data/app/views/kaminari/_gap.html.erb +8 -0
  145. data/app/views/kaminari/_last_page.html.erb +11 -0
  146. data/app/views/kaminari/_next_page.html.erb +15 -0
  147. data/app/views/kaminari/_page.html.erb +12 -0
  148. data/app/views/kaminari/_paginator.html.erb +23 -0
  149. data/app/views/kaminari/_prev_page.html.erb +15 -0
  150. data/app/views/spree/admin/adjustments/_adjustment.html.erb +17 -0
  151. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +31 -0
  152. data/app/views/spree/admin/adjustments/_form.html.erb +12 -0
  153. data/app/views/spree/admin/adjustments/edit.html.erb +19 -0
  154. data/app/views/spree/admin/adjustments/index.html.erb +34 -0
  155. data/app/views/spree/admin/adjustments/new.html.erb +19 -0
  156. data/app/views/spree/admin/countries/_form.html.erb +20 -0
  157. data/app/views/spree/admin/countries/edit.html.erb +14 -0
  158. data/app/views/spree/admin/countries/index.html.erb +31 -0
  159. data/app/views/spree/admin/countries/new.html.erb +13 -0
  160. data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +36 -0
  161. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +50 -0
  162. data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +45 -0
  163. data/app/views/spree/admin/customer_returns/edit.html.erb +61 -0
  164. data/app/views/spree/admin/customer_returns/index.html.erb +56 -0
  165. data/app/views/spree/admin/customer_returns/new.html.erb +47 -0
  166. data/app/views/spree/admin/general_settings/edit.html.erb +143 -0
  167. data/app/views/spree/admin/images/_form.html.erb +18 -0
  168. data/app/views/spree/admin/images/edit.html.erb +30 -0
  169. data/app/views/spree/admin/images/index.html.erb +55 -0
  170. data/app/views/spree/admin/images/new.html.erb +19 -0
  171. data/app/views/spree/admin/inventory_units/adjust.html.erb +29 -0
  172. data/app/views/spree/admin/log_entries/index.html.erb +33 -0
  173. data/app/views/spree/admin/option_types/_form.html.erb +17 -0
  174. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +9 -0
  175. data/app/views/spree/admin/option_types/edit.html.erb +49 -0
  176. data/app/views/spree/admin/option_types/index.html.erb +44 -0
  177. data/app/views/spree/admin/option_types/new.html.erb +13 -0
  178. data/app/views/spree/admin/orders/_add_line_item.html.erb +17 -0
  179. data/app/views/spree/admin/orders/_add_product.html.erb +18 -0
  180. data/app/views/spree/admin/orders/_adjustments.html.erb +33 -0
  181. data/app/views/spree/admin/orders/_form.html.erb +56 -0
  182. data/app/views/spree/admin/orders/_line_item.html.erb +21 -0
  183. data/app/views/spree/admin/orders/_line_items.html.erb +46 -0
  184. data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +39 -0
  185. data/app/views/spree/admin/orders/_order_actions.html.erb +12 -0
  186. data/app/views/spree/admin/orders/_risk_analysis.html.erb +47 -0
  187. data/app/views/spree/admin/orders/_shipment.html.erb +108 -0
  188. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +42 -0
  189. data/app/views/spree/admin/orders/cart.html.erb +31 -0
  190. data/app/views/spree/admin/orders/customer_details/_form.html.erb +106 -0
  191. data/app/views/spree/admin/orders/customer_details/edit.html.erb +29 -0
  192. data/app/views/spree/admin/orders/edit.html.erb +35 -0
  193. data/app/views/spree/admin/orders/index.html.erb +226 -0
  194. data/app/views/spree/admin/payment_methods/_form.html.erb +56 -0
  195. data/app/views/spree/admin/payment_methods/edit.html.erb +13 -0
  196. data/app/views/spree/admin/payment_methods/index.html.erb +46 -0
  197. data/app/views/spree/admin/payment_methods/new.html.erb +13 -0
  198. data/app/views/spree/admin/payments/_capture_events.html.erb +19 -0
  199. data/app/views/spree/admin/payments/_form.html.erb +33 -0
  200. data/app/views/spree/admin/payments/_list.html.erb +38 -0
  201. data/app/views/spree/admin/payments/credit.html.erb +18 -0
  202. data/app/views/spree/admin/payments/index.html.erb +38 -0
  203. data/app/views/spree/admin/payments/new.html.erb +25 -0
  204. data/app/views/spree/admin/payments/show.html.erb +28 -0
  205. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +56 -0
  206. data/app/views/spree/admin/payments/source_forms/_storecredit.html.erb +9 -0
  207. data/app/views/spree/admin/payments/source_views/_check.html.erb +0 -0
  208. data/app/views/spree/admin/payments/source_views/_gateway.html.erb +21 -0
  209. data/app/views/spree/admin/payments/source_views/_storecredit.html.erb +29 -0
  210. data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +19 -0
  211. data/app/views/spree/admin/product_properties/index.html.erb +43 -0
  212. data/app/views/spree/admin/products/_add_stock_form.html.erb +42 -0
  213. data/app/views/spree/admin/products/_autocomplete.js.erb +25 -0
  214. data/app/views/spree/admin/products/_form.html.erb +224 -0
  215. data/app/views/spree/admin/products/_properties_form.erb +10 -0
  216. data/app/views/spree/admin/products/edit.html.erb +15 -0
  217. data/app/views/spree/admin/products/index.html.erb +91 -0
  218. data/app/views/spree/admin/products/new.html.erb +89 -0
  219. data/app/views/spree/admin/products/stock.html.erb +78 -0
  220. data/app/views/spree/admin/promotion_actions/create.js.erb +12 -0
  221. data/app/views/spree/admin/promotion_actions/destroy.js.erb +1 -0
  222. data/app/views/spree/admin/promotion_categories/_form.html.erb +11 -0
  223. data/app/views/spree/admin/promotion_categories/edit.html.erb +11 -0
  224. data/app/views/spree/admin/promotion_categories/index.html.erb +34 -0
  225. data/app/views/spree/admin/promotion_categories/new.html.erb +11 -0
  226. data/app/views/spree/admin/promotion_rules/create.js.erb +10 -0
  227. data/app/views/spree/admin/promotion_rules/destroy.js.erb +3 -0
  228. data/app/views/spree/admin/promotions/_actions.html.erb +35 -0
  229. data/app/views/spree/admin/promotions/_form.html.erb +60 -0
  230. data/app/views/spree/admin/promotions/_promotion_action.html.erb +12 -0
  231. data/app/views/spree/admin/promotions/_promotion_rule.html.erb +11 -0
  232. data/app/views/spree/admin/promotions/_rules.html.erb +46 -0
  233. data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +30 -0
  234. data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +28 -0
  235. data/app/views/spree/admin/promotions/actions/_create_line_items.html.erb +25 -0
  236. data/app/views/spree/admin/promotions/calculators/_default_fields.html.erb +10 -0
  237. data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +42 -0
  238. data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +42 -0
  239. data/app/views/spree/admin/promotions/edit.html.erb +30 -0
  240. data/app/views/spree/admin/promotions/index.html.erb +82 -0
  241. data/app/views/spree/admin/promotions/new.html.erb +11 -0
  242. data/app/views/spree/admin/promotions/rules/_item_total.html.erb +12 -0
  243. data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +9 -0
  244. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +42 -0
  245. data/app/views/spree/admin/promotions/rules/_product.html.erb +10 -0
  246. data/app/views/spree/admin/promotions/rules/_taxon.html.erb +10 -0
  247. data/app/views/spree/admin/promotions/rules/_user.html.erb +6 -0
  248. data/app/views/spree/admin/properties/_form.html.erb +16 -0
  249. data/app/views/spree/admin/properties/edit.html.erb +13 -0
  250. data/app/views/spree/admin/properties/index.html.erb +68 -0
  251. data/app/views/spree/admin/properties/new.html.erb +15 -0
  252. data/app/views/spree/admin/prototypes/_form.html.erb +28 -0
  253. data/app/views/spree/admin/prototypes/_prototypes.html.erb +21 -0
  254. data/app/views/spree/admin/prototypes/available.js.erb +2 -0
  255. data/app/views/spree/admin/prototypes/edit.html.erb +13 -0
  256. data/app/views/spree/admin/prototypes/index.html.erb +34 -0
  257. data/app/views/spree/admin/prototypes/new.html.erb +13 -0
  258. data/app/views/spree/admin/prototypes/select.js.erb +4 -0
  259. data/app/views/spree/admin/prototypes/show.html.erb +39 -0
  260. data/app/views/spree/admin/refund_reasons/destroy.js.erb +1 -0
  261. data/app/views/spree/admin/refund_reasons/edit.html.erb +3 -0
  262. data/app/views/spree/admin/refund_reasons/index.html.erb +6 -0
  263. data/app/views/spree/admin/refund_reasons/new.html.erb +4 -0
  264. data/app/views/spree/admin/refunds/edit.html.erb +27 -0
  265. data/app/views/spree/admin/refunds/new.html.erb +35 -0
  266. data/app/views/spree/admin/reimbursement_types/index.html.erb +30 -0
  267. data/app/views/spree/admin/reimbursements/edit.html.erb +102 -0
  268. data/app/views/spree/admin/reimbursements/index.html.erb +28 -0
  269. data/app/views/spree/admin/reimbursements/show.html.erb +90 -0
  270. data/app/views/spree/admin/reports/index.html.erb +20 -0
  271. data/app/views/spree/admin/reports/sales_total.html.erb +29 -0
  272. data/app/views/spree/admin/return_authorization_reasons/destroy.js.erb +1 -0
  273. data/app/views/spree/admin/return_authorization_reasons/edit.html.erb +3 -0
  274. data/app/views/spree/admin/return_authorization_reasons/index.html.erb +6 -0
  275. data/app/views/spree/admin/return_authorization_reasons/new.html.erb +4 -0
  276. data/app/views/spree/admin/return_authorizations/_form.html.erb +91 -0
  277. data/app/views/spree/admin/return_authorizations/edit.html.erb +26 -0
  278. data/app/views/spree/admin/return_authorizations/index.html.erb +53 -0
  279. data/app/views/spree/admin/return_authorizations/new.html.erb +18 -0
  280. data/app/views/spree/admin/return_index/customer_returns.html.erb +64 -0
  281. data/app/views/spree/admin/return_index/return_authorizations.html.erb +76 -0
  282. data/app/views/spree/admin/roles/_form.html.erb +9 -0
  283. data/app/views/spree/admin/roles/edit.html.erb +13 -0
  284. data/app/views/spree/admin/roles/index.html.erb +34 -0
  285. data/app/views/spree/admin/roles/new.html.erb +13 -0
  286. data/app/views/spree/admin/search/products.rabl +9 -0
  287. data/app/views/spree/admin/search/users.rabl +30 -0
  288. data/app/views/spree/admin/shared/_address.html.erb +38 -0
  289. data/app/views/spree/admin/shared/_address_form.html.erb +78 -0
  290. data/app/views/spree/admin/shared/_calculator_fields.html.erb +27 -0
  291. data/app/views/spree/admin/shared/_content_header.html.erb +26 -0
  292. data/app/views/spree/admin/shared/_destroy.js.erb +9 -0
  293. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +5 -0
  294. data/app/views/spree/admin/shared/_error_messages.html.erb +12 -0
  295. data/app/views/spree/admin/shared/_head.html.erb +26 -0
  296. data/app/views/spree/admin/shared/_header.html.erb +32 -0
  297. data/app/views/spree/admin/shared/_index_table_options.html.erb +19 -0
  298. data/app/views/spree/admin/shared/_main_menu.html.erb +41 -0
  299. data/app/views/spree/admin/shared/_new_resource_links.html.erb +5 -0
  300. data/app/views/spree/admin/shared/_order_summary.html.erb +121 -0
  301. data/app/views/spree/admin/shared/_order_tabs.html.erb +60 -0
  302. data/app/views/spree/admin/shared/_product_tabs.html.erb +24 -0
  303. data/app/views/spree/admin/shared/_refunds.html.erb +32 -0
  304. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +17 -0
  305. data/app/views/spree/admin/shared/_sidebar.html.erb +5 -0
  306. data/app/views/spree/admin/shared/_table_filter.html.erb +24 -0
  307. data/app/views/spree/admin/shared/_translations.html.erb +48 -0
  308. data/app/views/spree/admin/shared/_update_order_state.js +7 -0
  309. data/app/views/spree/admin/shared/named_types/_edit.html.erb +13 -0
  310. data/app/views/spree/admin/shared/named_types/_form.html.erb +13 -0
  311. data/app/views/spree/admin/shared/named_types/_index.html.erb +42 -0
  312. data/app/views/spree/admin/shared/named_types/_new.html.erb +13 -0
  313. data/app/views/spree/admin/shared/sub_menu/_configuration.html.erb +23 -0
  314. data/app/views/spree/admin/shared/sub_menu/_product.html.erb +8 -0
  315. data/app/views/spree/admin/shared/sub_menu/_promotion.html.erb +4 -0
  316. data/app/views/spree/admin/shared/sub_menu/_returns.html.erb +4 -0
  317. data/app/views/spree/admin/shipping_categories/_form.html.erb +9 -0
  318. data/app/views/spree/admin/shipping_categories/edit.html.erb +11 -0
  319. data/app/views/spree/admin/shipping_categories/index.html.erb +34 -0
  320. data/app/views/spree/admin/shipping_categories/new.html.erb +13 -0
  321. data/app/views/spree/admin/shipping_methods/_form.html.erb +119 -0
  322. data/app/views/spree/admin/shipping_methods/edit.html.erb +17 -0
  323. data/app/views/spree/admin/shipping_methods/index.html.erb +40 -0
  324. data/app/views/spree/admin/shipping_methods/new.html.erb +20 -0
  325. data/app/views/spree/admin/state_changes/index.html.erb +42 -0
  326. data/app/views/spree/admin/states/_form.html.erb +15 -0
  327. data/app/views/spree/admin/states/_state_list.html.erb +26 -0
  328. data/app/views/spree/admin/states/edit.html.erb +13 -0
  329. data/app/views/spree/admin/states/index.html.erb +18 -0
  330. data/app/views/spree/admin/states/new.html.erb +13 -0
  331. data/app/views/spree/admin/states/new.js.erb +2 -0
  332. data/app/views/spree/admin/stock_items/destroy.js.erb +1 -0
  333. data/app/views/spree/admin/stock_locations/_form.html.erb +95 -0
  334. data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +39 -0
  335. data/app/views/spree/admin/stock_locations/edit.html.erb +13 -0
  336. data/app/views/spree/admin/stock_locations/index.html.erb +41 -0
  337. data/app/views/spree/admin/stock_locations/new.html.erb +13 -0
  338. data/app/views/spree/admin/stock_movements/_form.html.erb +12 -0
  339. data/app/views/spree/admin/stock_movements/edit.html.erb +17 -0
  340. data/app/views/spree/admin/stock_movements/index.html.erb +43 -0
  341. data/app/views/spree/admin/stock_movements/new.html.erb +14 -0
  342. data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +22 -0
  343. data/app/views/spree/admin/stock_transfers/index.html.erb +82 -0
  344. data/app/views/spree/admin/stock_transfers/new.html.erb +107 -0
  345. data/app/views/spree/admin/stock_transfers/show.html.erb +44 -0
  346. data/app/views/spree/admin/store_credit_categories/_form.html.erb +9 -0
  347. data/app/views/spree/admin/store_credit_categories/edit.html.erb +13 -0
  348. data/app/views/spree/admin/store_credit_categories/index.html.erb +34 -0
  349. data/app/views/spree/admin/store_credit_categories/new.html.erb +13 -0
  350. data/app/views/spree/admin/store_credits/_form.html.erb +18 -0
  351. data/app/views/spree/admin/store_credits/edit.html.erb +14 -0
  352. data/app/views/spree/admin/store_credits/index.html.erb +46 -0
  353. data/app/views/spree/admin/store_credits/new.html.erb +14 -0
  354. data/app/views/spree/admin/tax_categories/_form.html.erb +24 -0
  355. data/app/views/spree/admin/tax_categories/edit.html.erb +13 -0
  356. data/app/views/spree/admin/tax_categories/index.html.erb +42 -0
  357. data/app/views/spree/admin/tax_categories/new.html.erb +13 -0
  358. data/app/views/spree/admin/tax_categories/show.html.erb +1 -0
  359. data/app/views/spree/admin/tax_rates/_form.html.erb +54 -0
  360. data/app/views/spree/admin/tax_rates/edit.html.erb +11 -0
  361. data/app/views/spree/admin/tax_rates/index.html.erb +46 -0
  362. data/app/views/spree/admin/tax_rates/new.html.erb +14 -0
  363. data/app/views/spree/admin/taxonomies/_form.html.erb +7 -0
  364. data/app/views/spree/admin/taxonomies/_js_head.html.erb +13 -0
  365. data/app/views/spree/admin/taxonomies/_list.html.erb +23 -0
  366. data/app/views/spree/admin/taxonomies/edit.erb +37 -0
  367. data/app/views/spree/admin/taxonomies/index.html.erb +18 -0
  368. data/app/views/spree/admin/taxonomies/new.html.erb +12 -0
  369. data/app/views/spree/admin/taxons/_form.html.erb +46 -0
  370. data/app/views/spree/admin/taxons/_taxon_table.html.erb +23 -0
  371. data/app/views/spree/admin/taxons/edit.html.erb +32 -0
  372. data/app/views/spree/admin/taxons/index.html.erb +13 -0
  373. data/app/views/spree/admin/trackers/_form.html.erb +29 -0
  374. data/app/views/spree/admin/trackers/edit.html.erb +13 -0
  375. data/app/views/spree/admin/trackers/index.html.erb +42 -0
  376. data/app/views/spree/admin/trackers/new.html.erb +13 -0
  377. data/app/views/spree/admin/users/_addresses_form.html.erb +35 -0
  378. data/app/views/spree/admin/users/_form.html.erb +36 -0
  379. data/app/views/spree/admin/users/_lifetime_stats.html.erb +30 -0
  380. data/app/views/spree/admin/users/_sidebar.html.erb +23 -0
  381. data/app/views/spree/admin/users/_user_page_actions.html.erb +3 -0
  382. data/app/views/spree/admin/users/addresses.html.erb +26 -0
  383. data/app/views/spree/admin/users/edit.html.erb +72 -0
  384. data/app/views/spree/admin/users/index.html.erb +67 -0
  385. data/app/views/spree/admin/users/items.html.erb +64 -0
  386. data/app/views/spree/admin/users/new.html.erb +18 -0
  387. data/app/views/spree/admin/users/orders.html.erb +52 -0
  388. data/app/views/spree/admin/variants/_autocomplete.js.erb +21 -0
  389. data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +46 -0
  390. data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +48 -0
  391. data/app/views/spree/admin/variants/_form.html.erb +49 -0
  392. data/app/views/spree/admin/variants/_split.js.erb +33 -0
  393. data/app/views/spree/admin/variants/edit.html.erb +13 -0
  394. data/app/views/spree/admin/variants/index.html.erb +65 -0
  395. data/app/views/spree/admin/variants/new.html.erb +11 -0
  396. data/app/views/spree/admin/variants/new.js.erb +3 -0
  397. data/app/views/spree/admin/variants/update.js.erb +1 -0
  398. data/app/views/spree/admin/zones/_country_members.html.erb +16 -0
  399. data/app/views/spree/admin/zones/_form.html.erb +49 -0
  400. data/app/views/spree/admin/zones/_state_members.html.erb +16 -0
  401. data/app/views/spree/admin/zones/edit.html.erb +12 -0
  402. data/app/views/spree/admin/zones/index.html.erb +44 -0
  403. data/app/views/spree/admin/zones/new.html.erb +11 -0
  404. data/app/views/spree/layouts/admin.html.erb +81 -0
  405. data/config/initializers/assets.rb +1 -0
  406. data/config/initializers/form_builder.rb +15 -0
  407. data/config/routes.rb +185 -0
  408. data/lib/spree/backend/action_callbacks.rb +26 -0
  409. data/lib/spree/backend/callbacks.rb +48 -0
  410. data/lib/spree/backend/engine.rb +34 -0
  411. data/lib/spree/backend.rb +13 -0
  412. data/lib/spree_backend.rb +3 -0
  413. data/script/rails +9 -0
  414. data/spree_backend.gemspec +28 -0
  415. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  416. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
  417. data/vendor/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
  418. data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  419. data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  420. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
  421. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
  422. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
  423. data/vendor/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
  424. data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  425. data/vendor/assets/images/jquery-ui/ui-icons_666666_256x240.png +0 -0
  426. data/vendor/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
  427. data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  428. data/vendor/assets/javascripts/handlebars.js +2746 -0
  429. data/vendor/assets/javascripts/jquery.cookie.js +117 -0
  430. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +4564 -0
  431. data/vendor/assets/javascripts/modernizr.js +4 -0
  432. data/vendor/assets/javascripts/underscore-min.js +6 -0
  433. data/vendor/assets/javascripts/underscore-min.map +1 -0
  434. data/vendor/assets/javascripts/velocity.js +3831 -0
  435. data/vendor/assets/stylesheets/animate.css +3158 -0
  436. data/vendor/assets/stylesheets/jquery-ui.datepicker.css.erb +357 -0
  437. data/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss +216 -0
  438. data/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif +0 -0
  439. metadata +565 -0
@@ -0,0 +1,78 @@
1
+ <%= render partial: 'spree/admin/shared/product_tabs', locals: {current: :stock} %>
2
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @product } %>
3
+
4
+ <% if can? :create, Spree::StockMovement %>
5
+ <div id="add_stock_form" class="panel panel-default">
6
+ <%= render 'add_stock_form' %>
7
+ </div>
8
+ <% end %>
9
+
10
+ <div class="panel panel-default">
11
+ <table class="table table-bordered" id="listing_product_stock">
12
+ <thead>
13
+ <tr data-hook="admin_product_stock_management_index_headers">
14
+ <th colspan="2"><%= Spree.t(:variant) %></th>
15
+ <th colspan="3"><%= Spree.t(:stock_location_info) %></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <% @variants.each do |variant| %>
20
+ <% if variant.stock_items.present? %>
21
+ <tr id="<%= spree_dom_id variant %>" data-hook="admin_product_stock_management_index_rows">
22
+ <td class="image text-center">
23
+ <% if variant.images.present? %>
24
+ <%= image_tag variant.images.first.attachment.url(:mini) %>
25
+ <% end %>
26
+ </td>
27
+ <td>
28
+ <%= variant.sku_and_options_text %>
29
+ <%= form_tag admin_product_variants_including_master_path(@product, variant, format: :js), method: :put, class: 'toggle_variant_track_inventory' do %>
30
+ <div class="checkbox">
31
+ <%= label_tag :track_inventory do %>
32
+ <%= check_box_tag 'track_inventory', 1, variant.track_inventory?,
33
+ class: 'track_inventory_checkbox' %>
34
+ <%= Spree.t(:track_inventory) %>
35
+ <%= hidden_field_tag 'variant[track_inventory]', variant.track_inventory?,
36
+ class: 'variant_track_inventory',
37
+ id: "variant_track_inventory_#{variant.id}" %>
38
+ <% end %>
39
+ </div>
40
+ <% end if can?(:update, @product) && can?(:update, variant) %>
41
+ </td>
42
+
43
+ <td colspan="3" class="stock_location_info">
44
+ <table class="table table-bordered no-marginb">
45
+ <thead>
46
+ <th><%= Spree.t(:stock_location) %></th>
47
+ <th class="text-center"><%= Spree.t(:count_on_hand) %></th>
48
+ <th class="text-center"><%= Spree.t(:backorderable) %></th>
49
+ <th class="actions text-center"></th>
50
+ </thead>
51
+ <tbody>
52
+ <% variant.stock_items.each do |item| %>
53
+ <% next unless @stock_locations.include?(item.stock_location) %>
54
+ <tr id="stock-item-<%= item.id %>">
55
+ <td><%= item.stock_location.name %></td>
56
+ <td class="text-center"><%= item.count_on_hand %></td>
57
+ <td class="text-center">
58
+ <%= form_tag admin_stock_item_path(item), method: :put, class: 'toggle_stock_item_backorderable' do %>
59
+ <%= check_box_tag 'stock_item[backorderable]', true,
60
+ item.backorderable?,
61
+ class: 'stock_item_backorderable',
62
+ id: "stock_item_backorderable_#{item.stock_location.id}" %>
63
+ <% end if can? :update, item %>
64
+ </td>
65
+ <td class="actions actions-1 text-center">
66
+ <%= link_to_with_icon('delete', Spree.t(:remove), [:admin, item], method: :delete, remote: true, class: 'icon_link btn btn-danger btn-sm', data: { action: :remove, confirm: Spree.t(:are_you_sure) }, no_text: true) if can? :destroy, item %>
67
+ </td>
68
+ </tr>
69
+ <% end %>
70
+ </tbody>
71
+ </table>
72
+ </td>
73
+ <% end %>
74
+ </tr>
75
+ <% end %>
76
+ </tbody>
77
+ </table>
78
+ </div>
@@ -0,0 +1,12 @@
1
+ $('#actions').append('<%= escape_javascript( render(partial: 'spree/admin/promotions/promotion_action', object: @promotion_action) ) %>');
2
+ $('#actions .no-objects-found').hide();
3
+ $(document).ready(function(){
4
+ $(".variant_autocomplete").variantAutocomplete();
5
+ //enable select2 functions for recently added box
6
+ $('.type-select.select2').last().select2();
7
+ });
8
+ initProductActions();
9
+
10
+
11
+ $('#<%= dom_id @promotion_action %>').hide();
12
+ $('#<%= dom_id @promotion_action %>').fadeIn();
@@ -0,0 +1 @@
1
+ $('#<%= dom_id @promotion_action %>').fadeOut().remove();
@@ -0,0 +1,11 @@
1
+ <%= render :partial => 'spree/admin/shared/error_messages', :locals => { :target => @promotion_category } %>
2
+
3
+ <%= f.field_container :name, class: ['form-group'] do %>
4
+ <%= f.label :name %>
5
+ <%= f.text_field :name, :class => 'form-control' %>
6
+ <%= f.error_message_on :name %>
7
+ <% end %>
8
+ <%= f.field_container :code, class: ['form-group'] do %>
9
+ <%= f.label :code %>
10
+ <%= f.text_field :code, :class => 'form-control' %>
11
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t(:promotion_categories), spree.admin_promotion_categories_url %> /
3
+ <%= @promotion_category.name %>
4
+ <% end %>
5
+
6
+ <%= form_for @promotion_category, :url => object_url, :method => :put do |f| %>
7
+ <fieldset>
8
+ <%= render :partial => 'form', :locals => { :f => f } %>
9
+ <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
10
+ </fieldset>
11
+ <% end %>
@@ -0,0 +1,34 @@
1
+ <% content_for :page_title do %>
2
+ <%= plural_resource_name(Spree::PromotionCategory) %>
3
+ <% end %>
4
+
5
+ <% content_for :page_actions do %>
6
+ <%= button_link_to Spree.t(:new_promotion_category), new_object_url, :icon => 'add', :class => 'btn-success' %>
7
+ <% end %>
8
+
9
+ <% if @promotion_categories.any? %>
10
+ <table class="table">
11
+ <thead>
12
+ <th><%= Spree::PromotionCategory.human_attribute_name :name %></th>
13
+ <th><%= Spree::PromotionCategory.human_attribute_name :code %></th>
14
+ <th></th>
15
+ </thead>
16
+ <tbody>
17
+ <% @promotion_categories.each do |promotion_category| %>
18
+ <tr>
19
+ <td><%= promotion_category.name %></td>
20
+ <td><%= promotion_category.code %></td>
21
+ <td class="actions actions-2 text-right">
22
+ <%= link_to_edit promotion_category, :no_text => true %>
23
+ <%= link_to_delete promotion_category, :no_text => true %>
24
+ </td>
25
+ </tr>
26
+ <% end %>
27
+ </tbody>
28
+ </table>
29
+ <% else %>
30
+ <div class="alert alert-info no-objects-found">
31
+ <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::PromotionCategory)) %>,
32
+ <%= link_to Spree.t(:add_one), new_object_url %>!
33
+ </div>
34
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to plural_resource_name(Spree::PromotionCategory), spree.admin_promotion_categories_url %> /
3
+ <%= Spree.t(:new_promotion_category) %>
4
+ <% end %>
5
+
6
+ <%= form_for :promotion_category, :url => collection_url do |f| %>
7
+ <fieldset>
8
+ <%= render :partial => 'form', :locals => { :f => f } %>
9
+ <%= render :partial => 'spree/admin/shared/new_resource_links' %>
10
+ </fieldset>
11
+ <% end %>
@@ -0,0 +1,10 @@
1
+ $('#rules').append('<%= escape_javascript( render(partial: 'spree/admin/promotions/promotion_rule', object: @promotion_rule) ) %>');
2
+ $('#rules .no-objects-found').hide();
3
+
4
+ $('.product_picker').productAutocomplete();
5
+ $('.user_picker').userAutocomplete();
6
+
7
+ $('#promotion_rule_type').html('<%= escape_javascript options_for_promotion_rule_types(@promotion) %>');
8
+ $('#promotion_rule_type').select2();
9
+
10
+ set_taxon_select('#product_taxon_ids')
@@ -0,0 +1,3 @@
1
+ $('#<%= dom_id @promotion_rule %>').fadeOut().remove();
2
+
3
+ $('#promotion_rule_type').html('<%= escape_javascript options_for_promotion_rule_types(@promotion) %>');
@@ -0,0 +1,35 @@
1
+ <div class="panel-heading">
2
+ <h1 class="panel-title">
3
+ <%= Spree.t(:promotion_actions) %>
4
+ </h1>
5
+ </div>
6
+ <div id="action_fields" class="panel-body">
7
+ <%= form_tag spree.admin_promotion_promotion_actions_path(@promotion), :remote => true, :id => 'new_promotion_action_form' do %>
8
+ <% options = options_for_select( Rails.application.config.spree.promotions.actions.map(&:name).map {|name| [ Spree.t("promotion_action_types.#{name.demodulize.underscore}.name"), name] } ) %>
9
+
10
+ <div class="form-group">
11
+ <%= label_tag :action_type, Spree.t(:add_action_of_type)%>
12
+ <%= select_tag 'action_type', options, :class => 'select2' %>
13
+ </div>
14
+ <div class="form-actions">
15
+ <%= button Spree.t(:add), 'plus', 'submit', class: "btn-success" %>
16
+ </div>
17
+
18
+ <% end %>
19
+
20
+ <%= form_for @promotion, :url => spree.admin_promotion_path(@promotion), :method => :put do |f| %>
21
+ <div id="actions" class="filter_list margint">
22
+ <% if @promotion.actions.any? %>
23
+ <%= render :partial => 'promotion_action', :collection => @promotion.actions %>
24
+ <% else %>
25
+ <div class="alert alert-warning">
26
+ <%= Spree.t(:no_actions_added) %>
27
+ </div>
28
+ <% end %>
29
+ </div>
30
+ <div class="actions promotion-update">
31
+ <%= button Spree.t('actions.update'), 'save' %>
32
+ </div>
33
+ <% end %>
34
+
35
+ </div>
@@ -0,0 +1,60 @@
1
+ <%= render :partial => 'spree/admin/shared/error_messages', :locals => { :target => @promotion } %>
2
+
3
+ <div class="row" id="general_fields" >
4
+ <div class="col-md-3">
5
+ <%= f.field_container :name, class: ['form-group'] do %>
6
+ <%= f.label :name %>
7
+ <%= f.text_field :name, :class => 'form-control' %>
8
+ <%= f.error_message_on :name %>
9
+ <% end %>
10
+
11
+ <%= f.field_container :code, class: ['form-group'] do %>
12
+ <%= f.label :code %>
13
+ <%= f.text_field :code, :class => 'form-control' %>
14
+ <% end %>
15
+
16
+ <%= f.field_container :path, class: ['form-group'] do %>
17
+ <%= f.label :path %>
18
+ <%= f.text_field :path, :class => 'form-control' %>
19
+ <% end %>
20
+
21
+ <%= f.field_container :advertise, class: ['checkbox'] do %>
22
+ <%= f.label :advertise do %>
23
+ <%= f.check_box :advertise %>
24
+ <%= Spree.t(:advertise) %>
25
+ <% end %>
26
+ <% end %>
27
+ </div>
28
+
29
+ <div class="col-md-6">
30
+ <%= f.field_container :description, class: ['form-group'] do %>
31
+ <%= f.label :description %>
32
+ <%= f.text_area :description, :rows => 7, :class => 'form-control' %>
33
+ <% end %>
34
+
35
+ <%= f.field_container :category, class: ['form-group'] do %>
36
+ <%= f.label :promotion_category %>
37
+ <%= f.collection_select(:promotion_category_id, @promotion_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
38
+ <% end %>
39
+ </div>
40
+
41
+ <div id="expiry_fields" class="col-md-3">
42
+ <%= f.field_container :usage_limit do %>
43
+ <%= f.label :usage_limit %>
44
+ <%= f.number_field :usage_limit, :min => 0, :class => 'form-control' %>
45
+ <p class="help-block">
46
+ <%= Spree.t(:current_promotion_usage, :count => @promotion.credits_count) %>
47
+ </p>
48
+ <% end %>
49
+
50
+ <div id="starts_at_field" class="form-group">
51
+ <%= f.label :starts_at %>
52
+ <%= f.text_field :starts_at, :value => datepicker_field_value(@promotion.starts_at), :class => 'datepicker datepicker-from form-control' %>
53
+ </div>
54
+
55
+ <div id="expires_at_field" class="form-group">
56
+ <%= f.label :expires_at %>
57
+ <%= f.text_field :expires_at, :value => datepicker_field_value(@promotion.expires_at), :class => 'datepicker datepicker-to form-control' %>
58
+ </div>
59
+ </div>
60
+ </div>
@@ -0,0 +1,12 @@
1
+ <div class="promotion_action promotion-block <%= promotion_action.type.to_s.demodulize.underscore %> panel panel-default" id="<%= dom_id promotion_action %>">
2
+ <% type_name = promotion_action.class.name.demodulize.underscore %>
3
+ <div class="panel-heading">
4
+ <%= link_to_with_icon 'delete', '', spree.admin_promotion_promotion_action_path(@promotion, promotion_action), remote: true, method: :delete, class: 'delete pull-right' %>
5
+ <h3 class="panel-title promotion-title"><%= Spree.t("promotion_action_types.#{type_name}.description") %></h3>
6
+ </div>
7
+ <% param_prefix = "promotion[promotion_actions_attributes][#{promotion_action.id}]" %>
8
+ <%= hidden_field_tag "#{param_prefix}[id]", promotion_action.id %>
9
+
10
+ <%= render partial: "spree/admin/promotions/actions/#{type_name}",
11
+ locals: { promotion_action: promotion_action, param_prefix: param_prefix } rescue nil %>
12
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="promotion_rule promotion-block panel panel-default" id="<%= dom_id promotion_rule %>">
2
+ <% type_name = promotion_rule.class.name.demodulize.underscore %>
3
+ <div class="panel-heading">
4
+ <%= link_to_with_icon 'delete', '', spree.admin_promotion_promotion_rule_path(@promotion, promotion_rule), remote: true, method: :delete, class: 'delete pull-right' %>
5
+ <h3 class='panel-title promotion-title <%= 'no-text' if type_name == 'user_logged_in' || type_name == 'first_order'%>'><%= Spree.t("promotion_rule_types.#{type_name}.description") %></h3>
6
+ </div>
7
+ <% param_prefix = "promotion[promotion_rules_attributes][#{promotion_rule.id}]" %>
8
+ <%= hidden_field_tag "#{param_prefix}[id]", promotion_rule.id %>
9
+
10
+ <%= render partial: "spree/admin/promotions/rules/#{type_name}", locals: { promotion_rule: promotion_rule, param_prefix: param_prefix } rescue nil %>
11
+ </div>
@@ -0,0 +1,46 @@
1
+ <div class="panel-heading">
2
+ <h1 class="panel-title">
3
+ <%= Spree.t(:rules) %>
4
+ </h1>
5
+ </div>
6
+ <div id="rule_fields" class="panel-body">
7
+
8
+ <%= form_tag spree.admin_promotion_promotion_rules_path(@promotion), :remote => true, :id => 'new_product_rule_form' do %>
9
+
10
+ <div class="form-group">
11
+ <%= label_tag :promotion_rule_type, Spree.t(:add_rule_of_type) %>
12
+ <%= select_tag('promotion_rule[type]', options_for_promotion_rule_types(@promotion), :class => 'select2') %>
13
+ </div>
14
+ <div class="form-actions">
15
+ <%= button Spree.t(:add), 'plus', 'submit', class: "btn-success" %>
16
+ </div>
17
+
18
+ <% end %>
19
+
20
+ <%= form_for @promotion, :url => object_url, :method => :put do |f| %>
21
+ <div id="promotion-policy-select">
22
+ <% Spree::Promotion::MATCH_POLICIES.each do |policy| %>
23
+ <div class="radio">
24
+ <%= f.label "match_policy_#{policy}" do %>
25
+ <%= f.radio_button :match_policy, policy %>
26
+ <%= Spree.t "promotion_form.match_policies.#{policy}" %>
27
+ <% end %>
28
+ </div>
29
+ <% end %>
30
+ </div>
31
+
32
+ <div id="rules" class="filter_list margint">
33
+ <% if @promotion.rules.any? %>
34
+ <%= render :partial => 'promotion_rule', :collection => @promotion.rules, :locals => {} %>
35
+ <% else %>
36
+ <div class="alert alert-warning">
37
+ <%= Spree.t(:no_rules_added) %>
38
+ </div>
39
+ <% end %>
40
+ </div>
41
+
42
+ <div class="promotion-update actions">
43
+ <%= button Spree.t('actions.update'), 'ok' %>
44
+ </div>
45
+ <% end %>
46
+ </div>
@@ -0,0 +1,30 @@
1
+ <div class="panel-body calculator-fields">
2
+ <div class="row no-marginb">
3
+ <div class="form-group col-md-6 no-marginb">
4
+ <% field_name = "#{param_prefix}[calculator_type]" %>
5
+ <%= label_tag field_name, Spree.t(:calculator) %>
6
+ <%= select_tag field_name,
7
+ options_from_collection_for_select(@calculators, :to_s, :description, promotion_action.calculator.type),
8
+ :class => 'type-select select2' %>
9
+ </div>
10
+ <% unless promotion_action.new_record? %>
11
+ <div class="form-group col-md-6 no-marginb settings">
12
+ <% type_name = promotion_action.calculator.type.demodulize.underscore %>
13
+ <% if lookup_context.exists?("fields",
14
+ ["spree/admin/promotions/calculators/#{type_name}"], true) %>
15
+ <%= render "spree/admin/promotions/calculators/#{type_name}/fields",
16
+ calculator: promotion_action.calculator, prefix: param_prefix %>
17
+ <% else %>
18
+ <%= render "spree/admin/promotions/calculators/default_fields",
19
+ calculator: promotion_action.calculator, prefix: param_prefix %>
20
+ <% end %>
21
+ <%= hidden_field_tag "#{param_prefix}[calculator_attributes][id]", promotion_action.calculator.id %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ <% if promotion_action.calculator.respond_to?(:preferences) %>
26
+ <div class="alert alert-info js-warning margint no-marginb">
27
+ <%= Spree.t(:calculator_settings_warning) %>
28
+ </div>
29
+ <% end %>
30
+ </div>
@@ -0,0 +1,28 @@
1
+ <div class="panel-body calculator-fields">
2
+ <div class="row no-marginb">
3
+ <div class="form-group col-md-6 no-marginb">
4
+ <% field_name = "#{param_prefix}[calculator_type]" %>
5
+ <%= label_tag field_name, Spree.t(:calculator) %>
6
+ <%= select_tag field_name,
7
+ options_from_collection_for_select(Spree::Promotion::Actions::CreateItemAdjustments.calculators, :to_s, :description, promotion_action.calculator.type),
8
+ :class => 'type-select select2' %>
9
+ </div>
10
+ <% unless promotion_action.new_record? %>
11
+ <div class="form-group col-md-6 no-marginb settings">
12
+ <% promotion_action.calculator.preferences.keys.map do |key| %>
13
+ <% field_name = "#{param_prefix}[calculator_attributes][preferred_#{key}]" %>
14
+ <%= label_tag field_name, Spree.t(key.to_s) %>
15
+ <%= preference_field_tag(field_name,
16
+ promotion_action.calculator.get_preference(key),
17
+ :type => promotion_action.calculator.preference_type(key)) %>
18
+ <% end %>
19
+ <%= hidden_field_tag "#{param_prefix}[calculator_attributes][id]", promotion_action.calculator.id %>
20
+ </div>
21
+ <% end %>
22
+ </div>
23
+ <% if promotion_action.calculator.respond_to?(:preferences) %>
24
+ <div class="alert alert-info js-warning margint no-marginb">
25
+ <%= Spree.t(:calculator_settings_warning) %>
26
+ </div>
27
+ <% end %>
28
+ </div>
@@ -0,0 +1,25 @@
1
+ <div class="panel-body calculator-fields">
2
+ <% promotion_action.promotion_action_line_items.each do |item| %>
3
+ <strong><%= item.quantity %> x <%= item.variant.product.name %></strong>
4
+ <%= item.variant.options_text %>
5
+ <% end %>
6
+
7
+ <% if promotion_action.promotion_action_line_items.empty? %>
8
+ <% line_items = promotion_action.promotion_action_line_items %>
9
+ <% line_items.build %>
10
+
11
+ <% line_items.each_with_index do |line_item, index| %>
12
+ <div class="add-line-item">
13
+ <% line_item_prefix = "#{param_prefix}[promotion_action_line_items_attributes][#{index}]" %>
14
+ <div class="form-group">
15
+ <%= label_tag "#{line_item_prefix}_variant_id", Spree.t(:variant) %>
16
+ <%= hidden_field_tag "#{line_item_prefix}[variant_id]", line_item.variant_id, class: "variant_autocomplete fullwidth-input" %>
17
+ </div>
18
+ <div class="form-group no-marginb">
19
+ <%= label_tag "#{line_item_prefix}_quantity", Spree.t(:quantity) %>
20
+ <%= number_field_tag "#{line_item_prefix}[quantity]", line_item.quantity, min: 1, class: 'form-control' %>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+ <% end %>
25
+ </div>
@@ -0,0 +1,10 @@
1
+ <% calculator.preferences.keys.map do |key| %>
2
+ <div class="form-group">
3
+ <% field_name = "#{prefix}[calculator_attributes][preferred_#{key}]" %>
4
+ <%= label_tag field_name, Spree.t(key.to_s) %>
5
+ <%= preference_field_tag(
6
+ field_name,
7
+ calculator.get_preference(key),
8
+ type: calculator.preference_type(key)) %>
9
+ </div>
10
+ <% end %>
@@ -0,0 +1,42 @@
1
+ <div class="form-group">
2
+ <%= label_tag "#{prefix}[calculator_attributes][preferred_base_amount]",
3
+ Spree.t(:base_amount) %>
4
+ <%= preference_field_tag(
5
+ "#{prefix}[calculator_attributes][preferred_base_amount]",
6
+ calculator.preferred_base_amount,
7
+ type: calculator.preference_type(:base_amount)) %>
8
+ </div>
9
+
10
+ <div class="form-group no-marginb">
11
+ <%= label_tag nil, Spree.t(:tiers) %>
12
+ <%= content_tag :div, nil, class: "hidden js-original-tiers",
13
+ data: { :'original-tiers' => Hash[calculator.preferred_tiers.sort] } %>
14
+ </div>
15
+
16
+ <div class="js-tiers"></div>
17
+ <button class="btn btn-success js-add-tier"><%= Spree.t(:add) %></button>
18
+
19
+ <script type="text/x-handlebars-template" id="tier-input-name">
20
+ <%= prefix %>[calculator_attributes][preferred_tiers][{{base}}]
21
+ </script>
22
+
23
+ <script type="text/x-handlebars-template" id="tier-fields-template">
24
+ <div class="tier panel panel-default">
25
+ <div class="panel-body">
26
+ <div class="form-group">
27
+ <div class="input-group">
28
+ <span class="input-group-addon">$</span>
29
+ <input class="js-base-input form-control" type="text" value={{baseField.value}}>
30
+ </div>
31
+ </div>
32
+ <div class="form-group">
33
+ <div class="input-group">
34
+ <span class="input-group-addon">$</span>
35
+ <input class="js-value-input form-control"
36
+ name="{{valueField.name}}" type="text" value={{valueField.value}}>
37
+ </div>
38
+ </div>
39
+ <a class="js-remove-tier btn btn-default btn-sm"><span class="icon icon-delete"></span></a>
40
+ </div>
41
+ </div>
42
+ </script>
@@ -0,0 +1,42 @@
1
+ <div class="form-group">
2
+ <%= label_tag "#{prefix}[calculator_attributes][preferred_base_percent]",
3
+ Spree.t(:base_percent) %>
4
+ <%= preference_field_tag(
5
+ "#{prefix}[calculator_attributes][preferred_base_percent]",
6
+ calculator.preferred_base_percent,
7
+ type: calculator.preference_type(:base_percent)) %>
8
+ </div>
9
+
10
+ <div class="form-group no-marginb">
11
+ <%= label_tag nil, Spree.t(:tiers) %>
12
+ <%= content_tag :div, nil, class: "hidden js-original-tiers",
13
+ data: { :'original-tiers' => Hash[calculator.preferred_tiers.sort] } %>
14
+ </div>
15
+
16
+ <div class="js-tiers"></div>
17
+ <button class="btn btn-success js-add-tier"><%= Spree.t(:add) %></button>
18
+
19
+ <script type="text/x-handlebars-template" id="tier-input-name">
20
+ <%= prefix %>[calculator_attributes][preferred_tiers][{{base}}]
21
+ </script>
22
+
23
+ <script type="text/x-handlebars-template" id="tier-fields-template">
24
+ <div class="tier panel panel-default">
25
+ <div class="panel-body">
26
+ <div class="form-group">
27
+ <div class="input-group">
28
+ <span class="input-group-addon">$</span>
29
+ <input class="js-base-input form-control" type="text" value={{baseField.value}}>
30
+ </div>
31
+ </div>
32
+ <div class="form-group">
33
+ <div class="input-group">
34
+ <span class="input-group-addon">%</span>
35
+ <input class="js-value-input form-control"
36
+ name="{{valueField.name}}" type="text" value={{valueField.value}}>
37
+ </div>
38
+ </div>
39
+ <a class="js-remove-tier btn btn-default btn-sm"><span class="icon icon-delete"></span></a>
40
+ </div>
41
+ </div>
42
+ </script>
@@ -0,0 +1,30 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t(:promotions), admin_promotions_url %> /
3
+ <%= @promotion.name %>
4
+ <% end %>
5
+
6
+ <%= form_for @promotion, :url => object_url, :method => :put do |f| %>
7
+ <div class="row">
8
+ <div class="col-md-12">
9
+ <%= render :partial => 'form', :locals => { :f => f } %>
10
+ <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
11
+ </div>
12
+ </div>
13
+
14
+ <% end %>
15
+
16
+ <div id="promotion-filters" class="row">
17
+ <div id="rules_container" class="col-md-6">
18
+ <div class="panel panel-default">
19
+ <%= render :partial => 'rules' %>
20
+ </div>
21
+ </div>
22
+
23
+ <div id="actions_container" class="col-md-6">
24
+ <div class="panel panel-default">
25
+ <%= render :partial => 'actions' %>
26
+ </div>
27
+ </div>
28
+ </div>
29
+
30
+ <%= render :partial => "spree/admin/variants/autocomplete", :formats => [:js] %>