solidus_backend 1.3.2 → 1.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

Files changed (290) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -0
  3. data/app/assets/javascripts/spree/backend/components/tooltips.js +2 -0
  4. data/app/assets/javascripts/spree/backend/product_picker.js +2 -2
  5. data/app/assets/javascripts/spree/backend/routes.js +0 -1
  6. data/app/assets/javascripts/spree/backend/shipments.js +147 -118
  7. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +16 -14
  8. data/app/assets/javascripts/spree/backend/templates/orders/customer_details/autocomplete.hbs +1 -1
  9. data/app/assets/javascripts/spree/backend/templates/variants/autocomplete.hbs.erb +1 -1
  10. data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs +1 -1
  11. data/app/assets/javascripts/spree/backend/templates/variants/split.hbs +25 -27
  12. data/app/assets/javascripts/spree/backend/user_picker.js +14 -8
  13. data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +3 -3
  14. data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +4 -0
  15. data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +0 -1
  16. data/app/assets/stylesheets/spree/backend/components/_hint.scss +3 -0
  17. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +0 -1
  18. data/app/assets/stylesheets/spree/backend/components/_progress.scss +5 -2
  19. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +14 -5
  20. data/app/assets/stylesheets/spree/backend/components/_states.scss +1 -2
  21. data/app/assets/stylesheets/spree/backend/globals/_mixins.css +2 -0
  22. data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +22 -0
  23. data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +12 -3
  24. data/app/assets/stylesheets/spree/backend/sections/_products.scss +25 -7
  25. data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +0 -1
  26. data/app/assets/stylesheets/spree/backend/sections/_transfer_items.scss +0 -1
  27. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +4 -6
  28. data/app/assets/stylesheets/spree/backend/shared/_header.scss +5 -2
  29. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +36 -3
  30. data/app/assets/stylesheets/spree/backend/shared/_tables.scss +1 -3
  31. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +0 -2
  32. data/app/assets/stylesheets/spree/backend/spree_admin.scss +3 -1
  33. data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
  34. data/app/controllers/spree/admin/general_settings_controller.rb +0 -6
  35. data/app/controllers/spree/admin/orders/customer_details_controller.rb +7 -0
  36. data/app/controllers/spree/admin/orders_controller.rb +1 -1
  37. data/app/controllers/spree/admin/payment_methods_controller.rb +8 -3
  38. data/app/controllers/spree/admin/payments_controller.rb +12 -5
  39. data/app/controllers/spree/admin/products_controller.rb +1 -1
  40. data/app/controllers/spree/admin/refunds_controller.rb +1 -1
  41. data/app/controllers/spree/admin/reimbursements_controller.rb +1 -1
  42. data/app/controllers/spree/admin/root_controller.rb +1 -1
  43. data/app/controllers/spree/admin/stock_items_controller.rb +0 -8
  44. data/app/controllers/spree/admin/stock_transfers_controller.rb +6 -6
  45. data/app/controllers/spree/admin/users_controller.rb +7 -3
  46. data/app/helpers/spree/admin/base_helper.rb +11 -0
  47. data/app/helpers/spree/admin/navigation_helper.rb +46 -3
  48. data/app/helpers/spree/admin/orders_helper.rb +0 -1
  49. data/app/helpers/spree/admin/stock_locations_helper.rb +1 -5
  50. data/app/models/spree/backend_configuration.rb +100 -0
  51. data/app/views/spree/admin/adjustment_reasons/edit.html.erb +4 -7
  52. data/app/views/spree/admin/adjustment_reasons/index.html.erb +4 -4
  53. data/app/views/spree/admin/adjustment_reasons/new.html.erb +4 -4
  54. data/app/views/spree/admin/adjustments/edit.html.erb +4 -6
  55. data/app/views/spree/admin/adjustments/index.html.erb +3 -6
  56. data/app/views/spree/admin/adjustments/new.html.erb +5 -6
  57. data/app/views/spree/admin/cancellations/index.html.erb +4 -3
  58. data/app/views/spree/admin/countries/edit.html.erb +4 -6
  59. data/app/views/spree/admin/countries/index.html.erb +4 -4
  60. data/app/views/spree/admin/countries/new.html.erb +4 -4
  61. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +1 -1
  62. data/app/views/spree/admin/customer_returns/edit.html.erb +4 -6
  63. data/app/views/spree/admin/customer_returns/index.html.erb +2 -5
  64. data/app/views/spree/admin/customer_returns/new.html.erb +5 -6
  65. data/app/views/spree/admin/general_settings/edit.html.erb +4 -28
  66. data/app/views/spree/admin/images/edit.html.erb +6 -2
  67. data/app/views/spree/admin/images/index.html.erb +3 -0
  68. data/app/views/spree/admin/images/new.html.erb +3 -3
  69. data/app/views/spree/admin/log_entries/index.html.erb +4 -8
  70. data/app/views/spree/admin/option_types/edit.html.erb +7 -9
  71. data/app/views/spree/admin/option_types/index.html.erb +4 -4
  72. data/app/views/spree/admin/orders/_shipment.html.erb +4 -1
  73. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +4 -1
  74. data/app/views/spree/admin/orders/cart.html.erb +4 -8
  75. data/app/views/spree/admin/orders/confirm.html.erb +3 -4
  76. data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
  77. data/app/views/spree/admin/orders/confirm_advance.html.erb +3 -4
  78. data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
  79. data/app/views/spree/admin/orders/customer_details/edit.html.erb +2 -4
  80. data/app/views/spree/admin/orders/customer_details/show.html.erb +3 -5
  81. data/app/views/spree/admin/orders/edit.html.erb +1 -8
  82. data/app/views/spree/admin/orders/index.html.erb +11 -5
  83. data/app/views/spree/admin/payment_methods/edit.html.erb +5 -7
  84. data/app/views/spree/admin/payment_methods/index.html.erb +6 -5
  85. data/app/views/spree/admin/payment_methods/new.html.erb +6 -7
  86. data/app/views/spree/admin/payments/_capture_events.html.erb +1 -1
  87. data/app/views/spree/admin/payments/credit.html.erb +3 -3
  88. data/app/views/spree/admin/payments/index.html.erb +4 -7
  89. data/app/views/spree/admin/payments/new.html.erb +4 -5
  90. data/app/views/spree/admin/payments/show.html.erb +4 -7
  91. data/app/views/spree/admin/prices/_form.html.erb +1 -0
  92. data/app/views/spree/admin/prices/index.html.erb +2 -2
  93. data/app/views/spree/admin/product_properties/index.html.erb +3 -1
  94. data/app/views/spree/admin/products/_form.html.erb +11 -18
  95. data/app/views/spree/admin/products/_properties_form.erb +1 -1
  96. data/app/views/spree/admin/products/edit.html.erb +3 -2
  97. data/app/views/spree/admin/products/index.html.erb +19 -28
  98. data/app/views/spree/admin/products/new.html.erb +4 -2
  99. data/app/views/spree/admin/promotion_categories/edit.html.erb +4 -3
  100. data/app/views/spree/admin/promotion_categories/index.html.erb +4 -4
  101. data/app/views/spree/admin/promotion_categories/new.html.erb +4 -3
  102. data/app/views/spree/admin/promotion_rules/create.js.erb +1 -1
  103. data/app/views/spree/admin/promotions/_actions.html.erb +3 -3
  104. data/app/views/spree/admin/promotions/_rules.html.erb +2 -2
  105. data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +1 -1
  106. data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +1 -1
  107. data/app/views/spree/admin/promotions/edit.html.erb +4 -5
  108. data/app/views/spree/admin/promotions/index.html.erb +3 -5
  109. data/app/views/spree/admin/promotions/new.html.erb +3 -3
  110. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +2 -2
  111. data/app/views/spree/admin/properties/edit.html.erb +3 -6
  112. data/app/views/spree/admin/properties/index.html.erb +5 -5
  113. data/app/views/spree/admin/prototypes/_form.html.erb +3 -3
  114. data/app/views/spree/admin/prototypes/_prototypes.html.erb +1 -1
  115. data/app/views/spree/admin/prototypes/edit.html.erb +3 -6
  116. data/app/views/spree/admin/prototypes/index.html.erb +4 -4
  117. data/app/views/spree/admin/prototypes/show.html.erb +2 -2
  118. data/app/views/spree/admin/refund_reasons/edit.html.erb +4 -4
  119. data/app/views/spree/admin/refund_reasons/index.html.erb +5 -4
  120. data/app/views/spree/admin/refund_reasons/new.html.erb +5 -4
  121. data/app/views/spree/admin/refunds/edit.html.erb +5 -6
  122. data/app/views/spree/admin/refunds/new.html.erb +6 -6
  123. data/app/views/spree/admin/reimbursement_types/index.html.erb +4 -3
  124. data/app/views/spree/admin/reimbursements/edit.html.erb +5 -6
  125. data/app/views/spree/admin/reimbursements/index.html.erb +2 -4
  126. data/app/views/spree/admin/reimbursements/show.html.erb +3 -4
  127. data/app/views/spree/admin/reports/index.html.erb +2 -3
  128. data/app/views/spree/admin/reports/sales_total.html.erb +2 -4
  129. data/app/views/spree/admin/return_authorizations/edit.html.erb +15 -16
  130. data/app/views/spree/admin/return_authorizations/index.html.erb +3 -5
  131. data/app/views/spree/admin/return_authorizations/new.html.erb +5 -6
  132. data/app/views/spree/admin/return_reasons/edit.html.erb +3 -2
  133. data/app/views/spree/admin/return_reasons/index.html.erb +3 -1
  134. data/app/views/spree/admin/return_reasons/new.html.erb +4 -2
  135. data/app/views/spree/admin/shared/_areas_tabs.html.erb +3 -3
  136. data/app/views/spree/admin/shared/_configuration_menu.html.erb +2 -2
  137. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
  138. data/app/views/spree/admin/shared/_head.html.erb +1 -8
  139. data/app/views/spree/admin/shared/_header.html.erb +8 -12
  140. data/app/views/spree/admin/shared/_new_resource_links.html.erb +2 -2
  141. data/app/views/spree/admin/shared/_no_objects_found.html.erb +1 -1
  142. data/app/views/spree/admin/shared/_order_submenu.html.erb +10 -10
  143. data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
  144. data/app/views/spree/admin/shared/_order_tabs.html.erb +3 -3
  145. data/app/views/spree/admin/shared/_payments_tabs.html.erb +1 -1
  146. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +2 -2
  147. data/app/views/spree/admin/shared/_product_tabs.html.erb +8 -9
  148. data/app/views/spree/admin/shared/_report_criteria.html.erb +2 -2
  149. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +2 -2
  150. data/app/views/spree/admin/shared/_settings_checkout_tabs.html.erb +4 -4
  151. data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +5 -5
  152. data/app/views/spree/admin/shared/_shipping_tabs.html.erb +4 -3
  153. data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
  154. data/app/views/spree/admin/shared/_tabs.html.erb +12 -37
  155. data/app/views/spree/admin/shared/_taxes_tabs.html.erb +2 -2
  156. data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
  157. data/app/views/spree/admin/shared/named_types/_edit.html.erb +5 -5
  158. data/app/views/spree/admin/shared/named_types/_index.html.erb +5 -4
  159. data/app/views/spree/admin/shared/named_types/_new.html.erb +5 -4
  160. data/app/views/spree/admin/shipping_categories/edit.html.erb +5 -6
  161. data/app/views/spree/admin/shipping_categories/index.html.erb +5 -4
  162. data/app/views/spree/admin/shipping_categories/new.html.erb +5 -6
  163. data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
  164. data/app/views/spree/admin/shipping_methods/edit.html.erb +5 -6
  165. data/app/views/spree/admin/shipping_methods/index.html.erb +5 -5
  166. data/app/views/spree/admin/shipping_methods/new.html.erb +5 -6
  167. data/app/views/spree/admin/states/edit.html.erb +5 -6
  168. data/app/views/spree/admin/states/index.html.erb +5 -4
  169. data/app/views/spree/admin/states/new.html.erb +5 -3
  170. data/app/views/spree/admin/stock_items/index.html.erb +4 -7
  171. data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +2 -2
  172. data/app/views/spree/admin/stock_locations/edit.html.erb +5 -5
  173. data/app/views/spree/admin/stock_locations/index.html.erb +16 -9
  174. data/app/views/spree/admin/stock_locations/new.html.erb +5 -4
  175. data/app/views/spree/admin/stock_movements/index.html.erb +3 -4
  176. data/app/views/spree/admin/stock_movements/new.html.erb +2 -3
  177. data/app/views/spree/admin/stock_transfers/_location.html.erb +7 -0
  178. data/app/views/spree/admin/stock_transfers/_transfer_item_table.html.erb +1 -1
  179. data/app/views/spree/admin/stock_transfers/edit.html.erb +5 -6
  180. data/app/views/spree/admin/stock_transfers/index.html.erb +5 -5
  181. data/app/views/spree/admin/stock_transfers/new.html.erb +6 -8
  182. data/app/views/spree/admin/stock_transfers/receive.html.erb +4 -12
  183. data/app/views/spree/admin/stock_transfers/show.html.erb +6 -12
  184. data/app/views/spree/admin/stock_transfers/tracking_info.html.erb +5 -13
  185. data/app/views/spree/admin/store_credits/edit_amount.html.erb +6 -4
  186. data/app/views/spree/admin/store_credits/edit_validity.html.erb +8 -6
  187. data/app/views/spree/admin/store_credits/index.html.erb +5 -5
  188. data/app/views/spree/admin/store_credits/new.html.erb +5 -4
  189. data/app/views/spree/admin/store_credits/show.html.erb +5 -4
  190. data/app/views/spree/admin/style_guide/topics/typography/_icons.html.erb +2 -2
  191. data/app/views/spree/admin/tax_categories/edit.html.erb +5 -4
  192. data/app/views/spree/admin/tax_categories/index.html.erb +5 -4
  193. data/app/views/spree/admin/tax_categories/new.html.erb +5 -4
  194. data/app/views/spree/admin/tax_rates/edit.html.erb +5 -6
  195. data/app/views/spree/admin/tax_rates/index.html.erb +5 -4
  196. data/app/views/spree/admin/tax_rates/new.html.erb +5 -6
  197. data/app/views/spree/admin/taxonomies/edit.erb +7 -9
  198. data/app/views/spree/admin/taxonomies/index.html.erb +4 -4
  199. data/app/views/spree/admin/taxonomies/new.html.erb +5 -7
  200. data/app/views/spree/admin/taxons/edit.html.erb +5 -6
  201. data/app/views/spree/admin/taxons/index.html.erb +2 -3
  202. data/app/views/spree/admin/trackers/edit.html.erb +5 -6
  203. data/app/views/spree/admin/trackers/index.html.erb +4 -4
  204. data/app/views/spree/admin/trackers/new.html.erb +4 -6
  205. data/app/views/spree/admin/users/_form.html.erb +2 -2
  206. data/app/views/spree/admin/users/_tabs.html.erb +5 -5
  207. data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -4
  208. data/app/views/spree/admin/users/addresses.html.erb +5 -4
  209. data/app/views/spree/admin/users/edit.html.erb +6 -6
  210. data/app/views/spree/admin/users/index.html.erb +4 -5
  211. data/app/views/spree/admin/users/items.html.erb +4 -3
  212. data/app/views/spree/admin/users/new.html.erb +2 -9
  213. data/app/views/spree/admin/users/orders.html.erb +4 -3
  214. data/app/views/spree/admin/variants/_form.html.erb +1 -0
  215. data/app/views/spree/admin/variants/edit.html.erb +4 -3
  216. data/app/views/spree/admin/variants/index.html.erb +10 -8
  217. data/app/views/spree/admin/variants/new.html.erb +5 -0
  218. data/app/views/spree/admin/zones/_country_members.html.erb +2 -2
  219. data/app/views/spree/admin/zones/_state_members.html.erb +2 -2
  220. data/app/views/spree/admin/zones/edit.html.erb +5 -6
  221. data/app/views/spree/admin/zones/index.html.erb +5 -4
  222. data/app/views/spree/admin/zones/new.html.erb +6 -7
  223. data/app/views/spree/layouts/admin.html.erb +28 -15
  224. data/config/initializers/form_builder.rb +6 -0
  225. data/config/routes.rb +2 -6
  226. data/spec/controllers/spree/admin/cancellations_controller_spec.rb +3 -3
  227. data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +4 -4
  228. data/spec/controllers/spree/admin/missing_products_controller_spec.rb +1 -1
  229. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +5 -5
  230. data/spec/controllers/spree/admin/orders_controller_spec.rb +28 -28
  231. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +5 -5
  232. data/spec/controllers/spree/admin/payments_controller_spec.rb +7 -7
  233. data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -2
  234. data/spec/controllers/spree/admin/product_properties_controller_spec.rb +1 -1
  235. data/spec/controllers/spree/admin/products_controller_spec.rb +6 -6
  236. data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -2
  237. data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +1 -1
  238. data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +2 -2
  239. data/spec/controllers/spree/admin/promotions_controller_spec.rb +7 -7
  240. data/spec/controllers/spree/admin/refunds_controller_spec.rb +1 -1
  241. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +5 -5
  242. data/spec/controllers/spree/admin/reports_controller_spec.rb +2 -2
  243. data/spec/controllers/spree/admin/resource_controller_spec.rb +6 -6
  244. data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +11 -11
  245. data/spec/controllers/spree/admin/return_items_controller_spec.rb +1 -1
  246. data/spec/controllers/spree/admin/search_controller_spec.rb +2 -2
  247. data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +1 -1
  248. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +3 -3
  249. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +3 -3
  250. data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +10 -10
  251. data/spec/controllers/spree/admin/store_credits_controller_spec.rb +10 -10
  252. data/spec/controllers/spree/admin/users_controller_spec.rb +139 -141
  253. data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -2
  254. data/spec/features/admin/configuration/general_settings_spec.rb +7 -16
  255. data/spec/features/admin/configuration/payment_methods_spec.rb +7 -7
  256. data/spec/features/admin/configuration/stock_locations_spec.rb +1 -1
  257. data/spec/features/admin/configuration/tax_categories_spec.rb +1 -1
  258. data/spec/features/admin/configuration/zones_spec.rb +1 -1
  259. data/spec/features/admin/homepage_spec.rb +2 -2
  260. data/spec/features/admin/orders/adjustments_spec.rb +1 -1
  261. data/spec/features/admin/orders/cancelling_inventory_spec.rb +8 -8
  262. data/spec/features/admin/orders/customer_details_spec.rb +20 -5
  263. data/spec/features/admin/orders/listing_spec.rb +97 -70
  264. data/spec/features/admin/orders/new_order_spec.rb +35 -6
  265. data/spec/features/admin/orders/order_details_spec.rb +37 -58
  266. data/spec/features/admin/orders/payments_spec.rb +57 -4
  267. data/spec/features/admin/orders/return_authorizations_spec.rb +25 -0
  268. data/spec/features/admin/orders/shipments_spec.rb +5 -5
  269. data/spec/features/admin/products/edit/products_spec.rb +1 -1
  270. data/spec/features/admin/products/edit/taxons_spec.rb +5 -5
  271. data/spec/features/admin/products/edit/variants_spec.rb +1 -1
  272. data/spec/features/admin/products/option_types_spec.rb +2 -2
  273. data/spec/features/admin/products/products_spec.rb +6 -6
  274. data/spec/features/admin/products/properties_spec.rb +6 -6
  275. data/spec/features/admin/products/prototypes_spec.rb +1 -1
  276. data/spec/features/admin/products/stock_management_spec.rb +5 -5
  277. data/spec/features/admin/promotion_adjustments_spec.rb +8 -8
  278. data/spec/features/admin/promotions/option_value_rule_spec.rb +4 -4
  279. data/spec/features/admin/promotions/product_rule_spec.rb +33 -0
  280. data/spec/features/admin/promotions/tiered_calculator_spec.rb +2 -2
  281. data/spec/features/admin/promotions/user_rule_spec.rb +15 -0
  282. data/spec/features/admin/reports_spec.rb +1 -1
  283. data/spec/features/admin/users_spec.rb +27 -2
  284. data/spec/helpers/admin/base_helper_spec.rb +30 -0
  285. data/spec/helpers/admin/navigation_helper_spec.rb +40 -2
  286. data/spec/spec_helper.rb +10 -8
  287. data/spec/support/feature/order_feature_helper.rb +17 -0
  288. metadata +18 -11
  289. data/app/assets/javascripts/spree/backend/general_settings.js.coffee +0 -13
  290. data/spec/controllers/spree/admin/general_settings_controller_spec.rb +0 -41
@@ -134,9 +134,8 @@ table {
134
134
  border-top: 1px solid $color-border;
135
135
  border-bottom: none;
136
136
  background-color: $color-tbl-thead;
137
- text-transform: uppercase;
138
137
  text-align: center;
139
- font-size: 85%;
138
+ font-size: 90%;
140
139
  font-weight: $font-weight-bold;
141
140
  }
142
141
  }
@@ -202,7 +201,6 @@ table {
202
201
  &.grand-total {
203
202
  td {
204
203
  border-color: $color-2 !important;
205
- text-transform: uppercase;
206
204
  font-size: 110%;
207
205
  font-weight: $font-weight-bold;
208
206
  background-color: lighten($color-2, 50);
@@ -102,7 +102,6 @@ dl {
102
102
  width: 40%;
103
103
  font-weight: $font-weight-bold;
104
104
  padding-left: 0;
105
- text-transform: uppercase;
106
105
  font-size: 85%;
107
106
  clear: left;
108
107
  }
@@ -136,7 +135,6 @@ dl {
136
135
  .no-objects-found {
137
136
  text-align: center;
138
137
  font-size: 120%;
139
- text-transform: uppercase;
140
138
  padding: 40px 0px;
141
139
  color: lighten($color-body-text, 15);
142
140
  }
@@ -7,7 +7,7 @@
7
7
  @import 'bootstrap_custom';
8
8
  @import 'solidus_admin/bootstrap/bootstrap';
9
9
 
10
- @import 'spree/backend/globals/mixins/caret';
10
+ @import 'spree/backend/globals/mixins';
11
11
 
12
12
  @import 'spree/backend/shared/skeleton';
13
13
  @import 'spree/backend/shared/typography';
@@ -20,7 +20,9 @@
20
20
 
21
21
  @import 'spree/backend/components/states';
22
22
  @import 'spree/backend/components/actions';
23
+ @import 'spree/backend/components/breadcrumb';
23
24
  @import 'spree/backend/components/date-picker';
25
+ @import 'spree/backend/components/hint';
24
26
  @import 'spree/backend/components/list_group';
25
27
  @import 'spree/backend/components/messages';
26
28
  @import 'spree/backend/components/progress';
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  module Admin
3
3
  class CancellationsController < Spree::Admin::BaseController
4
- before_filter :load_order, only: [:index, :short_ship]
4
+ before_action :load_order, only: [:index, :short_ship]
5
5
 
6
6
  def index
7
7
  @inventory_units = @order.inventory_units.cancelable
@@ -17,12 +17,6 @@ module Spree
17
17
  end
18
18
  end
19
19
 
20
- def clear_cache
21
- Rails.cache.clear
22
- invoke_callbacks(:clear_cache, :after)
23
- head :no_content
24
- end
25
-
26
20
  private
27
21
 
28
22
  def store_params
@@ -2,6 +2,8 @@ module Spree
2
2
  module Admin
3
3
  module Orders
4
4
  class CustomerDetailsController < Spree::Admin::BaseController
5
+ rescue_from Spree::Order::InsufficientStock, with: :insufficient_stock_error
6
+
5
7
  before_action :load_order
6
8
 
7
9
  def show
@@ -59,6 +61,11 @@ module Spree
59
61
  def should_associate_user?
60
62
  params[:guest_checkout] == "false" && params[:user_id] && params[:user_id].to_i != @order.user_id
61
63
  end
64
+
65
+ def insufficient_stock_error
66
+ flash[:error] = Spree.t(:insufficient_stock_for_order)
67
+ redirect_to edit_admin_order_customer_url(@order)
68
+ end
62
69
  end
63
70
  end
64
71
  end
@@ -3,7 +3,7 @@ module Spree
3
3
  class OrdersController < Spree::Admin::BaseController
4
4
  before_action :initialize_order_events
5
5
  before_action :load_order, only: [:edit, :update, :complete, :advance, :cancel, :resume, :approve, :resend, :unfinalize_adjustments, :finalize_adjustments, :cart, :confirm]
6
- around_filter :lock_order, only: [:update, :advance, :complete, :confirm, :cancel, :resume, :approve, :resend]
6
+ around_action :lock_order, only: [:update, :advance, :complete, :confirm, :cancel, :resume, :approve, :resend]
7
7
 
8
8
  rescue_from Spree::Order::InsufficientStock, with: :insufficient_stock_error
9
9
 
@@ -25,8 +25,7 @@ module Spree
25
25
  @payment_method = @payment_method.becomes(@payment_method_type)
26
26
  invoke_callbacks(:update, :before)
27
27
 
28
- update_params = params[ActiveModel::Naming.param_key(@payment_method)] || {}
29
- attributes = payment_method_params.merge(update_params)
28
+ attributes = payment_method_params
30
29
  attributes.each do |k, _v|
31
30
  if k.include?("password") && attributes[k].blank?
32
31
  attributes.delete(k)
@@ -65,7 +64,13 @@ module Spree
65
64
  end
66
65
 
67
66
  def payment_method_params
68
- params.require(:payment_method).permit!
67
+ superclass_params = params.require(:payment_method).permit!
68
+ subclass_params = params[ActiveModel::Naming.param_key(@payment_method_type)] || ActionController::Parameters.new
69
+
70
+ superclass_params = superclass_params.permit!
71
+ subclass_params = subclass_params.permit!
72
+
73
+ superclass_params.to_h.merge(subclass_params.to_h)
69
74
  end
70
75
  end
71
76
  end
@@ -1,11 +1,13 @@
1
1
  module Spree
2
2
  module Admin
3
3
  class PaymentsController < Spree::Admin::BaseController
4
- before_filter :load_order, only: [:create, :new, :index, :fire]
5
- before_filter :load_payment, except: [:create, :new, :index, :fire]
6
- before_filter :load_payment_for_fire, only: :fire
7
- before_filter :load_data
8
- before_filter :require_bill_address, only: [:index]
4
+ rescue_from Spree::Order::InsufficientStock, with: :insufficient_stock_error
5
+
6
+ before_action :load_order, only: [:create, :new, :index, :fire]
7
+ before_action :load_payment, except: [:create, :new, :index, :fire]
8
+ before_action :load_payment_for_fire, only: :fire
9
+ before_action :load_data
10
+ before_action :require_bill_address, only: [:index]
9
11
 
10
12
  respond_to :html
11
13
 
@@ -109,6 +111,11 @@ module Spree
109
111
  redirect_to edit_admin_order_customer_url(@order)
110
112
  end
111
113
  end
114
+
115
+ def insufficient_stock_error
116
+ flash[:error] = Spree.t(:insufficient_stock_for_order)
117
+ redirect_to new_admin_order_payment_url(@order)
118
+ end
112
119
  end
113
120
  end
114
121
  end
@@ -3,7 +3,7 @@ module Spree
3
3
  class ProductsController < ResourceController
4
4
  helper 'spree/products'
5
5
 
6
- before_filter :load_data, except: [:index]
6
+ before_action :load_data, except: [:index]
7
7
  create.before :create_before
8
8
  update.before :update_before
9
9
  helper_method :clone_object_url
@@ -6,7 +6,7 @@ module Spree
6
6
 
7
7
  helper_method :refund_reasons
8
8
 
9
- rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error, only: :create
9
+ rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error
10
10
 
11
11
  private
12
12
 
@@ -6,7 +6,7 @@ module Spree
6
6
  before_action :load_stock_locations, only: :edit
7
7
  before_action :load_simulated_refunds, only: :edit
8
8
 
9
- rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error, only: :perform
9
+ rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error
10
10
 
11
11
  def perform
12
12
  @reimbursement.perform!
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  module Admin
3
3
  class RootController < Spree::Admin::BaseController
4
- skip_before_filter :authorize_admin
4
+ skip_before_action :authorize_admin
5
5
 
6
6
  def index
7
7
  redirect_to admin_root_redirect_path
@@ -12,14 +12,6 @@ module Spree
12
12
 
13
13
  private
14
14
 
15
- def location_after_destroy
16
- :back
17
- end
18
-
19
- def location_after_save
20
- :back
21
- end
22
-
23
15
  def build_resource
24
16
  variant = Variant.accessible_by(current_ability, :read).find(params[:variant_id])
25
17
  stock_location = StockLocation.accessible_by(current_ability, :read).find(params[:stock_location_id])
@@ -7,12 +7,12 @@ module Spree
7
7
  { translation_key: :name, attr_name: :name }
8
8
  ]
9
9
 
10
- before_filter :load_viewable_stock_locations, only: :index
11
- before_filter :load_variant_display_attributes, only: [:receive, :edit, :show, :tracking_info]
12
- before_filter :load_source_stock_locations, only: :new
13
- before_filter :load_destination_stock_locations, only: :edit
14
- before_filter :ensure_access_to_stock_location, only: :create
15
- before_filter :ensure_receivable_stock_transfer, only: :receive
10
+ before_action :load_viewable_stock_locations, only: :index
11
+ before_action :load_variant_display_attributes, only: [:receive, :edit, :show, :tracking_info]
12
+ before_action :load_source_stock_locations, only: :new
13
+ before_action :load_destination_stock_locations, only: :edit
14
+ before_action :ensure_access_to_stock_location, only: :create
15
+ before_action :ensure_receivable_stock_transfer, only: :receive
16
16
 
17
17
  create.before :authorize_transfer_attributes!
18
18
 
@@ -5,7 +5,7 @@ module Spree
5
5
 
6
6
  after_action :sign_in_if_change_own_password, only: :update
7
7
 
8
- before_filter :load_roles, :load_stock_locations, only: [:edit, :new]
8
+ before_action :load_roles, :load_stock_locations, only: [:edit, :new]
9
9
 
10
10
  def index
11
11
  respond_with(@collection) do |format|
@@ -38,9 +38,13 @@ module Spree
38
38
  set_roles
39
39
  set_stock_locations
40
40
  flash[:success] = Spree.t(:account_updated)
41
- end
41
+ redirect_to edit_admin_user_url(@user)
42
+ else
43
+ load_roles
44
+ load_stock_locations
42
45
 
43
- redirect_to edit_admin_user_url(@user)
46
+ render :edit, status: :unprocessable_entity
47
+ end
44
48
  end
45
49
 
46
50
  def addresses
@@ -22,6 +22,12 @@ module Spree
22
22
  end
23
23
  end
24
24
 
25
+ def admin_hint(title, text)
26
+ content_tag(:span, class: 'hint-tooltip', title: title, data: { content: text }) do
27
+ content_tag(:i, '', class: 'fa fa-info-circle')
28
+ end
29
+ end
30
+
25
31
  def datepicker_field_value(date)
26
32
  unless date.blank?
27
33
  l(date, format: Spree.t('date_picker.format', default: '%Y/%m/%d'))
@@ -155,6 +161,11 @@ module Spree
155
161
  dom_id(record, 'spree')
156
162
  end
157
163
 
164
+ def admin_layout(layout = nil)
165
+ @admin_layout = layout if layout
166
+ @admin_layout
167
+ end
168
+
158
169
  private
159
170
 
160
171
  def attribute_name_for(field_name)
@@ -1,6 +1,41 @@
1
1
  module Spree
2
2
  module Admin
3
3
  module NavigationHelper
4
+ def admin_breadcrumbs
5
+ @admin_breadcrumbs ||= []
6
+ end
7
+
8
+ # Add items to current page breadcrumb heirarchy
9
+ def admin_breadcrumb(*ancestors, &block)
10
+ admin_breadcrumbs.concat(ancestors) if ancestors.present?
11
+ admin_breadcrumbs.push(capture(&block)) if block_given?
12
+ end
13
+
14
+ # Render Bootstrap style breadcrumbs
15
+ def render_admin_breadcrumbs
16
+ if content_for?(:page_title)
17
+ admin_breadcrumb(content_for(:page_title))
18
+ end
19
+
20
+ content_tag :ol, class: 'breadcrumb' do
21
+ safe_join admin_breadcrumbs.map { |level|
22
+ content_tag(:li, level, class: "separator #{level == admin_breadcrumbs.last ? 'active' : ''}")
23
+ }
24
+ end
25
+ end
26
+
27
+ def admin_page_title
28
+ if content_for?(:title)
29
+ content_for(:title)
30
+ elsif content_for?(:page_title)
31
+ content_for(:page_title)
32
+ elsif admin_breadcrumbs.any?
33
+ strip_tags(admin_breadcrumbs.last)
34
+ else
35
+ Spree.t(controller.controller_name, default: controller.controller_name.titleize)
36
+ end
37
+ end
38
+
4
39
  # Make an admin tab that coveres one or more resources supplied by symbols
5
40
  # Option hash may follow. Valid options are
6
41
  # * :label to override link text, otherwise based on the first resource name (translated)
@@ -29,7 +64,7 @@ module Spree
29
64
  selected = if options[:match_path].is_a? Regexp
30
65
  request.fullpath =~ options[:match_path]
31
66
  elsif options[:match_path]
32
- request.fullpath.starts_with?("#{admin_path}#{options[:match_path]}")
67
+ request.fullpath.starts_with?("#{spree.admin_path}#{options[:match_path]}")
33
68
  else
34
69
  request.fullpath.starts_with?(destination_url) ||
35
70
  args.include?(controller.controller_name.to_sym)
@@ -66,8 +101,9 @@ module Spree
66
101
  def link_to_delete(resource, options = {})
67
102
  url = options[:url] || object_url(resource)
68
103
  name = options[:name] || Spree.t('actions.delete')
104
+ confirm = options[:confirm] || Spree.t(:are_you_sure)
69
105
  options[:class] = "delete-resource"
70
- options[:data] = { confirm: Spree.t(:are_you_sure), action: 'remove' }
106
+ options[:data] = { confirm: confirm, action: 'remove' }
71
107
  link_to_with_icon 'trash', name, url, options
72
108
  end
73
109
 
@@ -85,7 +121,12 @@ module Spree
85
121
  end
86
122
 
87
123
  def button(text, icon_name = nil, button_type = 'submit', options = {})
88
- button_tag(text, options.merge(type: button_type, class: "fa fa-#{icon_name} button"))
124
+ class_names = "button"
125
+ if icon_name
126
+ Spree::Deprecation.warn "Using icon_name arg is deprecated. Icons could not be visible in future versions.", caller
127
+ class_names.prepend "fa fa-#{icon_name} "
128
+ end
129
+ button_tag(text, options.merge(type: button_type, class: class_names))
89
130
  end
90
131
 
91
132
  def button_link_to(text, url, html_options = {})
@@ -100,6 +141,7 @@ module Spree
100
141
  html_options[:class] += ' button'
101
142
 
102
143
  if html_options[:icon]
144
+ Spree::Deprecation.warn "Using :icon option is deprecated. Icons could not be visible in future versions.", caller
103
145
  html_options[:class] += " fa fa-#{html_options[:icon]}"
104
146
  end
105
147
  link_to(text, url, html_options)
@@ -135,6 +177,7 @@ module Spree
135
177
  link_to(link_text, url)
136
178
  end
137
179
  end
180
+
138
181
  end
139
182
  end
140
183
  end
@@ -8,7 +8,6 @@ module Spree
8
8
  next unless @order.send("can_#{event}?")
9
9
  links << button_link_to(Spree.t(event), [event, :admin, @order],
10
10
  method: :put,
11
- icon: event.to_s,
12
11
  data: { confirm: Spree.t(:order_sure_want_to, event: Spree.t(event)) })
13
12
  end
14
13
  safe_join(links, '&nbsp;'.html_safe)
@@ -1,15 +1,11 @@
1
1
  module Spree
2
2
  module Admin
3
3
  module StockLocationsHelper
4
- def display_name(stock_location)
4
+ def admin_stock_location_display_name(stock_location)
5
5
  name_parts = [stock_location.admin_name, stock_location.name]
6
6
  name_parts.delete_if(&:blank?)
7
7
  name_parts.join(' / ')
8
8
  end
9
-
10
- def state(stock_location)
11
- stock_location.active? ? 'active' : 'inactive'
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -17,5 +17,105 @@ module Spree
17
17
  PROMOTION_TABS ||= [:promotions, :promotion_categories]
18
18
  STOCK_TABS ||= [:stock_items, :stock_transfers]
19
19
  USER_TABS ||= [:users, :store_credits]
20
+
21
+ # An item which should be drawn in the admin menu
22
+ class MenuItem
23
+ attr_reader :icon, :label, :partial, :condition, :sections, :url
24
+
25
+ # @param sections [Array<Symbol>] The sections which are contained within
26
+ # this admin menu section.
27
+ # @param icon [String] The icon to draw for this menu item
28
+ # @param condition [Proc] A proc which returns true if this menu item
29
+ # should be drawn. If nil, it will be replaced with a proc which always
30
+ # returns true.
31
+ # @param label [Symbol] The translation key for a label to use for this
32
+ # menu item.
33
+ # @param partial [String] A partial to draw within this menu item for use
34
+ # in declaring a submenu
35
+ # @param url [String] A url where this link should send the user to
36
+ def initialize(
37
+ sections,
38
+ icon,
39
+ condition: nil,
40
+ label: nil,
41
+ partial: nil,
42
+ url: nil
43
+ )
44
+
45
+ @condition = condition || -> { true }
46
+ @sections = sections
47
+ @icon = icon
48
+ @label = label || sections.first
49
+ @partial = partial
50
+ @url = url
51
+ end
52
+ end
53
+
54
+ # Items can be added to the menu by using code like the following:
55
+ #
56
+ # Spree::Backend::Config.configure do |config|
57
+ # config.menu_items << config.class::MenuItem.new(
58
+ # [:section],
59
+ # 'icon-name',
60
+ # url: 'https://solidus.io/'
61
+ # )
62
+ # end
63
+ #
64
+ # @!attribute menu_items
65
+ # @return [Array<Spree::BackendConfiguration::MenuItem>]
66
+ attr_writer :menu_items
67
+
68
+ # Return the menu items which should be drawn in the menu
69
+ #
70
+ # @api public
71
+ # @return [Array<Spree::BackendConfiguration::MenuItem>]
72
+ def menu_items
73
+ @menu_items ||= [
74
+ MenuItem.new(
75
+ ORDER_TABS,
76
+ 'shopping-cart',
77
+ condition: -> { can?(:admin, Spree::Order) },
78
+ ),
79
+ MenuItem.new(
80
+ PRODUCT_TABS,
81
+ 'th-large',
82
+ condition: -> { can?(:admin, Spree::Product) },
83
+ partial: 'spree/admin/shared/product_sub_menu'
84
+ ),
85
+ MenuItem.new(
86
+ REPORT_TABS,
87
+ 'file',
88
+ condition: -> { can?(:admin, :reports) },
89
+ ),
90
+ MenuItem.new(
91
+ CONFIGURATION_TABS,
92
+ 'wrench',
93
+ condition: -> { can?(:admin, :general_settings) },
94
+ label: :settings,
95
+ partial: 'spree/admin/shared/settings_sub_menu',
96
+ url: :edit_admin_general_settings_path
97
+ ),
98
+ MenuItem.new(
99
+ PROMOTION_TABS,
100
+ 'bullhorn',
101
+ condition: -> { can?(:admin, Spree::Promotion) },
102
+ url: :admin_promotions_path
103
+ ),
104
+ MenuItem.new(
105
+ STOCK_TABS,
106
+ 'cubes',
107
+ condition: -> { can?(:admin, Spree::StockItem) },
108
+ label: :stock,
109
+ partial: 'spree/admin/shared/stock_sub_menu',
110
+ url: :admin_stock_items_path
111
+ ),
112
+ MenuItem.new(
113
+ USER_TABS,
114
+ 'user',
115
+ condition: -> { Spree.user_class && can?(:admin, Spree.user_class) },
116
+ url: :admin_users_path
117
+ )
118
+ ]
119
+ end
20
120
  end
21
121
  end