workarea-admin 3.4.45 → 3.5.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +52 -0
  3. data/app/assets/images/workarea/admin/email_logo.png +0 -0
  4. data/app/assets/javascripts/workarea/admin/application.js.erb +11 -1
  5. data/app/assets/javascripts/workarea/admin/config.js.erb +96 -0
  6. data/app/assets/javascripts/workarea/admin/modules/active_by_segment_tooltips.js +108 -0
  7. data/app/assets/javascripts/workarea/admin/modules/calendars.js +1 -1
  8. data/app/assets/javascripts/workarea/admin/modules/categorized_autocomplete_fields.js +1 -1
  9. data/app/assets/javascripts/workarea/admin/modules/impersonation_notification.js +44 -0
  10. data/app/assets/javascripts/workarea/admin/modules/jump_to_menus.js +74 -0
  11. data/app/assets/javascripts/workarea/admin/modules/new_navigation_taxons.js +1 -2
  12. data/app/assets/javascripts/workarea/admin/modules/release_reminder.js +1 -0
  13. data/app/assets/javascripts/workarea/admin/modules/selects.js +33 -0
  14. data/app/assets/javascripts/workarea/admin/modules/style_guide_autocomplete_fields.js +42 -0
  15. data/app/assets/javascripts/workarea/admin/modules/timeline_report_chart.js +105 -0
  16. data/app/assets/javascripts/workarea/admin/modules/toggle_elements.js +27 -0
  17. data/app/assets/javascripts/workarea/admin/modules/tribute_areas.js +91 -0
  18. data/app/assets/javascripts/workarea/admin/templates/chart_legend.jst.ejs +17 -9
  19. data/app/assets/javascripts/workarea/admin/templates/jump_to_menu.jst.ejs +13 -0
  20. data/app/assets/stylesheets/workarea/admin/application.scss.erb +3 -0
  21. data/app/assets/stylesheets/workarea/admin/base/_forms.scss +2 -2
  22. data/app/assets/stylesheets/workarea/admin/components/_activity.scss +24 -16
  23. data/app/assets/stylesheets/workarea/admin/components/_activity_group.scss +3 -19
  24. data/app/assets/stylesheets/workarea/admin/components/_box.scss +21 -5
  25. data/app/assets/stylesheets/workarea/admin/components/_calendar.scss +102 -140
  26. data/app/assets/stylesheets/workarea/admin/components/_chart_legend.scss +10 -13
  27. data/app/assets/stylesheets/workarea/admin/components/_checkbox.scss +49 -23
  28. data/app/assets/stylesheets/workarea/admin/components/_content_block_list.scss +5 -3
  29. data/app/assets/stylesheets/workarea/admin/components/_date_marker.scss +24 -3
  30. data/app/assets/stylesheets/workarea/admin/components/_index_table.scss +5 -0
  31. data/app/assets/stylesheets/workarea/admin/components/_jump_to_menu.scss +57 -0
  32. data/app/assets/stylesheets/workarea/admin/components/_product_summary.scss +46 -0
  33. data/app/assets/stylesheets/workarea/admin/components/_toggle_button.scss +1 -4
  34. data/app/assets/stylesheets/workarea/admin/email/_base.scss +30 -2
  35. data/app/assets/stylesheets/workarea/admin/email/_components.scss +66 -5
  36. data/app/assets/stylesheets/workarea/admin/email/_helpers.scss +16 -5
  37. data/app/assets/stylesheets/workarea/admin/email/{_settings.scss → _settings.scss.erb} +4 -4
  38. data/app/controllers/workarea/admin/application_controller.rb +2 -4
  39. data/app/controllers/workarea/admin/bulk_action_sequential_product_edits_controller.rb +4 -6
  40. data/app/controllers/workarea/admin/bulk_variant_saving.rb +1 -2
  41. data/app/controllers/workarea/admin/catalog_products_controller.rb +4 -6
  42. data/app/controllers/workarea/admin/catalog_variants_controller.rb +2 -3
  43. data/app/controllers/workarea/admin/comments_controller.rb +9 -0
  44. data/app/controllers/workarea/admin/configurations_controller.rb +29 -0
  45. data/app/controllers/workarea/admin/content_assets_controller.rb +3 -1
  46. data/app/controllers/workarea/admin/content_blocks_controller.rb +1 -7
  47. data/app/controllers/workarea/admin/create_catalog_products_controller.rb +2 -8
  48. data/app/controllers/workarea/admin/create_release_undos_controller.rb +43 -0
  49. data/app/controllers/workarea/admin/create_segments_controller.rb +68 -0
  50. data/app/controllers/workarea/admin/dashboards_controller.rb +2 -0
  51. data/app/controllers/workarea/admin/data_file_imports_controller.rb +7 -2
  52. data/app/controllers/workarea/admin/fulfillment_skus_controller.rb +58 -0
  53. data/app/controllers/workarea/admin/fulfillment_tokens_controller.rb +56 -0
  54. data/app/controllers/workarea/admin/guest_browsings_controller.rb +2 -2
  55. data/app/controllers/workarea/admin/impersonations_controller.rb +3 -4
  56. data/app/controllers/workarea/admin/orders_controller.rb +3 -0
  57. data/app/controllers/workarea/admin/pricing_discount_redemptions_controller.rb +13 -0
  58. data/app/controllers/workarea/admin/pricing_overrides_controller.rb +1 -1
  59. data/app/controllers/workarea/admin/product_rules_controller.rb +1 -2
  60. data/app/controllers/workarea/admin/releases_controller.rb +8 -13
  61. data/app/controllers/workarea/admin/reports_controller.rb +18 -0
  62. data/app/controllers/workarea/admin/segment_overrides_controller.rb +19 -0
  63. data/app/controllers/workarea/admin/segment_rules_controller.rb +62 -0
  64. data/app/controllers/workarea/admin/segments_controller.rb +48 -0
  65. data/app/controllers/workarea/admin/tax_rates_controller.rb +62 -1
  66. data/app/controllers/workarea/admin/unsubscribes_controller.rb +40 -0
  67. data/app/controllers/workarea/admin/users_controller.rb +19 -0
  68. data/app/helpers/workarea/admin/application_helper.rb +2 -12
  69. data/app/helpers/workarea/admin/configurations_helper.rb +9 -0
  70. data/app/helpers/workarea/admin/content_helper.rb +2 -3
  71. data/app/helpers/workarea/admin/fulfillment_helper.rb +10 -0
  72. data/app/helpers/workarea/admin/icons_helper.rb +26 -0
  73. data/app/helpers/workarea/admin/navigation_helper.rb +1 -0
  74. data/app/helpers/workarea/admin/pricing_overrides_helper.rb +1 -1
  75. data/app/helpers/workarea/admin/products_helper.rb +13 -0
  76. data/app/helpers/workarea/admin/releases_helper.rb +5 -21
  77. data/app/helpers/workarea/admin/segments_helper.rb +68 -0
  78. data/app/helpers/workarea/admin/settings_helper.rb +11 -3
  79. data/app/mailers/workarea/admin/comment_mailer.rb +3 -3
  80. data/app/mailers/workarea/admin/status_report_mailer.rb +19 -6
  81. data/app/view_models/workarea/admin/bulk_action_product_edit_view_model.rb +5 -0
  82. data/app/view_models/workarea/admin/changeset_view_model.rb +15 -3
  83. data/app/view_models/workarea/admin/code_list_view_model.rb +1 -1
  84. data/app/view_models/workarea/admin/commentable_view_model.rb +4 -0
  85. data/app/view_models/workarea/admin/content_view_model.rb +2 -0
  86. data/app/view_models/workarea/admin/dashboards/marketing_view_model.rb +5 -9
  87. data/app/view_models/workarea/admin/dashboards/reports_view_model.rb +25 -0
  88. data/app/view_models/workarea/admin/discounts/buy_some_get_some_view_model.rb +6 -0
  89. data/app/view_models/workarea/admin/discounts/category_view_model.rb +6 -0
  90. data/app/view_models/workarea/admin/discounts/free_gift_view_model.rb +6 -0
  91. data/app/view_models/workarea/admin/discounts/order_total_view_model.rb +6 -0
  92. data/app/view_models/workarea/admin/discounts/product_attribute_view_model.rb +6 -0
  93. data/app/view_models/workarea/admin/discounts/product_view_model.rb +6 -0
  94. data/app/view_models/workarea/admin/discounts/quantity_fixed_price_view_model.rb +6 -0
  95. data/app/view_models/workarea/admin/discounts/shipping_view_model.rb +6 -0
  96. data/app/view_models/workarea/admin/featured_products_view_model.rb +6 -12
  97. data/app/view_models/workarea/admin/fulfillment_sku_view_model.rb +22 -0
  98. data/app/view_models/workarea/admin/fulfillment_token_view_model.rb +15 -0
  99. data/app/view_models/workarea/admin/fulfillment_view_model.rb +14 -0
  100. data/app/view_models/workarea/admin/insight_view_model.rb +2 -2
  101. data/app/view_models/workarea/admin/insights/product_view_model.rb +2 -2
  102. data/app/view_models/workarea/admin/insights/segment_view_model.rb +25 -0
  103. data/app/view_models/workarea/admin/order_view_model.rb +4 -0
  104. data/app/view_models/workarea/admin/pricing_sku_view_model.rb +0 -51
  105. data/app/view_models/workarea/admin/product_rules_preview_view_model.rb +2 -2
  106. data/app/view_models/workarea/admin/product_view_model.rb +26 -5
  107. data/app/view_models/workarea/admin/recommendations_view_model.rb +3 -11
  108. data/app/view_models/workarea/admin/release_calendar_view_model.rb +4 -9
  109. data/app/view_models/workarea/admin/release_event_view_model.rb +8 -41
  110. data/app/view_models/workarea/admin/release_view_model.rb +10 -17
  111. data/app/view_models/workarea/admin/releases_feed_view_model.rb +5 -13
  112. data/app/view_models/workarea/admin/reports/customers_view_model.rb +4 -2
  113. data/app/view_models/workarea/admin/reports/low_inventory_view_model.rb +2 -5
  114. data/app/view_models/workarea/admin/reports/sales_by_category_view_model.rb +2 -5
  115. data/app/view_models/workarea/admin/reports/sales_by_discount_view_model.rb +2 -5
  116. data/app/view_models/workarea/admin/reports/sales_by_product_view_model.rb +2 -5
  117. data/app/view_models/workarea/admin/reports/sales_by_tender_view_model.rb +13 -0
  118. data/app/view_models/workarea/admin/reports/timeline_view_model.rb +74 -0
  119. data/app/view_models/workarea/admin/search_customization_product_rules_view_model.rb +1 -1
  120. data/app/view_models/workarea/admin/segment_view_model.rb +19 -0
  121. data/app/view_models/workarea/admin/user_view_model.rb +6 -9
  122. data/app/view_models/workarea/admin/variant_view_model.rb +8 -0
  123. data/app/views/layouts/workarea/admin/application.html.haml +1 -1
  124. data/app/views/layouts/workarea/admin/email.html.haml +35 -41
  125. data/app/views/workarea/admin/activities/_configuration_admin_update.html.haml +10 -0
  126. data/app/views/workarea/admin/activities/_fulfillment_sku_create.html.haml +12 -0
  127. data/app/views/workarea/admin/activities/_fulfillment_sku_destroy.html.haml +10 -0
  128. data/app/views/workarea/admin/activities/_fulfillment_sku_update.html.haml +10 -0
  129. data/app/views/workarea/admin/activities/_segment_create.html.haml +12 -0
  130. data/app/views/workarea/admin/activities/_segment_destroy.html.haml +10 -0
  131. data/app/views/workarea/admin/activities/_segment_update.html.haml +10 -0
  132. data/app/views/workarea/admin/activities/show.html.haml +18 -11
  133. data/app/views/workarea/admin/bulk_action_product_edits/edit.html.haml +4 -0
  134. data/app/views/workarea/admin/bulk_action_product_edits/review.html.haml +11 -4
  135. data/app/views/workarea/admin/bulk_action_sequential_product_edits/product.html.haml +1 -1
  136. data/app/views/workarea/admin/catalog_categories/_cards.html.haml +3 -1
  137. data/app/views/workarea/admin/catalog_categories/edit.html.haml +1 -4
  138. data/app/views/workarea/admin/catalog_categories/index.html.haml +1 -0
  139. data/app/views/workarea/admin/catalog_product_images/edit.html.haml +1 -1
  140. data/app/views/workarea/admin/catalog_products/_cards.html.haml +2 -4
  141. data/app/views/workarea/admin/catalog_products/edit.html.haml +2 -1
  142. data/app/views/workarea/admin/catalog_products/index.html.haml +4 -2
  143. data/app/views/workarea/admin/catalog_products/insights.html.haml +2 -0
  144. data/app/views/workarea/admin/catalog_variants/edit.html.haml +6 -1
  145. data/app/views/workarea/admin/catalog_variants/index.html.haml +2 -0
  146. data/app/views/workarea/admin/catalog_variants/new.html.haml +5 -0
  147. data/app/views/workarea/admin/changesets/fields/_active_segment_ids.html.haml +4 -0
  148. data/app/views/workarea/admin/comment_mailer/notify.html.haml +27 -19
  149. data/app/views/workarea/admin/comments/index.html.haml +18 -12
  150. data/app/views/workarea/admin/configurations/_overridden.html.haml +2 -0
  151. data/app/views/workarea/admin/configurations/show.html.haml +49 -0
  152. data/app/views/workarea/admin/configurations/types/_array.html.haml +3 -0
  153. data/app/views/workarea/admin/configurations/types/_boolean.html.haml +1 -0
  154. data/app/views/workarea/admin/configurations/types/_duration.html.haml +2 -0
  155. data/app/views/workarea/admin/configurations/types/_encrypted.html.haml +1 -0
  156. data/app/views/workarea/admin/configurations/types/_float.html.haml +1 -0
  157. data/app/views/workarea/admin/configurations/types/_hash.html.haml +17 -0
  158. data/app/views/workarea/admin/configurations/types/_integer.html.haml +1 -0
  159. data/app/views/workarea/admin/configurations/types/_select.html.haml +1 -0
  160. data/app/views/workarea/admin/configurations/types/_string.html.haml +1 -0
  161. data/app/views/workarea/admin/configurations/types/_symbol.html.haml +1 -0
  162. data/app/views/workarea/admin/content/_edit.html.haml +8 -1
  163. data/app/views/workarea/admin/content/_form.html.haml +13 -7
  164. data/app/views/workarea/admin/content/advanced.html.haml +18 -10
  165. data/app/views/workarea/admin/content_assets/_cards.html.haml +3 -0
  166. data/app/views/workarea/admin/content_assets/_summary.html.haml +1 -1
  167. data/app/views/workarea/admin/content_assets/edit.html.haml +6 -0
  168. data/app/views/workarea/admin/content_assets/index.html.haml +7 -2
  169. data/app/views/workarea/admin/content_assets/new.html.haml +10 -3
  170. data/app/views/workarea/admin/content_blocks/_asset.html.haml +8 -1
  171. data/app/views/workarea/admin/content_pages/_cards.html.haml +1 -0
  172. data/app/views/workarea/admin/content_pages/edit.html.haml +1 -1
  173. data/app/views/workarea/admin/content_pages/index.html.haml +1 -0
  174. data/app/views/workarea/admin/create_catalog_categories/publish.html.haml +1 -0
  175. data/app/views/workarea/admin/create_catalog_products/content.html.haml +1 -1
  176. data/app/views/workarea/admin/create_catalog_products/publish.html.haml +1 -0
  177. data/app/views/workarea/admin/create_content_pages/publish.html.haml +1 -0
  178. data/app/views/workarea/admin/create_pricing_discounts/publish.html.haml +1 -0
  179. data/app/views/workarea/admin/create_release_undos/new.html.haml +45 -0
  180. data/app/views/workarea/admin/create_release_undos/review.html.haml +51 -0
  181. data/app/views/workarea/admin/create_releases/plan.html.haml +4 -3
  182. data/app/views/workarea/admin/create_releases/setup.html.haml +8 -12
  183. data/app/views/workarea/admin/create_segments/rules.html.haml +55 -0
  184. data/app/views/workarea/admin/create_segments/setup.html.haml +42 -0
  185. data/app/views/workarea/admin/create_users/admin.html.haml +0 -2
  186. data/app/views/workarea/admin/dashboards/catalog.html.haml +1 -0
  187. data/app/views/workarea/admin/dashboards/people.html.haml +1 -1
  188. data/app/views/workarea/admin/dashboards/reports.html.haml +31 -0
  189. data/app/views/workarea/admin/dashboards/settings.html.haml +23 -3
  190. data/app/views/workarea/admin/data_file_imports/new.html.haml +4 -2
  191. data/app/views/workarea/admin/data_file_mailer/export.html.haml +2 -0
  192. data/app/views/workarea/admin/data_file_mailer/import.html.haml +2 -0
  193. data/app/views/workarea/admin/data_file_mailer/import_failure.html.haml +2 -0
  194. data/app/views/workarea/admin/facets/_applied.html.haml +1 -1
  195. data/app/views/workarea/admin/featured_products/_selected.html.haml +3 -2
  196. data/app/views/workarea/admin/featured_products/_unselected.html.haml +3 -1
  197. data/app/views/workarea/admin/featured_products/edit.html.haml +3 -3
  198. data/app/views/workarea/admin/featured_products/select.html.haml +0 -1
  199. data/app/views/workarea/admin/fulfillment_skus/_aux_navigation.html.haml +3 -0
  200. data/app/views/workarea/admin/fulfillment_skus/_cards.html.haml +57 -0
  201. data/app/views/workarea/admin/fulfillment_skus/_summary.html.haml +6 -0
  202. data/app/views/workarea/admin/fulfillment_skus/edit.html.haml +53 -0
  203. data/app/views/workarea/admin/fulfillment_skus/index.html.haml +75 -0
  204. data/app/views/workarea/admin/fulfillment_skus/new.html.haml +41 -0
  205. data/app/views/workarea/admin/fulfillment_skus/show.html.haml +17 -0
  206. data/app/views/workarea/admin/fulfillment_tokens/index.html.haml +73 -0
  207. data/app/views/workarea/admin/fulfillments/show.html.haml +41 -6
  208. data/app/views/workarea/admin/insights/_most_discounted_products.html.haml +4 -4
  209. data/app/views/workarea/admin/inventory_skus/show.html.haml +1 -1
  210. data/app/views/workarea/admin/navigation_menus/_summary.html.haml +1 -1
  211. data/app/views/workarea/admin/navigation_menus/edit.html.haml +1 -1
  212. data/app/views/workarea/admin/navigation_menus/index.html.haml +3 -1
  213. data/app/views/workarea/admin/navigation_redirects/index.html.haml +0 -5
  214. data/app/views/workarea/admin/navigation_taxons/index.html.haml +20 -4
  215. data/app/views/workarea/admin/orders/_cards.html.haml +23 -5
  216. data/app/views/workarea/admin/orders/attributes.html.haml +4 -1
  217. data/app/views/workarea/admin/orders/fraud.html.haml +43 -0
  218. data/app/views/workarea/admin/orders/index.html.haml +1 -0
  219. data/app/views/workarea/admin/orders/timeline.html.haml +1 -1
  220. data/app/views/workarea/admin/pricing_discount_code_lists/_cards.html.haml +1 -1
  221. data/app/views/workarea/admin/pricing_discount_code_lists/promo_codes.html.haml +1 -1
  222. data/app/views/workarea/admin/pricing_discount_redemptions/index.html.haml +44 -0
  223. data/app/views/workarea/admin/pricing_discounts/_cards.html.haml +22 -0
  224. data/app/views/workarea/admin/pricing_discounts/conditions/_segments.html.haml +5 -0
  225. data/app/views/workarea/admin/pricing_discounts/edit.html.haml +5 -15
  226. data/app/views/workarea/admin/pricing_discounts/index.html.haml +1 -0
  227. data/app/views/workarea/admin/pricing_discounts/properties/_buy_some_get_some.html.haml +1 -0
  228. data/app/views/workarea/admin/pricing_discounts/properties/_category.html.haml +1 -0
  229. data/app/views/workarea/admin/pricing_discounts/properties/_free_gift.html.haml +1 -0
  230. data/app/views/workarea/admin/pricing_discounts/properties/_order_total.html.haml +1 -0
  231. data/app/views/workarea/admin/pricing_discounts/properties/_product.html.haml +1 -0
  232. data/app/views/workarea/admin/pricing_discounts/properties/_product_attribute.html.haml +2 -1
  233. data/app/views/workarea/admin/pricing_discounts/properties/_quantity_fixed_price.html.haml +1 -0
  234. data/app/views/workarea/admin/pricing_discounts/properties/_shipping.html.haml +1 -0
  235. data/app/views/workarea/admin/pricing_skus/_cards.html.haml +7 -7
  236. data/app/views/workarea/admin/pricing_skus/edit.html.haml +5 -5
  237. data/app/views/workarea/admin/pricing_skus/index.html.haml +4 -4
  238. data/app/views/workarea/admin/pricing_skus/new.html.haml +6 -9
  239. data/app/views/workarea/admin/product_rules/_card.html.haml +2 -2
  240. data/app/views/workarea/admin/product_rules/_form.html.haml +1 -0
  241. data/app/views/workarea/admin/product_rules/index.html.haml +2 -0
  242. data/app/views/workarea/admin/releases/_cards.html.haml +50 -12
  243. data/app/views/workarea/admin/releases/_publish.html.haml +1 -1
  244. data/app/views/workarea/admin/releases/edit.html.haml +33 -46
  245. data/app/views/workarea/admin/releases/index.html.haml +81 -90
  246. data/app/views/workarea/admin/releases/list.html.haml +107 -0
  247. data/app/views/workarea/admin/releases/original.html.haml +50 -0
  248. data/app/views/workarea/admin/releases/show.html.haml +3 -17
  249. data/app/views/workarea/admin/releases/undo.html.haml +64 -0
  250. data/app/views/workarea/admin/reports/average_order_value.html.haml +1 -1
  251. data/app/views/workarea/admin/reports/customers.html.haml +4 -0
  252. data/app/views/workarea/admin/reports/first_time_vs_returning_sales.html.haml +1 -1
  253. data/app/views/workarea/admin/reports/reference.html.haml +19 -60
  254. data/app/views/workarea/admin/reports/sales_by_country.html.haml +6 -0
  255. data/app/views/workarea/admin/reports/sales_by_product.html.haml +6 -0
  256. data/app/views/workarea/admin/reports/sales_by_sku.html.haml +6 -0
  257. data/app/views/workarea/admin/reports/sales_by_tender.html.haml +30 -0
  258. data/app/views/workarea/admin/reports/sales_over_time.html.haml +5 -1
  259. data/app/views/workarea/admin/reports/timeline.html.haml +20 -0
  260. data/app/views/workarea/admin/search_customizations/_cards.html.haml +1 -0
  261. data/app/views/workarea/admin/search_customizations/edit.html.haml +1 -1
  262. data/app/views/workarea/admin/search_customizations/index.html.haml +1 -0
  263. data/app/views/workarea/admin/searches/show.html.haml +6 -5
  264. data/app/views/workarea/admin/segment_overrides/show.html.haml +29 -0
  265. data/app/views/workarea/admin/segment_rules/_form.html.haml +13 -0
  266. data/app/views/workarea/admin/segment_rules/fields/_browser_info.html.haml +13 -0
  267. data/app/views/workarea/admin/segment_rules/fields/_geolocation.html.haml +4 -0
  268. data/app/views/workarea/admin/segment_rules/fields/_last_order.html.haml +3 -0
  269. data/app/views/workarea/admin/segment_rules/fields/_logged_in.html.haml +2 -0
  270. data/app/views/workarea/admin/segment_rules/fields/_orders.html.haml +5 -0
  271. data/app/views/workarea/admin/segment_rules/fields/_revenue.html.haml +9 -0
  272. data/app/views/workarea/admin/segment_rules/fields/_sessions.html.haml +5 -0
  273. data/app/views/workarea/admin/segment_rules/fields/_tags.html.haml +4 -0
  274. data/app/views/workarea/admin/segment_rules/fields/_traffic_referrer.html.haml +13 -0
  275. data/app/views/workarea/admin/segment_rules/geolocation_options.json.jbuilder +4 -0
  276. data/app/views/workarea/admin/segment_rules/index.html.haml +25 -0
  277. data/app/views/workarea/admin/segment_rules/summaries/_browser_info.html.haml +11 -0
  278. data/app/views/workarea/admin/segment_rules/summaries/_geolocation.html.haml +2 -0
  279. data/app/views/workarea/admin/segment_rules/summaries/_last_order.html.haml +2 -0
  280. data/app/views/workarea/admin/segment_rules/summaries/_logged_in.html.haml +5 -0
  281. data/app/views/workarea/admin/segment_rules/summaries/_orders.html.haml +6 -0
  282. data/app/views/workarea/admin/segment_rules/summaries/_revenue.html.haml +7 -0
  283. data/app/views/workarea/admin/segment_rules/summaries/_sessions.html.haml +6 -0
  284. data/app/views/workarea/admin/segment_rules/summaries/_tags.html.haml +2 -0
  285. data/app/views/workarea/admin/segment_rules/summaries/_traffic_referrer.html.haml +10 -0
  286. data/app/views/workarea/admin/segments/_cards.html.haml +81 -0
  287. data/app/views/workarea/admin/segments/_publish.html.haml +10 -0
  288. data/app/views/workarea/admin/segments/edit.html.haml +41 -0
  289. data/app/views/workarea/admin/segments/index.html.haml +64 -0
  290. data/app/views/workarea/admin/segments/insights.html.haml +52 -0
  291. data/app/views/workarea/admin/segments/show.html.haml +20 -0
  292. data/app/views/workarea/admin/shared/_active_field.html.haml +17 -0
  293. data/app/views/workarea/admin/shared/_bulk_actions.html.haml +10 -8
  294. data/app/views/workarea/admin/shared/_primary_nav.html.haml +5 -2
  295. data/app/views/workarea/admin/shared/_toggle_button.html.haml +1 -1
  296. data/app/views/workarea/admin/shipping_services/edit.html.haml +0 -4
  297. data/app/views/workarea/admin/shipping_services/new.html.haml +0 -4
  298. data/app/views/workarea/admin/status_report_mailer/report.html.haml +83 -86
  299. data/app/views/workarea/admin/style_guides/components/_activity.html.haml +3 -5
  300. data/app/views/workarea/admin/style_guides/components/_activity_group.html.haml +9 -15
  301. data/app/views/workarea/admin/style_guides/components/_box.html.haml +12 -7
  302. data/app/views/workarea/admin/style_guides/components/_checkbox.html.haml +21 -2
  303. data/app/views/workarea/admin/style_guides/components/_release_changeset.html.haml +3 -5
  304. data/app/views/workarea/admin/tax_rates/edit.html.haml +64 -0
  305. data/app/views/workarea/admin/tax_rates/index.html.haml +59 -20
  306. data/app/views/workarea/admin/tax_rates/new.html.haml +62 -0
  307. data/app/views/workarea/admin/timeline/show.html.haml +34 -41
  308. data/app/views/workarea/admin/toolbar/show.html.haml +11 -1
  309. data/app/views/workarea/admin/trash/index.html.haml +1 -1
  310. data/app/views/workarea/admin/users/edit.html.haml +60 -57
  311. data/app/views/workarea/admin/users/index.html.haml +1 -3
  312. data/app/views/workarea/admin/users/index.json.jbuilder +8 -0
  313. data/app/views/workarea/admin/users/insights.html.haml +31 -23
  314. data/app/views/workarea/admin/users/permissions.html.haml +10 -1
  315. data/app/views/workarea/admin/users/show.html.haml +7 -0
  316. data/config/locales/en.yml +569 -124
  317. data/config/routes.rb +57 -5
  318. data/lib/workarea/mailer_previews/admin/status_report_mailer_preview.rb +3 -1
  319. data/public/workarea/import_samples/tax_rates.csv +3 -3
  320. data/test/dummy/config/initializers/session_store.rb +1 -1
  321. data/test/helpers/workarea/admin/application_helper_test.rb +0 -16
  322. data/test/helpers/workarea/admin/icons_helper_test.rb +9 -0
  323. data/test/helpers/workarea/admin/products_helper_test.rb +73 -0
  324. data/test/helpers/workarea/admin/releases_helper_test.rb +0 -49
  325. data/test/helpers/workarea/admin/settings_helper_test.rb +22 -1
  326. data/test/integration/workarea/admin/assets_integration_test.rb +2 -5
  327. data/test/integration/workarea/admin/comments_integration_test.rb +27 -7
  328. data/test/integration/workarea/admin/configurations_integration_test.rb +21 -0
  329. data/test/integration/workarea/admin/create_release_undos_integration_test.rb +29 -0
  330. data/test/integration/workarea/admin/create_segments_integration_test.rb +26 -0
  331. data/test/integration/workarea/admin/data_file_imports_integration_test.rb +34 -8
  332. data/test/integration/workarea/admin/fulfillment_skus_integration_test.rb +55 -0
  333. data/test/integration/workarea/admin/fulfillment_tokens_integration_test.rb +43 -0
  334. data/test/integration/workarea/admin/guest_browsings_integration_test.rb +8 -32
  335. data/test/integration/workarea/admin/impersonations_integration_test.rb +13 -57
  336. data/test/integration/workarea/admin/jump_to_integration_test.rb +0 -29
  337. data/test/integration/workarea/admin/pricing_overrides_integration_test.rb +11 -0
  338. data/test/integration/workarea/admin/products_integration_test.rb +0 -13
  339. data/test/integration/workarea/admin/releases_integration_test.rb +71 -87
  340. data/test/integration/workarea/admin/segment_overrides_integration_test.rb +28 -0
  341. data/test/integration/workarea/admin/segment_rules_integration_test.rb +49 -0
  342. data/test/integration/workarea/admin/segments_integration_test.rb +31 -0
  343. data/test/integration/workarea/admin/shipping_service_integration_test.rb +1 -3
  344. data/test/integration/workarea/admin/tax_categories_integration_test.rb +1 -1
  345. data/test/integration/workarea/admin/unsubscribes_integration_test.rb +32 -0
  346. data/test/integration/workarea/admin/users_integration_test.rb +32 -0
  347. data/test/javascripts/fixtures/release_reminder.html.haml +3 -3
  348. data/test/javascripts/new_navigation_taxons_spec.js +1 -12
  349. data/test/mailers/workarea/admin/comment_mailer_test.rb +35 -0
  350. data/test/mailers/workarea/admin/status_report_mailer_test.rb +30 -25
  351. data/test/system/workarea/admin/alerts_system_test.rb +2 -1
  352. data/test/system/workarea/admin/bulk_actions_system_test.rb +1 -1
  353. data/test/system/workarea/admin/comments_system_test.rb +43 -0
  354. data/test/system/workarea/admin/content_system_test.rb +6 -0
  355. data/test/system/workarea/admin/dashboard_system_test.rb +8 -9
  356. data/test/system/workarea/admin/data_files_system_test.rb +1 -1
  357. data/test/system/workarea/admin/discounts_system_test.rb +18 -0
  358. data/test/system/workarea/admin/featured_products_system_test.rb +3 -0
  359. data/test/system/workarea/admin/fulfillment_skus_system_test.rb +48 -0
  360. data/test/system/workarea/admin/impersonation_system_test.rb +5 -2
  361. data/test/system/workarea/admin/orders_system_test.rb +32 -21
  362. data/test/system/workarea/admin/payment_transactions_system_test.rb +34 -32
  363. data/test/system/workarea/admin/releases_system_test.rb +151 -37
  364. data/test/system/workarea/admin/reports_system_test.rb +29 -0
  365. data/test/system/workarea/admin/segments_system_test.rb +124 -0
  366. data/test/system/workarea/admin/tax_categories_system_test.rb +166 -16
  367. data/test/system/workarea/admin/users_system_test.rb +15 -0
  368. data/test/view_models/workarea/admin/changeset_view_model_test.rb +59 -9
  369. data/test/view_models/workarea/admin/code_list_view_model_test.rb +0 -5
  370. data/test/view_models/workarea/admin/content_view_model_test.rb +13 -11
  371. data/test/view_models/workarea/admin/insights/product_view_model_test.rb +4 -4
  372. data/test/view_models/workarea/admin/insights/segment_view_model_test.rb +73 -0
  373. data/test/view_models/workarea/admin/product_rules_preview_view_model_test.rb +37 -0
  374. data/test/view_models/workarea/admin/product_view_model_test.rb +13 -19
  375. data/test/view_models/workarea/admin/release_calendar_view_model_test.rb +16 -0
  376. data/test/view_models/workarea/admin/release_view_model_test.rb +13 -56
  377. data/test/view_models/workarea/admin/releases_feed_view_model_test.rb +8 -21
  378. data/test/view_models/workarea/admin/reports/timeline_view_model_test.rb +76 -0
  379. data/test/view_models/workarea/admin/search_analysis_view_model_test.rb +14 -16
  380. data/test/view_models/workarea/admin/timeline_view_model_test.rb +1 -1
  381. metadata +128 -17
  382. data/app/views/workarea/admin/featured_products/_release_preview_warning.html.haml +0 -4
  383. data/app/views/workarea/admin/releases/calendar.html.haml +0 -54
  384. data/test/dummy/tmp/screenshots/.keep +0 -0
  385. data/test/helpers/workarea/admin/content_helper_test.rb +0 -17
  386. data/test/integration/workarea/admin/index_tracking_integration_test.rb +0 -21
  387. data/test/javascripts/fixtures/existing_navigation_taxon.html.haml +0 -10
  388. data/test/view_models/workarea/admin/pricing_sku_view_model_test.rb +0 -84
@@ -14,8 +14,8 @@ module Workarea
14
14
 
15
15
  releases.each do |release|
16
16
  calendar.event do |event|
17
- event.dtstart = format_date(release.starts_at, release.all_day_event?)
18
- event.dtend = format_date(release.ends_at, release.all_day_event?)
17
+ event.dtstart = format_date(release.starts_at)
18
+ event.dtend = format_date(release.ends_at)
19
19
  event.summary = release.name
20
20
  event.description = release.description
21
21
  end
@@ -37,21 +37,13 @@ module Workarea
37
37
 
38
38
  def releases
39
39
  @releases ||= Admin::ReleaseEventViewModel.wrap(
40
- (
41
- Release.published_within(Time.current, 1.year.from_now) +
42
- Release.undone_within(Time.current, 1.year.from_now)
43
- ).uniq
40
+ Release.published_within(Time.current, 1.year.from_now)
44
41
  )
45
42
  end
46
43
 
47
- def format_date(time, date_only = false)
44
+ def format_date(time)
48
45
  return unless time.present?
49
-
50
- if date_only
51
- Icalendar::Values::Date.new(time.to_date, tzid: timezone_id)
52
- else
53
- Icalendar::Values::DateTime.new(time, tzid: timezone_id)
54
- end
46
+ Icalendar::Values::DateTime.new(time, tzid: timezone_id)
55
47
  end
56
48
  end
57
49
  end
@@ -4,13 +4,15 @@ module Workarea
4
4
  class CustomersViewModel < ApplicationViewModel
5
5
  def results
6
6
  @results ||= model.results.map do |result|
7
- user = users.detect { |p| p.email == result['_id'] }
7
+ user = users[result['_id']]
8
8
  OpenStruct.new({ user: user }.merge(result))
9
9
  end
10
10
  end
11
11
 
12
12
  def users
13
- @users ||= User.any_in(email: model.results.map { |r| r['_id'] }).to_a
13
+ @users ||= User
14
+ .any_in(email: model.results.map { |r| r['_id'] })
15
+ .each_with_object({}) { |u, r| r[u.email] = u }
14
16
  end
15
17
  end
16
18
  end
@@ -4,15 +4,12 @@ module Workarea
4
4
  class LowInventoryViewModel < ApplicationViewModel
5
5
  def results
6
6
  @results ||= model.results.map do |result|
7
- sku = skus.detect { |s| s.id.to_s == result['_id'] }
8
- OpenStruct.new({ sku: sku }.merge(result))
7
+ OpenStruct.new({ sku: skus[result['_id']] }.merge(result))
9
8
  end
10
9
  end
11
10
 
12
11
  def skus
13
- @skus ||= Inventory::Sku.any_in(
14
- id: model.results.map { |r| r['_id'] }
15
- ).to_a
12
+ @skus ||= Inventory::Sku.any_in(id: model.results.map { |r| r['_id'] }).to_lookup_hash
16
13
  end
17
14
  end
18
15
  end
@@ -4,15 +4,12 @@ module Workarea
4
4
  class SalesByCategoryViewModel < ApplicationViewModel
5
5
  def results
6
6
  @results ||= model.results.map do |result|
7
- category = categories.detect { |c| c.id.to_s == result['_id'] }
8
- OpenStruct.new({ category: category }.merge(result))
7
+ OpenStruct.new({ category: categories[result['_id']] }.merge(result))
9
8
  end
10
9
  end
11
10
 
12
11
  def categories
13
- @categories ||= Catalog::Category.any_in(
14
- id: model.results.map { |r| r['_id'] }
15
- ).to_a
12
+ @categories ||= Catalog::Category.any_in(id: model.results.map { |r| r['_id'] }).to_lookup_hash
16
13
  end
17
14
  end
18
15
  end
@@ -4,15 +4,12 @@ module Workarea
4
4
  class SalesByDiscountViewModel < ApplicationViewModel
5
5
  def results
6
6
  @results ||= model.results.map do |result|
7
- discount = discounts.detect { |p| p.id.to_s == result['_id'] }
8
- OpenStruct.new({ discount: discount }.merge(result))
7
+ OpenStruct.new({ discount: discounts[result['_id']] }.merge(result))
9
8
  end
10
9
  end
11
10
 
12
11
  def discounts
13
- @discounts ||= Pricing::Discount.any_in(
14
- id: model.results.map { |r| r['_id'] }
15
- ).to_a
12
+ @discounts ||= Pricing::Discount.any_in(id: model.results.map { |r| r['_id'] }).to_lookup_hash
16
13
  end
17
14
  end
18
15
  end
@@ -4,15 +4,12 @@ module Workarea
4
4
  class SalesByProductViewModel < ApplicationViewModel
5
5
  def results
6
6
  @results ||= model.results.map do |result|
7
- product = products.detect { |p| p.id == result['_id'] }
8
- OpenStruct.new({ product: product }.merge(result))
7
+ OpenStruct.new({ product: products[result['_id']] }.merge(result))
9
8
  end
10
9
  end
11
10
 
12
11
  def products
13
- @products ||= Catalog::Product.any_in(
14
- id: model.results.map { |r| r['_id'] }
15
- ).to_a
12
+ @products ||= Catalog::Product.any_in(id: model.results.map { |r| r['_id'] }).to_lookup_hash
16
13
  end
17
14
  end
18
15
  end
@@ -0,0 +1,13 @@
1
+ module Workarea
2
+ module Admin
3
+ module Reports
4
+ class SalesByTenderViewModel < ApplicationViewModel
5
+ def results
6
+ @results ||= model.results.map do |result|
7
+ OpenStruct.new(result.merge(name: result['_id'].titleize))
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,74 @@
1
+ module Workarea
2
+ module Admin
3
+ module Reports
4
+ class TimelineViewModel < ApplicationViewModel
5
+ include GroupByTime
6
+
7
+ def summary
8
+ {
9
+ revenue: summarize(data_for('revenue')),
10
+ orders: summarize(data_for('orders')),
11
+ units_sold: summarize(data_for('units_sold')),
12
+ customers: summarize(data_for('customers')),
13
+ releases: summarize(release_data)
14
+ }
15
+ end
16
+
17
+ def graph_data
18
+ {
19
+ labels: grouped_data.keys.reverse,
20
+ datasets: {
21
+ revenue: transform(data_for('revenue')),
22
+ orders: transform(data_for('orders')),
23
+ units_sold: transform(data_for('units_sold')),
24
+ customers: transform(data_for('customers')),
25
+ releases: transform(release_data)
26
+ }
27
+ }
28
+ end
29
+
30
+ def releases
31
+ @releases ||= Release.published_between(
32
+ starts_at: starts_at,
33
+ ends_at: ends_at
34
+ ).to_a
35
+ end
36
+
37
+ private
38
+
39
+ def date_range
40
+ starts_at.to_date..ends_at.to_date
41
+ end
42
+
43
+ def grouped_data
44
+ date_range.each_with_object({}) do |date, group|
45
+ group[date] = results.select { |r| r.starts_at.to_date == date }
46
+ end
47
+ end
48
+
49
+ def data_for(type)
50
+ grouped_data.transform_values do |values|
51
+ (values || []).map { |v| v[type] }
52
+ end
53
+ end
54
+
55
+ def release_data
56
+ date_range.each_with_object({}) do |date, group|
57
+ data = releases.select { |r| r.published_at.to_date == date }
58
+ group[date] = [data.count]
59
+ end
60
+ end
61
+
62
+ def transform(data)
63
+ data.map { |k, v| Hash[x: k.to_time, y: v.first] }.reverse
64
+ end
65
+
66
+ def summarize(data)
67
+ data
68
+ .select { |_, v| ! v.empty? }
69
+ .reduce(0) { |sum, (_k, v)| sum + v.first }
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -11,7 +11,7 @@ module Workarea
11
11
  def search
12
12
  @search ||= Search::ProductSearch.new(
13
13
  q: model.query,
14
- rules: model.product_rules.select(&:valid?),
14
+ rules: model.product_rules.usable,
15
15
  page: options[:page] || 1,
16
16
  show_all: show_all?
17
17
  ).tap { |s| s.extend(Search::AdminProductRulesPreview) }
@@ -0,0 +1,19 @@
1
+ module Workarea
2
+ module Admin
3
+ class SegmentViewModel < ApplicationViewModel
4
+ include CommentableViewModel
5
+
6
+ def timeline
7
+ @timeline ||= TimelineViewModel.new(model)
8
+ end
9
+
10
+ def life_cycle?
11
+ model.is_a?(Segment::LifeCycle)
12
+ end
13
+
14
+ def insights
15
+ @insights ||= Insights::SegmentViewModel.wrap(model, options)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -60,24 +60,21 @@ module Workarea
60
60
  @orders ||= OrderViewModel.wrap(Order.recent(model.id, 50))
61
61
  end
62
62
 
63
- def insights
64
- @insights ||= Metrics::User.find_or_initialize_by(id: model.email)
65
- end
66
-
67
- def activity
68
- @activity ||= Recommendation::UserActivity.find_or_initialize_by(id: model.id)
63
+ def metrics
64
+ @metrics ||= Metrics::User.find_or_initialize_by(id: model.email)
69
65
  end
66
+ alias_method :insights, :metrics # To ease upgrades, TODO remove in v3.6
70
67
 
71
68
  def recent_products
72
- @recent_products ||= Catalog::Product.any_in(id: activity.product_ids)
69
+ @recent_products ||= Catalog::Product.find_ordered(metrics.viewed.recent_product_ids)
73
70
  end
74
71
 
75
72
  def recent_categories
76
- @recent_categories ||= Catalog::Category.any_in(id: activity.category_ids)
73
+ @recent_categories ||= Catalog::Category.find_ordered(metrics.viewed.recent_category_ids)
77
74
  end
78
75
 
79
76
  def recent_searches
80
- activity.searches
77
+ @recent_searches ||= metrics.viewed.recent_search_ids
81
78
  end
82
79
 
83
80
  def email_signup?
@@ -15,6 +15,14 @@ module Workarea
15
15
  inventory.available
16
16
  end
17
17
 
18
+ def fulfillment
19
+ @fulfillment ||= Fulfillment::Sku.find_or_create_by(id: sku)
20
+ end
21
+
22
+ def fulfillment_policy
23
+ fulfillment.policy.titleize
24
+ end
25
+
18
26
  def detail_1_name
19
27
  details_array.first.try(:first)
20
28
  end
@@ -143,7 +143,7 @@
143
143
  %strong
144
144
  = link_to current_impersonation.email, user_path(current_impersonation)
145
145
  %br
146
- = form_tag impersonations_path, method: 'delete', data: { disable_delete_confirmation: '' } do
146
+ = form_tag impersonations_path, method: 'delete', data: { disable_delete_confirmation: '', impersonation_notification: current_impersonation.name } do
147
147
  = button_tag t('workarea.admin.toolbar.stop_impersonation'), class: 'text-button text-button--destroy'
148
148
  - else
149
149
  .header__action
@@ -14,7 +14,6 @@
14
14
  -# The title tag shows in email notifications, like Android 4.4.
15
15
  %title= t('workarea.admin.layout.mailer.title', host: @host)
16
16
 
17
-
18
17
  -# BEGIN: web font / @font-face
19
18
  -# You're able to load the webfont from your build here, if you so desire.
20
19
  -# This is commented out, by default, since it's something you'll have to
@@ -24,19 +23,7 @@
24
23
  -# Roman, so we force a safe fallback font.
25
24
  /[if mso]
26
25
  :css
27
- * { font-family: 'Helvetica, Arial, sans-serif'; }
28
-
29
- -# All other clients get the webfont reference; some will render the font
30
- -# and others will silently fail to the fallbacks. More on that here:
31
- -# http://stylecampaign.com/blog/2015/02/webfont-support-in-email/
32
- /[if !mso]
33
- :css
34
- -# You should replace the following with relevant sections from
35
- -# `app/assets/stylesheets/workarea/admin/generic/_fonts.scss`
36
- @font-face {
37
- font-family: 'Font';
38
- src: url('#{font_url('workarea/admin/font.woff2')}') format('woff2')
39
- }
26
+ * { font-family: Helvetica, Arial, sans-serif; }
40
27
  -# END: web font / @font-face
41
28
 
42
29
 
@@ -73,26 +60,27 @@
73
60
  mso-table-rspace: 0pt !important;
74
61
  }
75
62
 
76
- /* Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */
63
+ /* Fixes webkit padding issue. */
77
64
  table {
78
65
  border-spacing: 0 !important;
79
66
  border-collapse: collapse !important;
80
67
  table-layout: fixed !important;
81
68
  margin: 0 auto !important;
82
69
  }
83
- table table table {
84
- table-layout: auto;
85
- }
86
70
 
87
71
  /* Uses a better rendering method when resizing images in IE. */
88
72
  img {
89
73
  -ms-interpolation-mode:bicubic;
90
74
  }
91
75
 
76
+ /* What it does: Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline. */
77
+ a {
78
+ text-decoration: none;
79
+ }
80
+
92
81
  /* A work-around for email clients meddling in triggered links. */
93
- *[x-apple-data-detectors], /* iOS */
94
- .x-gmail-data-detectors, /* Gmail */
95
- .x-gmail-data-detectors *,
82
+ a[x-apple-data-detectors], /* iOS */
83
+ .unstyle-auto-detected-links a,
96
84
  .aBn {
97
85
  border-bottom: 0 !important;
98
86
  cursor: default !important;
@@ -104,7 +92,12 @@
104
92
  line-height: inherit !important;
105
93
  }
106
94
 
107
- /* Prevents Gmail from displaying an download button on large, non-linked images. */
95
+ /* What it does: Prevents Gmail from changing the text color in conversation threads. */
96
+ .im {
97
+ color: inherit !important;
98
+ }
99
+
100
+ /* Prevents Gmail from displaying a download button on large, non-linked images. */
108
101
  .a6S {
109
102
  display: none !important;
110
103
  opacity: 0.01 !important;
@@ -114,37 +107,27 @@
114
107
  display: none !important;
115
108
  }
116
109
 
117
- /* Prevents underlining the button text in Windows 10 */
118
- .button-link {
119
- text-decoration: none !important;
120
- }
121
-
122
110
  /* Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
123
111
  /* Create one of these media queries for each additional viewport size you'd like to fix */
124
112
 
125
113
  /* iPhone 4, 4S, 5, 5S, 5C, and 5SE */
126
114
  @media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
127
- .email-container {
115
+ u ~ div .email-container {
128
116
  min-width: 320px !important;
129
117
  }
130
118
  }
131
119
  /* iPhone 6, 6S, 7, 8, and X */
132
120
  @media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
133
- .email-container {
121
+ u ~ div .email-container {
134
122
  min-width: 375px !important;
135
123
  }
136
124
  }
137
125
  /* iPhone 6+, 7+, and 8+ */
138
126
  @media only screen and (min-device-width: 414px) {
139
- .email-container {
127
+ u ~ div .email-container {
140
128
  min-width: 414px !important;
141
129
  }
142
130
  }
143
- -# END: CSS Reset
144
-
145
- -# The rest of the styles are loaded from the email manifest and will be
146
- -# applied to each element via premailer.
147
- = stylesheet_link_tag 'workarea/admin/email'
148
131
 
149
132
  -# Makes background images in 72ppi Outlook render at correct size.
150
133
  /[if gte mso 9]
@@ -155,11 +138,16 @@
155
138
  <o:PixelsPerInch>96</o:PixelsPerInch>
156
139
  </o:OfficeDocumentSettings>
157
140
  </xml>
141
+ -# END: CSS Reset
142
+
143
+ -# The rest of the styles are loaded from the email manifest and will be
144
+ -# applied to each element via premailer.
145
+ = stylesheet_link_tag 'workarea/admin/email'
158
146
 
159
147
  %body{ style: 'mso-line-height-rule: exactly;', width: '100%' }
160
148
  %center
161
149
  /[if mso | IE]
162
- <table role="presentation" width="100%"><tr><td>
150
+ <table class='mso-wrapper' role="presentation" width="100%" align="center"><tr><td>
163
151
 
164
152
  -# Preheader Text
165
153
  -# A preheader (otherwise known as a ‘Johnson Box’) is the short summary
@@ -167,19 +155,25 @@
167
155
  - if content_for?(:preheader_text)
168
156
  .preheader-text= yield :preheader_text
169
157
 
170
- %table.email-container{ role: 'presentation', width: 600 }
158
+ -# Preview Text Spacing Hack
159
+ -# Create white space after the desired preview text so email clients
160
+ -# don’t pull other distracting text into the inbox preview. Extend as
161
+ -# necessary.
162
+ .hidden!= '&zwnj;&nbsp;' * 18
163
+
164
+ %table.email-container{ role: 'presentation', width: Workarea.config.admin_email_width }
171
165
  %tr
172
166
  %td.email-header
173
167
  = link_to "http://#{Workarea.config.host}/", class: 'logo' do
174
- = image_tag url_to_image('workarea/admin/logo.svg'), alt: t('workarea.admin.layout.mailer.homepage_link'), class: 'logo__image', border: 0, size: '227x50'
168
+ = image_tag url_to_image('workarea/admin/email_logo.png'), alt: t('workarea.admin.layout.mailer.homepage_link'), class: 'logo__image', border: 0, width: 220
175
169
 
176
- %table.email-container.email-container--main{ role: 'presentation', width: 600 }
170
+ %table.email-container.email-container--main{ role: 'presentation', width: Workarea.config.admin_email_width }
177
171
  = yield
178
172
 
179
- %table.email-container{ role: 'presentation', width: 600 }
173
+ %table.email-container{ role: 'presentation', width: Workarea.config.admin_email_width }
180
174
  %tr
181
175
  %td.email-footer
182
- = Workarea.config.site_name
176
+ Workarea<br>22 S 3rd St, Philadelphia, PA 19106
183
177
 
184
178
  /[if mso | IE]
185
179
  </td></tr></table>
@@ -0,0 +1,10 @@
1
+ .activity
2
+ .activity__header
3
+ .activity__avatar
4
+ = link_to_modifier(entry) do
5
+ = avatar_for entry.modifier
6
+ %h3.activity__name= link_to_modifier(entry)
7
+ %p.activity__time= activity_time(entry.created_at)
8
+ .activity__message
9
+ - name = link_to(t('workarea.admin.activities.configuration_admin'), configuration_path)
10
+ = t('workarea.admin.activities.configuration_admin_update_html', fields: fields_clause_for(entry.tracked_changes), name: name)
@@ -0,0 +1,12 @@
1
+ .activity
2
+ .activity__header
3
+ .activity__avatar
4
+ = link_to_modifier(entry) do
5
+ = avatar_for entry.modifier
6
+ %h3.activity__name= link_to_modifier(entry)
7
+ %p.activity__time= activity_time(entry.created_at)
8
+ .activity__message
9
+ - if entry.audited.present?
10
+ = t('workarea.admin.activities.fulfillment_sku_create_html', name: link_to(entry.audited.name, fulfillment_sku_path(entry.audited)))
11
+ - else
12
+ = t('workarea.admin.activities.fulfillment_sku_create_html', name: entry.model_attributes['_id'])
@@ -0,0 +1,10 @@
1
+ .activity
2
+ .activity__header
3
+ .activity__avatar
4
+ = link_to_modifier(entry) do
5
+ = avatar_for entry.modifier
6
+ %h3.activity__name= link_to_modifier(entry)
7
+ %p.activity__time= activity_time(entry.created_at)
8
+ .activity__message
9
+ = t('workarea.admin.activities.fulfillment_sku_destroy_html', name: entry.model_attributes['_id'])
10
+ = link_to_restore_for(entry)
@@ -0,0 +1,10 @@
1
+ .activity
2
+ .activity__header
3
+ .activity__avatar
4
+ = link_to_modifier(entry) do
5
+ = avatar_for entry.modifier
6
+ %h3.activity__name= link_to_modifier(entry)
7
+ %p.activity__time= activity_time(entry.created_at)
8
+ .activity__message
9
+ - name = entry.audited.blank? ? entry.model_attributes['_id'] : link_to(entry.audited.name, fulfillment_sku_path(entry.audited))
10
+ = t('workarea.admin.activities.fulfillment_sku_update_html', fields: fields_clause_for(entry.tracked_changes), name: name)
@@ -0,0 +1,12 @@
1
+ .activity
2
+ .activity__header
3
+ .activity__avatar
4
+ = link_to_modifier(entry) do
5
+ = avatar_for entry.modifier
6
+ %h3.activity__name= link_to_modifier(entry)
7
+ %p.activity__time= activity_time(entry.created_at)
8
+ .activity__message
9
+ - if entry.audited.present?
10
+ = t('workarea.admin.activities.segment_create_html', name: link_to(entry.audited.name, segment_path(entry.audited)))
11
+ - else
12
+ = t('workarea.admin.activities.segment_create_html', name: entry.model_name)
@@ -0,0 +1,10 @@
1
+ .activity
2
+ .activity__header
3
+ .activity__avatar
4
+ = link_to_modifier(entry) do
5
+ = avatar_for entry.modifier
6
+ %h3.activity__name= link_to_modifier(entry)
7
+ %p.activity__time= activity_time(entry.created_at)
8
+ .activity__message
9
+ = t('workarea.admin.activities.segment_destroy_html', name: entry.model_name)
10
+ = link_to_restore_for(entry)
@@ -0,0 +1,10 @@
1
+ .activity
2
+ .activity__header
3
+ .activity__avatar
4
+ = link_to_modifier(entry) do
5
+ = avatar_for entry.modifier
6
+ %h3.activity__name= link_to_modifier(entry)
7
+ %p.activity__time= activity_time(entry.created_at)
8
+ .activity__message
9
+ - name = entry.audited.blank? ? entry.model_name : link_to(entry.audited.name, segment_path(entry.audited))
10
+ = t('workarea.admin.activities.segment_update_html', fields: fields_clause_for(entry.tracked_changes), name: name)
@@ -24,20 +24,27 @@
24
24
 
25
25
  = render 'workarea/admin/shared/creation_date', search: @activity, form_path: catalog_categories_path
26
26
 
27
- .activity-group.activity-group--bordered
27
+ %p.browsing-controls__count= t('workarea.admin.activities.show.activity', count: @activity.entries.count)
28
+
29
+ .view__container
30
+ .section
28
31
  - if @activity.entries.present?
29
32
  - @activity.days.each_with_index do |(day, entries), index|
30
- - unless (index.zero? && @activity.hide_first_header?) || entries.blank?
31
- .activity-group__header
32
- - if day < Time.current.beginning_of_week.to_date
33
- = day.to_s(:date_only)
34
- - else
35
- = relative_weekday(day)
36
- .activity-group__activities
37
- - entries.each do |entry|
38
- = render_activity_entry(entry)
33
+ .activity-group
34
+ .grid
35
+ .grid__cell.grid__cell--20
36
+ .date-marker
37
+ - if day == Date.today
38
+ .date-marker__annotation= t('workarea.admin.timeline.today')
39
+ .date-marker__month= local_time(day, format: '%b')
40
+ .date-marker__day= local_time(day, format: '%e')
41
+ .grid__cell.grid__cell--80
42
+ .activity-group__activities
43
+ - entries.each do |entry|
44
+ = render_activity_entry(entry)
39
45
  - else
40
- %p.heading.heading--3= t('workarea.admin.activities.show.no_activity')
46
+ .align-center
47
+ %p.heading.heading--3= t('workarea.admin.activities.show.no_activity')
41
48
 
42
49
  - if @activity.entries.total_pages > 1
43
50
  = render 'workarea/admin/shared/pagination', collection: @activity.entries
@@ -24,6 +24,10 @@
24
24
  = inline_svg('workarea/admin/i18n.svg', class: 'svg-icon svg-icon--small') if locale_options.many? && Workarea.config.localized_active_fields
25
25
  = toggle_button_for 'bulk_action[settings][active]', @bulk_action.selected_true?('settings', 'active'), disabled: !@bulk_action.selected?('settings', 'active')
26
26
 
27
+ .property
28
+ = label_tag 'bulk_action_settings_active_segment_ids', t('workarea.admin.shared.active_field.only_for'), class: 'property__name'
29
+ = select_tag 'bulk_action[settings][active_segment_ids]', options_from_collection_for_select(segments, :id, :name, @bulk_action.settings['active_segment_ids'] || []), multiple: true, data: { select: { placeholder: t('workarea.admin.shared.active_field.select_segments'), allowClear: true } }
30
+
27
31
  .bulk-actions__sub-section
28
32
  .grid
29
33
  .grid__cell
@@ -13,11 +13,18 @@
13
13
  .bulk-actions__section
14
14
  %h2.bulk-actions__section-heading= t('workarea.admin.bulk_action_product_edits.settings.title')
15
15
  .bulk-actions__sub-section
16
- - if @bulk_action.settings.present?
17
- - @bulk_action.settings.each do |name, value|
18
- %p <strong>#{name.humanize.titleize}</strong>: #{value}
19
- - else
16
+ - if @bulk_action.settings.blank?
20
17
  %p= t('workarea.admin.bulk_action_product_edits.review.no_change')
18
+ - else
19
+ - @bulk_action.settings.except('active_segment_ids').each do |name, value|
20
+ %p
21
+ %strong= t("workarea.admin.fields.#{name}", default: name.titleize)
22
+ #{change_display_value(value)}
23
+
24
+ - if @bulk_action.segments.present?
25
+ %p
26
+ %strong= t('workarea.admin.fields.active_segment_ids')
27
+ = @bulk_action.segments.map(&:name).to_sentence
21
28
 
22
29
  .bulk-actions__section
23
30
  %h2.bulk-actions__section-heading= t('workarea.admin.fields.tags')
@@ -44,7 +44,7 @@
44
44
  %span.property__name
45
45
  = t('workarea.admin.catalog_products.edit.active_title')
46
46
  = inline_svg('workarea/admin/i18n.svg', class: 'svg-icon svg-icon--small') if locale_options.many? && Workarea.config.localized_active_fields
47
- = toggle_button_for 'product[active]', @product.active?
47
+ = render 'workarea/admin/shared/active_field', scope: 'product', model: @product
48
48
 
49
49
  .grid__cell.grid__cell--25
50
50
  .property