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
@@ -21,10 +21,13 @@
21
21
  %tr
22
22
  %th= t('workarea.admin.fields.product')
23
23
  %th.align-center= link_to_reports_sorting t('workarea.admin.fields.units_sold'), report: @report, sort_by: 'units_sold'
24
+ %th.align-center= link_to_reports_sorting t('workarea.admin.fields.units_canceled'), report: @report, sort_by: 'units_canceled'
24
25
  %th.align-center= link_to_reports_sorting t('workarea.admin.fields.orders'), report: @report, sort_by: 'orders'
26
+ %th.align-right= link_to_reports_sorting t('workarea.admin.fields.average_price'), report: @report, sort_by: 'average_price'
25
27
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.merchandise'), report: @report, sort_by: 'merchandise'
26
28
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.discounts'), report: @report, sort_by: 'discounts'
27
29
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.tax'), report: @report, sort_by: 'tax'
30
+ %th.align-right= link_to_reports_sorting t('workarea.admin.fields.refund'), report: @report, sort_by: 'refund'
28
31
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.revenue'), report: @report, sort_by: 'revenue'
29
32
  %tbody
30
33
  - @report.results.each do |result|
@@ -35,8 +38,11 @@
35
38
  - else
36
39
  = result._id
37
40
  %td.align-center= number_with_delimiter result.units_sold
41
+ %td.align-center= number_with_delimiter result.units_canceled
38
42
  %td.align-center= number_with_delimiter result.orders
43
+ %td.align-right= number_to_currency(result.average_price)
39
44
  %td.align-right= number_to_currency(result.merchandise)
40
45
  %td.align-right= number_to_currency(result.discounts)
41
46
  %td.align-right= number_to_currency(result.tax)
47
+ %td.align-right= number_to_currency(result.refund)
42
48
  %td.align-right= number_to_currency(result.revenue)
@@ -21,10 +21,13 @@
21
21
  %tr
22
22
  %th= link_to_reports_sorting t('workarea.admin.fields.sku'), report: @report, sort_by: '_id'
23
23
  %th.align-center= link_to_reports_sorting t('workarea.admin.fields.units_sold'), report: @report, sort_by: 'units_sold'
24
+ %th.align-center= link_to_reports_sorting t('workarea.admin.fields.units_canceled'), report: @report, sort_by: 'units_canceled'
24
25
  %th.align-center= link_to_reports_sorting t('workarea.admin.fields.orders'), report: @report, sort_by: 'orders'
26
+ %th.align-right= link_to_reports_sorting t('workarea.admin.fields.average_price'), report: @report, sort_by: 'average_price'
25
27
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.merchandise'), report: @report, sort_by: 'merchandise'
26
28
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.discounts'), report: @report, sort_by: 'discounts'
27
29
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.tax'), report: @report, sort_by: 'tax'
30
+ %th.align-right= link_to_reports_sorting t('workarea.admin.fields.refund'), report: @report, sort_by: 'refund'
28
31
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.revenue'), report: @report, sort_by: 'revenue'
29
32
  %tbody
30
33
  - @report.results.each do |result|
@@ -35,8 +38,11 @@
35
38
  - else
36
39
  = result._id
37
40
  %td.align-center= number_with_delimiter result.units_sold
41
+ %td.align-center= number_with_delimiter result.units_canceled
38
42
  %td.align-center= number_with_delimiter result.orders
43
+ %td.align-right= number_to_currency(result.average_price)
39
44
  %td.align-right= number_to_currency(result.merchandise)
40
45
  %td.align-right= number_to_currency(result.discounts)
41
46
  %td.align-right= number_to_currency(result.tax)
47
+ %td.align-right= number_to_currency(result.refund)
42
48
  %td.align-right= number_to_currency(result.revenue)
@@ -0,0 +1,30 @@
1
+ - @page_title = t('workarea.admin.reports.sales_by_tender.title')
2
+
3
+ .view
4
+ .view__header
5
+ .view__heading
6
+ = link_to "↑ #{t('workarea.admin.reports.all_reports')}", reports_dashboards_path
7
+ %h1.heading.heading--no-margin= t('workarea.admin.reports.sales_by_tender.title')
8
+ %p= t('workarea.admin.reports.reference_link_html', path: reference_report_path)
9
+
10
+ .view__container.view__container--narrow
11
+ .browsing-controls.browsing-controls--with-divider.browsing-controls--center.browsing-controls--filters-displayed
12
+ = form_tag sales_by_tender_report_path, method: 'get', class: 'browsing-controls__form' do
13
+ = render 'workarea/admin/shared/date_selector', starts_at: @report.starts_at, ends_at: @report.ends_at
14
+
15
+ .browsing-controls__count
16
+ = render_reports_results_message(@report)
17
+ = render 'workarea/admin/reports/export', report: @report
18
+
19
+ %table
20
+ %thead
21
+ %tr
22
+ %th= t('workarea.admin.fields.tender')
23
+ %th.align-center= link_to_reports_sorting t('workarea.admin.fields.orders'), report: @report, sort_by: 'orders'
24
+ %th.align-right= link_to_reports_sorting t('workarea.admin.fields.revenue'), report: @report, sort_by: 'revenue'
25
+ %tbody
26
+ - @report.results.each do |result|
27
+ %tr
28
+ %td= result.name
29
+ %td.align-center= number_with_delimiter result.orders
30
+ %td.align-right= number_to_currency(result.revenue)
@@ -14,7 +14,7 @@
14
14
  .grid__cell= render 'workarea/admin/shared/date_selector', starts_at: @report.starts_at, ends_at: @report.ends_at
15
15
  .grid__cell
16
16
  .property.property--inline
17
- = label_tag 'group_by', t('workarea.admin.reports.first_time_vs_returning_sales.by')
17
+ = label_tag 'group_by', t('workarea.admin.reports.by')
18
18
  = select_tag 'group_by', options_for_select(@report.group_by_options, @report.group_by), data: { form_submitting_control: '' }
19
19
 
20
20
  .browsing-controls__count
@@ -29,11 +29,13 @@
29
29
  %th= link_to_reports_sorting t('workarea.admin.fields.period'), report: @report, sort_by: '_id'
30
30
  %th.align-center= link_to_reports_sorting t('workarea.admin.fields.units_sold'), report: @report, sort_by: 'units_sold'
31
31
  %th.align-center= link_to_reports_sorting t('workarea.admin.fields.orders'), report: @report, sort_by: 'orders'
32
+ %th.align-center= link_to_reports_sorting t('workarea.admin.fields.cancellations'), report: @report, sort_by: 'cancellations'
32
33
  %th.align-center= link_to_reports_sorting t('workarea.admin.fields.customers'), report: @report, sort_by: 'customers'
33
34
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.merchandise'), report: @report, sort_by: 'merchandise'
34
35
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.shipping'), report: @report, sort_by: 'shipping'
35
36
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.discounts'), report: @report, sort_by: 'discounts'
36
37
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.tax'), report: @report, sort_by: 'tax'
38
+ %th.align-right= link_to_reports_sorting t('workarea.admin.fields.refund'), report: @report, sort_by: 'refund'
37
39
  %th.align-right= link_to_reports_sorting t('workarea.admin.fields.revenue'), report: @report, sort_by: 'revenue'
38
40
  %tbody
39
41
  - @report.results.each do |result|
@@ -41,9 +43,11 @@
41
43
  %td= result.period
42
44
  %td.align-center= number_with_delimiter result.units_sold
43
45
  %td.align-center= number_with_delimiter result.orders
46
+ %td.align-center= number_with_delimiter result.cancellations
44
47
  %td.align-center= number_with_delimiter result.customers
45
48
  %td.align-right= number_to_currency(result.merchandise)
46
49
  %td.align-right= number_to_currency(result.shipping)
47
50
  %td.align-right= number_to_currency(result.discounts)
48
51
  %td.align-right= number_to_currency(result.tax)
52
+ %td.align-right= number_to_currency(result.refund)
49
53
  %td.align-right= number_to_currency(result.revenue)
@@ -0,0 +1,20 @@
1
+ - @page_title = t('workarea.admin.reports.timeline.title')
2
+
3
+ .view
4
+ .view__header
5
+ .view__heading
6
+ = link_to "↑ #{t('workarea.admin.reports.all_reports')}", reports_dashboards_path
7
+ %h1.heading.heading--no-margin= t('workarea.admin.reports.timeline.title')
8
+ %p= t('workarea.admin.reports.reference_link_html', path: reference_report_path)
9
+
10
+ .view__container
11
+ .browsing-controls.browsing-controls--with-divider.browsing-controls--center.browsing-controls--filters-displayed
12
+ = form_tag timeline_report_path, method: 'get', class: 'browsing-controls__form' do
13
+ .grid.grid--center.grid--auto.grid--middle
14
+ .grid__cell= render 'workarea/admin/shared/date_selector', starts_at: @report.starts_at, ends_at: @report.ends_at
15
+
16
+ #timeline-report-chart-legend.chart-legend
17
+ -# Generated via JS
18
+
19
+ .section
20
+ %canvas#timeline-report{ data: { timeline_report_chart: @report.graph_data.to_json } }
@@ -11,6 +11,7 @@
11
11
  %li
12
12
  %strong= t('workarea.admin.fields.active')
13
13
  = check_box_tag 'customization', 'active', model.active, disabled: true
14
+ = inline_svg('workarea/admin/icons/user.svg', class: 'svg-icon svg-icon--small svg-icon--blue') if model.active? && model.segments.any?
14
15
  %li
15
16
  %strong= t('workarea.admin.search_customizations.cards.attribtes.search_id')
16
17
  = model.id
@@ -23,7 +23,7 @@
23
23
  %span.property__name
24
24
  = t('workarea.admin.fields.active')
25
25
  = inline_svg('workarea/admin/i18n.svg', class: 'svg-icon svg-icon--small') if locale_options.many? && Workarea.config.localized_active_fields
26
- = toggle_button_for 'customization[active]', @customization.active?
26
+ = render 'workarea/admin/shared/active_field', scope: 'customization', model: @customization
27
27
 
28
28
  .section
29
29
  %h2= t('workarea.admin.search_customizations.edit.query_rewrite')
@@ -53,6 +53,7 @@
53
53
  = comments_icon_for(customization)
54
54
  = top_icon_for(customization)
55
55
  = trending_icon_for(customization)
56
+ = segments_icon_for(customization)
56
57
  %td= link_to customization.query, search_customization_path(customization)
57
58
  %td.align-center= t("workarea.admin.#{customization.redirect?}")
58
59
  %td.align-center= t("workarea.admin.#{customization.rewrite?}")
@@ -46,9 +46,10 @@
46
46
 
47
47
  - if @search.results.present?
48
48
  - if @search.results.any?
49
- .grid.grid--auto.grid--flush.grid--center
50
- - @search.results.each do |result|
51
- .grid__cell= render_summary_for(result)
49
+ .section
50
+ .grid.grid--auto.grid--flush.grid--center
51
+ - @search.results.each do |result|
52
+ .grid__cell= render_summary_for(result)
52
53
 
53
- - if @search.results.total_pages > 1
54
- = render 'workarea/admin/shared/pagination', collection: @search.results
54
+ - if @search.results.total_pages > 1
55
+ = render 'workarea/admin/shared/pagination', collection: @search.results
@@ -0,0 +1,29 @@
1
+ - @page_title = t('workarea.admin.segment_overrides.show.title')
2
+
3
+ .view
4
+ .view__header
5
+ .grid.grid--center
6
+ .grid__cell.grid__cell--50
7
+ .view__heading
8
+ %h1
9
+ = inline_svg('workarea/admin/icons/user.svg', class: 'svg-icon svg-icon--large svg-icon--blue')
10
+ = t('workarea.admin.segment_overrides.show.title')
11
+ .grid.grid--center
12
+ .grid__cell.grid__cell--50
13
+ %p= t('workarea.admin.segment_overrides.show.description')
14
+
15
+ .view__container.view__container--narrow
16
+ = form_tag segment_override_path, method: 'post' do
17
+ = hidden_field_tag 'return_to', params[:return_to]
18
+
19
+ .grid.grid--center
20
+ .grid__cell.grid__cell--50
21
+ %table
22
+ %tbody
23
+ - segments.each do |segment|
24
+ %tr
25
+ %td= link_to segment.name, segment
26
+ %td.align-right= toggle_button_for "segment_ids[#{segment.id}]", override_segments.include?(segment), id: segment.id
27
+
28
+ .align-center
29
+ = button_tag "#{t('workarea.admin.segment_overrides.show.button')} →", value: 'set_overrides', class: 'button'
@@ -0,0 +1,13 @@
1
+ .align-center
2
+ - if rule.persisted?
3
+ = form_tag segment_rule_path(segment, rule), method: 'patch', data: { unsaved_changes: '' } do
4
+ = hidden_field_tag 'return_to', local_assigns[:return_to]
5
+ = render "workarea/admin/segment_rules/fields/#{rule.slug}", rule: rule
6
+ .section= button_tag t('workarea.admin.actions.save'), value: 'save_rule', class: 'button button--small'
7
+
8
+ - else
9
+ = form_tag segment_rules_path(segment), method: 'post', data: { unsaved_changes: '' } do
10
+ = hidden_field_tag 'return_to', local_assigns[:return_to]
11
+ = hidden_field_tag 'rule_type', rule.slug
12
+ = render "workarea/admin/segment_rules/fields/#{rule.slug}", rule: rule
13
+ .section= button_tag t('workarea.admin.actions.save'), value: 'save_rule', class: 'button button--small'
@@ -0,0 +1,13 @@
1
+ %p= t('workarea.admin.segment_rules.fields.browser_info.note_html')
2
+
3
+ .property
4
+ = label_tag 'rule_general', t('workarea.admin.fields.browser_info'), class: 'property__name'
5
+ = select_tag 'rule[general]', options_for_select(browser_info_options, rule.general), multiple: true, data: { select: { placeholder: t('workarea.admin.fields.browser_info') + '...', allowClear: true } }
6
+
7
+ .property
8
+ = label_tag 'rule_device', t('workarea.admin.fields.device'), class: 'property__name'
9
+ = select_tag 'rule[device]', options_for_select(device_type_options, rule.device), multiple: true, data: { select: { placeholder: t('workarea.admin.fields.device') + '...', allowClear: true } }
10
+
11
+ .property
12
+ = label_tag 'rule_platform', t('workarea.admin.fields.platform'), class: 'property__name'
13
+ = select_tag 'rule[platform]', options_for_select(platform_options, rule.platform), multiple: true, data: { select: { placeholder: t('workarea.admin.fields.platform') + '...', allowClear: true } }
@@ -0,0 +1,4 @@
1
+ .property
2
+ = label_tag 'rule_locations', t('workarea.admin.fields.locations'), class: 'property__name'
3
+ = select_tag 'rule[locations]', options_for_select(selected_segment_geolocation_options(rule.locations), rule.locations), multiple: true, data: { remote_select: { options: { tags: true }, source: geolocation_options_segment_rules_path(format: :json) }.to_json }
4
+ %span.property__note= t('workarea.admin.segment_rules.fields.geolocation.note')
@@ -0,0 +1,3 @@
1
+ %span Ordered in the last
2
+ = number_field_tag 'rule[days]', rule.days.presence || Workarea.config.loyal_customers_last_order_days_ago, class: 'text-box text-box--small'
3
+ %span days
@@ -0,0 +1,2 @@
1
+ %span The visitor is
2
+ = select_tag 'rule[logged_in]', options_for_select({ 'logged in' => true, 'not logged in' => false }, rule.logged_in)
@@ -0,0 +1,5 @@
1
+ %span From
2
+ = number_field_tag 'rule[minimum]', rule.minimum, class: 'text-box text-box--small'
3
+ %span to
4
+ = number_field_tag 'rule[maximum]', rule.maximum, class: 'text-box text-box--small'
5
+ %span orders
@@ -0,0 +1,9 @@
1
+ %span
2
+ From
3
+ = Money.default_currency.symbol
4
+ = number_field_tag 'rule[minimum]', rule.minimum, class: 'text-box text-box--small'
5
+ %span
6
+ To
7
+ = Money.default_currency.symbol
8
+ = number_field_tag 'rule[maximum]', rule.maximum, class: 'text-box text-box--small'
9
+ %span in revenue
@@ -0,0 +1,5 @@
1
+ %span From
2
+ = number_field_tag 'rule[minimum]', rule.minimum, class: 'text-box text-box--small'
3
+ %span to
4
+ = number_field_tag 'rule[maximum]', rule.maximum, class: 'text-box text-box--small'
5
+ %span visits
@@ -0,0 +1,4 @@
1
+ .property
2
+ = label_tag 'rule_locations', 'Customer tags', class: 'property__name'
3
+ = text_field_tag 'rule[tag_list]', rule.tag_list, class: 'text-box text-box--wide'
4
+ %span.property__note= t('workarea.admin.segment_rules.tags_note')
@@ -0,0 +1,13 @@
1
+ .property
2
+ = label_tag 'rule[medium]', t('workarea.admin.fields.medium'), class: 'property__name'
3
+ = select_tag 'rule[medium]', options_for_select(traffic_referrer_medium_options, rule.medium)
4
+
5
+ .property
6
+ = label_tag 'rule[source]', t('workarea.admin.fields.source'), class: 'property__name'
7
+ = text_field_tag 'rule[source]', rule.medium, class: 'text-box text-box--wide'
8
+ %span.property__note
9
+ = t('workarea.admin.segment_rules.fields.traffic_referrer.source_notes')
10
+ = link_to '#source-help', data: { tooltip: { interactive: true } } do
11
+ = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon svg-icon--small svg-icon--blue', title: t('workarea.admin.segment_rules.fields.traffic_referrer.source'))
12
+ #source-help.tooltip-content
13
+ %p= t('workarea.admin.segment_rules.fields.traffic_referrer.source_notes_html')
@@ -0,0 +1,4 @@
1
+ json.results @results do |result|
2
+ json.label result.name
3
+ json.value result.id
4
+ end
@@ -0,0 +1,25 @@
1
+ - @page_title = t('workarea.admin.segment_rules.index.title', name: @segment.name)
2
+
3
+ .view
4
+ .view__header
5
+ .grid.grid--center
6
+ .grid__cell.grid__cell--50
7
+ .view__heading
8
+ = link_to_index_for(@segment)
9
+ %h1= @segment.name
10
+
11
+ .view__container
12
+ = render_cards_for(@segment, :rules)
13
+
14
+ .section
15
+ .grid.grid--center
16
+ .grid__cell.grid__cell--50
17
+ .align-center
18
+ %h2= t('workarea.admin.segment_rules.index.rules')
19
+ - @segment.rules.each do |rule|
20
+ .box.box--rounded.box--padded
21
+ = render "workarea/admin/segment_rules/summaries/#{rule.slug}", rule: rule
22
+
23
+ .section.align-center
24
+ %h5= t('workarea.admin.segment_rules.index.no_edit')
25
+ %p= t('workarea.admin.segment_rules.index.no_edit_description_html', link: link_to(t('workarea.admin.segment_rules.index.creating_a_new_segment'), create_segments_path))
@@ -0,0 +1,11 @@
1
+ - if rule.general.present?
2
+ %span.text.text--large
3
+ = rule.general.map { |g| t("workarea.admin.segment_rules.browser_info.#{g}") }.to_sentence
4
+
5
+ - if rule.device.present?
6
+ %span.text.text--large
7
+ = rule.device.map { |d| t("workarea.admin.segment_rules.devices.#{d}") }.to_sentence
8
+
9
+ - if rule.platform.present?
10
+ %span.text.text--large
11
+ = rule.platform.map { |p| t("workarea.admin.segment_rules.platform.#{p}") }.to_sentence
@@ -0,0 +1,2 @@
1
+ %span.text.text--large
2
+ = t('workarea.admin.segment_rules.summaries.geolocation.description_html', locations: selected_segment_geolocation_options(rule.locations).map { |o| %("#{o.first}") }.join(', '))
@@ -0,0 +1,2 @@
1
+ %span.text.text--large
2
+ = t('workarea.admin.segment_rules.summaries.last_order.description_html', count: rule.days)
@@ -0,0 +1,5 @@
1
+ %span.text.text--large
2
+ - if rule.logged_in?
3
+ = t('workarea.admin.segment_rules.summaries.logged_in.logged_in_html')
4
+ - else
5
+ = t('workarea.admin.segment_rules.summaries.logged_in.logged_out_html')
@@ -0,0 +1,6 @@
1
+ %span.text.text--large
2
+ - minimum = rule.minimum.presence || 0
3
+ - if minimum == rule.maximum
4
+ = t('workarea.admin.segment_rules.summaries.orders.single_value_description_html', count: minimum)
5
+ - else
6
+ = t('workarea.admin.segment_rules.summaries.orders.description_html', minimum: minimum, maximum: rule.maximum.presence || '∞')
@@ -0,0 +1,7 @@
1
+ %span.text.text--large
2
+ - minimum = rule.minimum.presence || 0
3
+ - if minimum == rule.maximum
4
+ = t('workarea.admin.segment_rules.summaries.revenue.single_value_description_html', amount: number_to_currency(minimum))
5
+ - else
6
+ - max = rule.maximum.present? ? number_to_currency(rule.maximum) : '∞'
7
+ = t('workarea.admin.segment_rules.summaries.revenue.description_html', minimum: number_to_currency(minimum), maximum: max)
@@ -0,0 +1,6 @@
1
+ %span.text.text--large
2
+ - minimum = rule.minimum.presence || 0
3
+ - if minimum == rule.maximum
4
+ = t('workarea.admin.segment_rules.summaries.sessions.single_value_description_html', count: minimum)
5
+ - else
6
+ = t('workarea.admin.segment_rules.summaries.sessions.description_html', minimum: rule.minimum.presence || 0, maximum: rule.maximum.presence || '∞')
@@ -0,0 +1,2 @@
1
+ %span.text.text--large
2
+ = t('workarea.admin.segment_rules.summaries.tags.description_html', tags: rule.tags.join(', '))
@@ -0,0 +1,10 @@
1
+ - if rule.medium.present?
2
+ %span.text.text--large
3
+ %span #{t('workarea.admin.fields.medium')}:
4
+ %strong= rule.medium.titleize
5
+ ,
6
+
7
+ - if rule.source.present?
8
+ %span.text.text--large
9
+ %span #{t('workarea.admin.fields.source')}:
10
+ %strong= rule.source
@@ -0,0 +1,81 @@
1
+ .grid.grid--auto.grid--flush.grid--center
2
+ .grid__cell
3
+ .card{ class: card_classes(:attributes, local_assigns[:active]) }
4
+ = link_to edit_segment_path(model), class: 'card__header' do
5
+ %span.card__header-text= t('workarea.admin.segments.cards.attributes.header')
6
+ = inline_svg 'workarea/admin/icons/attributes.svg', class: 'card__icon'
7
+
8
+ - if local_assigns[:active].blank?
9
+ .card__body
10
+ %ul.list-reset
11
+ %li
12
+ %strong #{t('workarea.admin.fields.tags')}:
13
+ = model.tags.join(', ').presence || '(none)'
14
+ %li
15
+ %strong #{t('workarea.admin.fields.updated_at')}:
16
+ #{local_time_ago(model.updated_at)}
17
+ %li
18
+ %strong #{t('workarea.admin.fields.created_at')}:
19
+ #{local_time_ago(model.created_at)}
20
+
21
+ = link_to edit_segment_path(model), class: 'card__button' do
22
+ %span.button.button--small= t('workarea.admin.segments.cards.attributes.button')
23
+
24
+ .grid__cell
25
+ .card{ class: card_classes(:rules, local_assigns[:active]) }
26
+ = link_to segment_rules_path(model), class: 'card__header' do
27
+ %span.card__header-text= t('workarea.admin.segments.cards.rules.header')
28
+ = inline_svg 'workarea/admin/icons/rules.svg', class: 'card__icon'
29
+
30
+ - if local_assigns[:active].blank?
31
+ .card__body
32
+ - if model.rules.any?
33
+ - model.rules.each do |rule|
34
+ .box.box--padded.box--rounded
35
+ = render "workarea/admin/segment_rules/summaries/#{rule.slug}", rule: rule
36
+
37
+ = link_to segment_rules_path(model), class: 'card__button' do
38
+ %span.button.button--small= t('workarea.admin.segments.cards.rules.button')
39
+
40
+ .grid__cell
41
+ .card{ class: card_classes(:insights, local_assigns[:active]) }
42
+ = link_to insights_segment_path(model), class: 'card__header' do
43
+ %span.card__header-text= t('workarea.admin.segments.cards.insights.header')
44
+ = inline_svg 'workarea/admin/icons/insights.svg', class: 'card__icon'
45
+
46
+ - if local_assigns[:active].blank?
47
+ .card__body
48
+ %p.align-center
49
+ %span.spark.spark--large{ title: t('workarea.admin.segments.index.sparkline_title') }
50
+ {#{sparkline_analytics_data_for(model.insights.orders_sparkline).join(',')}}
51
+
52
+ %span.heading.heading--4.align-center
53
+ #{number_with_delimiter model.insights.orders}
54
+ #{t('workarea.admin.segments.cards.insights.orders')}
55
+ #{insights_trend_icon(model.insights.orders_percent_change)}
56
+
57
+ .grid
58
+ .grid__cell.grid__cell--50
59
+ %p.align-center
60
+ %strong= number_to_currency model.insights.revenue
61
+ #{insights_trend_icon(model.insights.revenue_percent_change)}
62
+ %br
63
+ #{t('workarea.admin.segments.cards.insights.revenue')}
64
+ .grid__cell.grid__cell--50
65
+ %p.align-center
66
+ %strong= number_to_currency model.insights.average_order_value
67
+ #{insights_trend_icon(model.insights.average_order_value_percent_change)}
68
+ %br
69
+ #{t('workarea.admin.segments.cards.insights.aov')}
70
+
71
+ %p.align-center
72
+ = distance_of_time_in_words(model.insights.starts_at, model.insights.ends_at)
73
+
74
+ = link_to insights_segment_path(model), class: 'card__button' do
75
+ %span.button.button--small= t('workarea.admin.segments.cards.insights.button')
76
+
77
+ .grid__cell
78
+ = render 'workarea/admin/timeline/card', timeline: model.timeline, active: local_assigns[:active]
79
+
80
+ .grid__cell
81
+ = render 'workarea/admin/comments/card', commentable: model, active: local_assigns[:active]
@@ -0,0 +1,10 @@
1
+ .section.align-center
2
+ %h4.link{ data: { toggle_element: '#segments-table' } }= t('workarea.admin.segments.publish.title')
3
+
4
+ #segments-table.hidden
5
+ %p= t('workarea.admin.segments.publish.description')
6
+
7
+ .property
8
+ = label_tag 'active_segment_ids', t('workarea.admin.shared.active_field.only_for'), class: 'property__name'
9
+ = select_tag 'active_segment_ids', options_from_collection_for_select(segments, :id, :name, model.active_segment_ids), multiple: true, data: { select: { placeholder: t('workarea.admin.shared.active_field.select_segments'), allowClear: true, dropdownParent: '#active-by-segment' } }
10
+ %span.property__note= t('workarea.admin.shared.active_field.only_these_segments')
@@ -0,0 +1,41 @@
1
+ - @page_title = t('workarea.admin.segments.edit.page_title', name: @segment.name)
2
+
3
+ .segment.view
4
+ .view__header
5
+ .grid.grid--center
6
+ .grid__cell.grid__cell--50
7
+ .view__heading
8
+ = link_to_index_for(@segment)
9
+ %h1= link_to @segment.name, url_for(@segment)
10
+
11
+ .view__container
12
+ = render_cards_for(@segment, :attributes)
13
+
14
+ .view__container.view__container--narrow
15
+ - @segment.errors.full_messages.each do |message|
16
+ = render_message 'error', message
17
+
18
+ = form_tag segment_path(@segment), method: 'patch', data: { unsaved_changes: '' } do
19
+ .section
20
+ .property.property--required
21
+ = label_tag 'segment[name]', t('workarea.admin.fields.name'), class: 'property__name'
22
+ = text_field_tag 'segment[name]', @segment.name, class: 'text-box', required: true
23
+
24
+ .property
25
+ = label_tag 'segment_tag_list', t('workarea.admin.fields.tags'), class: 'property__name'
26
+ = text_field_tag 'segment[tag_list]', @segment.tag_list, class: 'text-box'
27
+ %span.property__note= t('workarea.admin.form.csv_field_note')
28
+
29
+ .grid
30
+ .grid__cell.grid__cell--33.grid__cell--25-at-medium
31
+ .property
32
+ = label_tag 'segment_updated_at', t('workarea.admin.fields.updated_at'), class: 'property__name'
33
+ = local_time(@segment.updated_at)
34
+ .grid__cell.grid__cell--33.grid__cell--25-at-medium
35
+ .property
36
+ = label_tag 'segment_created_at', t('workarea.admin.fields.created_at'), class: 'property__name'
37
+ = local_time(@segment.created_at)
38
+
39
+ .workflow-bar
40
+ .grid.grid--auto.grid--right.grid--middle
41
+ .grid__cell= button_tag t('workarea.admin.form.save_changes'), value: 'save_segment', class: 'workflow-bar__button workflow-bar__button--update'
@@ -0,0 +1,64 @@
1
+ - @page_title = t('workarea.admin.segments.index.page_title')
2
+
3
+ .view
4
+ .view__header
5
+ .grid.grid--middle.grid--center
6
+ .grid__cell.grid__cell--50
7
+ .view__heading
8
+ = link_to "↑ #{t('workarea.admin.segments.index.dashboard_link')}", people_dashboards_path, class: 'view__dashboard-button'
9
+ %h1.heading--no-margin= t('workarea.admin.segments.index.page_title')
10
+ %p= t('workarea.admin.segments.index.description')
11
+
12
+ .view__container
13
+ .browsing-controls.browsing-controls--with-divider.browsing-controls--center
14
+ %p.browsing-controls__count
15
+ = t('workarea.admin.segments.index.segment', count: @segments.count)
16
+
17
+ - if @segments.any?
18
+ %table.index-table
19
+ %thead
20
+ %tr
21
+ %th.index-table__control-cell
22
+ .checkbox
23
+ = check_box_tag 'select_all', nil, false, id: 'select_all', class: 'checkbox__input', data: { bulk_action_select_all: '' }
24
+ = label_tag 'select_all', t('workarea.admin.bulk_actions.select_all'), class: 'checkbox__label'
25
+ %th= t('workarea.admin.fields.name')
26
+ %th= t('workarea.admin.fields.type')
27
+ %th.align-center= t('workarea.admin.fields.orders')
28
+ %th.align-center= t('workarea.admin.fields.aov')
29
+ %th.align-center= t('workarea.admin.fields.rules')
30
+ %th.align-center= t('workarea.admin.fields.insights')
31
+ %th= t('workarea.admin.fields.updated_at')
32
+ %tbody
33
+ - @segments.each do |segment|
34
+ %tr.index-table__row
35
+ %td.index-table__control-cell
36
+ .checkbox
37
+ = check_box_tag 'global_id', segment.to_gid_param, false, class: 'checkbox__input', id: dom_id(segment), data: { bulk_action_item: '' }
38
+ = label_tag dom_id(segment), '', class: 'checkbox__label', title: t('workarea.admin.bulk_actions.add_summary_button')
39
+ %td
40
+ = link_to segment.name, segment_path(segment)
41
+ = comments_icon_for(segment)
42
+ %td= segment.life_cycle? ? t('workarea.admin.segments.index.life_cycle') : t('workarea.admin.segments.index.custom')
43
+ %td.align-center= number_with_delimiter segment.insights.orders
44
+ %td.align-center= number_to_currency segment.insights.average_order_value
45
+ %td.align-center= segment.rules.size
46
+ %td.align-center
47
+ = link_to insights_segment_path(segment), class: 'link link--no-underline' do
48
+ %span.spark{ title: t('workarea.admin.segments.index.sparkline_title') }
49
+ {#{sparkline_analytics_data_for(segment.insights.orders_sparkline).join(',')}}
50
+ %td= local_time_ago(segment.updated_at)
51
+
52
+ .workflow-bar
53
+ .grid
54
+ .grid__cell.grid__cell--50
55
+ = render 'workarea/admin/shared/bulk_actions', klass: Workarea::Segment, search: @search
56
+
57
+ .grid__cell.grid__cell--50.align-right
58
+ - if segments.size >= 15
59
+ = link_to t('workarea.admin.segments.index.add_custom'), '#max-segments-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--create'
60
+ #max-segments-info.tooltip-content
61
+ %p= t('workarea.admin.segments.index.max_segments')
62
+
63
+ - else
64
+ = link_to t('workarea.admin.segments.index.add_custom'), create_segments_path, id: 'add_segment', class: 'workflow-bar__button workflow-bar__button--create'