workarea-registries 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +1 -0
- data/Rakefile +58 -0
- data/app/assets/images/workarea/storefront/registries/icons/email.svg +4 -0
- data/app/assets/images/workarea/storefront/registries/icons/link.svg +1 -0
- data/app/assets/javascripts/workarea/storefront/registries/modules/add_to_registry_button.js +49 -0
- data/app/assets/javascripts/workarea/storefront/registries/modules/copy_registry_url_button.js +51 -0
- data/app/assets/javascripts/workarea/storefront/registries/modules/toggle_registry_address.js +58 -0
- data/app/assets/javascripts/workarea/storefront/registries/templates/add_to_registry_button.jst.ejs +3 -0
- data/app/controllers/workarea/admin/registries_controller.rb +28 -0
- data/app/controllers/workarea/storefront/cart_items_controller.decorator +14 -0
- data/app/controllers/workarea/storefront/registries_controller.rb +47 -0
- data/app/controllers/workarea/storefront/users/registries_controller.rb +94 -0
- data/app/controllers/workarea/storefront/users/registry_items_controller.rb +67 -0
- data/app/controllers/workarea/storefront/users/registry_shares_controller.rb +43 -0
- data/app/controllers/workarea/storefront/users/registry_thanks_controller.rb +41 -0
- data/app/helpers/workarea/registries_helper.rb +41 -0
- data/app/mailers/workarea/storefront/registries_mailer.rb +52 -0
- data/app/models/workarea/checkout/steps/addresses.decorator +28 -0
- data/app/models/workarea/order.decorator +7 -0
- data/app/models/workarea/order/item.decorator +11 -0
- data/app/models/workarea/registry.rb +129 -0
- data/app/models/workarea/registry/item.rb +39 -0
- data/app/models/workarea/registry/public_search.rb +23 -0
- data/app/models/workarea/registry/share.rb +46 -0
- data/app/models/workarea/registry/thank.rb +26 -0
- data/app/models/workarea/search/admin/registry.rb +29 -0
- data/app/queries/workarea/search/admin_orders.decorator +7 -0
- data/app/queries/workarea/search/admin_registries.rb +16 -0
- data/app/seeds/workarea/registry_content_seeds.rb +50 -0
- data/app/services/workarea/inventory_adjustment.decorator +43 -0
- data/app/view_models/workarea/admin/registry_view_model.rb +19 -0
- data/app/view_models/workarea/storefront/checkout/addresses_view_model.decorator +17 -0
- data/app/view_models/workarea/storefront/order_item_view_model.decorator +9 -0
- data/app/view_models/workarea/storefront/order_view_model.decorator +8 -0
- data/app/view_models/workarea/storefront/registry_email_view_model.rb +37 -0
- data/app/view_models/workarea/storefront/registry_item_view_model.rb +72 -0
- data/app/view_models/workarea/storefront/registry_share_view_model.rb +6 -0
- data/app/view_models/workarea/storefront/registry_thank_view_model.rb +6 -0
- data/app/view_models/workarea/storefront/registry_view_model.rb +74 -0
- data/app/view_models/workarea/storefront/user_view_model.decorator +12 -0
- data/app/views/workarea/admin/registries/_menu.html.haml +1 -0
- data/app/views/workarea/admin/registries/index.html.haml +70 -0
- data/app/views/workarea/storefront/carts/_registry_details.html.haml +3 -0
- data/app/views/workarea/storefront/checkouts/_registry_address.html.haml +13 -0
- data/app/views/workarea/storefront/checkouts/_registry_address_fields.html.haml +28 -0
- data/app/views/workarea/storefront/checkouts/_registry_details.html.haml +3 -0
- data/app/views/workarea/storefront/products/_add_to_registry_placeholder.html.haml +1 -0
- data/app/views/workarea/storefront/registries/_registries_link.html.haml +4 -0
- data/app/views/workarea/storefront/registries/index.html.haml +39 -0
- data/app/views/workarea/storefront/registries/search.html.haml +35 -0
- data/app/views/workarea/storefront/registries/show.html.haml +63 -0
- data/app/views/workarea/storefront/registries_mailer/creation.html.haml +13 -0
- data/app/views/workarea/storefront/registries_mailer/gift_receipt.html.haml +51 -0
- data/app/views/workarea/storefront/registries_mailer/share.html.haml +21 -0
- data/app/views/workarea/storefront/registries_mailer/thank.html.haml +19 -0
- data/app/views/workarea/storefront/users/_registry_count.json.jbuilder +3 -0
- data/app/views/workarea/storefront/users/accounts/_registries.html.haml +14 -0
- data/app/views/workarea/storefront/users/registries/_form.html.haml +56 -0
- data/app/views/workarea/storefront/users/registries/_radio_list.html.haml +8 -0
- data/app/views/workarea/storefront/users/registries/_summary.html.haml +12 -0
- data/app/views/workarea/storefront/users/registries/edit.html.haml +4 -0
- data/app/views/workarea/storefront/users/registries/index.html.haml +24 -0
- data/app/views/workarea/storefront/users/registries/new.html.haml +4 -0
- data/app/views/workarea/storefront/users/registries/show.html.haml +75 -0
- data/app/views/workarea/storefront/users/registry_items/new.html.haml +10 -0
- data/app/views/workarea/storefront/users/registry_items/templates/_purchased.html.haml +29 -0
- data/app/views/workarea/storefront/users/registry_items/templates/_unpurchased.html.haml +35 -0
- data/app/views/workarea/storefront/users/registry_shares/_share_buttons.html.haml +18 -0
- data/app/views/workarea/storefront/users/registry_shares/new.html.haml +49 -0
- data/app/views/workarea/storefront/users/registry_thanks/new.html.haml +47 -0
- data/app/workers/workarea/send_gift_receipt.rb +15 -0
- data/app/workers/workarea/send_registry_creation_email.rb +12 -0
- data/app/workers/workarea/update_registry_items.rb +24 -0
- data/bin/rails +20 -0
- data/config/initializers/appends.rb +54 -0
- data/config/initializers/fields.rb +19 -0
- data/config/locales/en.yml +133 -0
- data/config/routes.rb +26 -0
- data/lib/workarea/mailer_previews/storefront/registry_mailer_preview.rb +25 -0
- data/lib/workarea/registries.rb +11 -0
- data/lib/workarea/registries/engine.rb +17 -0
- data/lib/workarea/registries/version.rb +5 -0
- data/test/dummy/config/application.rb +27 -0
- data/test/factories/workarea/registry.rb +67 -0
- data/test/integration/workarea/storefront/cart_item_registry_integration_test.rb +104 -0
- data/test/integration/workarea/storefront/checkout_registry_integration_test.rb +156 -0
- data/test/integration/workarea/storefront/registry_privacy_integration_test.rb +48 -0
- data/test/integration/workarea/storefront/user_registries_integration_test.rb +50 -0
- data/test/integration/workarea/storefront/user_registry_items_integration_test.rb +106 -0
- data/test/models/workarea/registry/item_test.rb +22 -0
- data/test/models/workarea/registry/public_search_test.rb +48 -0
- data/test/models/workarea/registry_test.rb +113 -0
- data/test/system/workarea/admin/registry_system_test.rb +20 -0
- data/test/workers/update_registry_items_test.rb +45 -0
- data/workarea-registries.gemspec +20 -0
- metadata +156 -0
@@ -0,0 +1 @@
|
|
1
|
+
%li{ class: "primary-nav__item" }= link_to t('workarea.admin.shared.primary_nav.registries'), registries_path, class: navigation_link_classes(registries_path)
|
@@ -0,0 +1,70 @@
|
|
1
|
+
- @page_title = t('workarea.admin.registries.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.registries.index.dashboard_link')}", orders_dashboards_path, class: 'view__dashboard-button'
|
9
|
+
%h1.heading--no-margin= t('workarea.admin.registries.index.title')
|
10
|
+
|
11
|
+
.view__container
|
12
|
+
.browsing-controls.browsing-controls--with-divider.browsing-controls--center{ class: ('browsing-controls--filters-displayed' unless @search.toggle_facets?) }
|
13
|
+
= form_tag registries_path, method: 'get', id: 'page_search_form', class: 'browsing-controls__form' do
|
14
|
+
= facet_hidden_inputs(@search.facets)
|
15
|
+
.browsing-controls__sort
|
16
|
+
.property.property--inline
|
17
|
+
= label_tag 'sort', t('workarea.admin.search.sort_by'), class: 'property__name'
|
18
|
+
= select_tag :sort, options_for_select(@search.sorts, selected: @search.sort), data: { form_submitting_control: '' }
|
19
|
+
|
20
|
+
.browsing-controls__search
|
21
|
+
.search-form
|
22
|
+
= text_field_tag :q, params[:q], class: 'search-form__input', id: 'search_products', title: t('workarea.admin.search.keywords'), placeholder: t('workarea.admin.search.keywords')
|
23
|
+
= submit_tag 'search_pages', class: 'search-form__button'
|
24
|
+
|
25
|
+
- if @search.facets.present?
|
26
|
+
- @search.facets.each do |facet|
|
27
|
+
= render "workarea/admin/facets/#{facet.type}", facet: facet
|
28
|
+
|
29
|
+
- if @search.toggle_facets?
|
30
|
+
.browsing-controls__toggle-filters
|
31
|
+
%button.text-button{ type: 'button', data: { toggle_filters: '' } }= t('workarea.admin.search.show_filters')
|
32
|
+
|
33
|
+
= render 'workarea/admin/facets/applied', search: @search, reset_path: registries_path
|
34
|
+
|
35
|
+
%p.browsing-controls__count{ data: { browsing_controls_count: @search.total } }
|
36
|
+
= t('workarea.admin.registries.pluralize', count: @search.total)
|
37
|
+
|
38
|
+
- if @search.results.any?
|
39
|
+
%table.index-table
|
40
|
+
%thead
|
41
|
+
%tr
|
42
|
+
%th.index-table__control-cell
|
43
|
+
.checkbox
|
44
|
+
= check_box_tag 'select_all', nil, false, id: 'select_all', class: 'checkbox__input', data: { bulk_action_select_all: '' }
|
45
|
+
= label_tag 'select_all', t('workarea.admin.bulk_actions.select_all'), class: 'checkbox__label'
|
46
|
+
%th= t('workarea.admin.fields.name')
|
47
|
+
%th= t('workarea.admin.fields.user_id')
|
48
|
+
%th= t('workarea.admin.fields.items')
|
49
|
+
%tbody
|
50
|
+
- @search.results.each do |result|
|
51
|
+
%tr.index-table__row
|
52
|
+
%td.index-table__control-cell
|
53
|
+
.checkbox
|
54
|
+
= check_box_tag 'global_id', result.to_gid_param, false, class: 'checkbox__input', id: dom_id(result), data: { bulk_action_item: '' }
|
55
|
+
= label_tag dom_id(result), '', class: 'checkbox__label', title: t('workarea.admin.bulk_actions.add_summary_button')
|
56
|
+
%td= result.name
|
57
|
+
%td
|
58
|
+
- if result.user.nil?
|
59
|
+
= result.user_id
|
60
|
+
- else
|
61
|
+
= link_to result.user.name, user_path(result.user)
|
62
|
+
%td= result.items.size
|
63
|
+
|
64
|
+
- if @search.results.total_pages > 1
|
65
|
+
= render 'workarea/admin/shared/pagination', collection: @search.results
|
66
|
+
|
67
|
+
.workflow-bar
|
68
|
+
.grid
|
69
|
+
.grid__cell.grid__cell--50
|
70
|
+
= render 'workarea/admin/shared/bulk_actions', klass: Workarea::Registry, search: @search, bulk_delete: false
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- if step.registry_address?
|
2
|
+
.checkout-addresses__section.checkout-addresses__fields--registry
|
3
|
+
%ul.list-reset.checkout-addresses__registry-address-radio-list{ data: { registry_address_radio_list: '' } }
|
4
|
+
%li.checkout-addresses__registry-radio-button{ data: { registry_address_option: { option: 'ship_to_another_address' }.to_json } }
|
5
|
+
= radio_button_tag 'ship_to_registrant', false, true, id: 'ship_to_another_address'
|
6
|
+
= label_tag 'ship_to_another_address', nil, class: 'button-property__name' do
|
7
|
+
%span.button-property__text= t('workarea.storefront.checkouts.ship_to_another_address')
|
8
|
+
%li.checkout-addresses__registry-radio-button{ data: { registry_address_option: { option: 'ship_to_registrant' }.to_json } }
|
9
|
+
= radio_button_tag 'ship_to_registrant', true, false, id: 'ship_to_registrant'
|
10
|
+
= label_tag 'ship_to_registrant', nil, class: 'button-property__name' do
|
11
|
+
%span.button-property__text= t('workarea.storefront.checkouts.ship_to_registrant')
|
12
|
+
|
13
|
+
= render 'workarea/storefront/checkouts/registry_address_fields', address: step.registry_address
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.checkout-addresses__fields--registry.hidden{ data: { registry_checkout_addresses_fields: '' } }
|
2
|
+
= address.first_name
|
3
|
+
= address.last_name
|
4
|
+
- if address.company.present?
|
5
|
+
%br
|
6
|
+
= address.company
|
7
|
+
%br
|
8
|
+
= address.street
|
9
|
+
- if address.street_2.present?
|
10
|
+
%br
|
11
|
+
= address.street_2
|
12
|
+
%br
|
13
|
+
= address.city
|
14
|
+
= address.region
|
15
|
+
= address.postal_code
|
16
|
+
%br
|
17
|
+
= address.country
|
18
|
+
|
19
|
+
= hidden_field_tag 'registry_shipping_address[first_name]', address.first_name, id: nil
|
20
|
+
= hidden_field_tag 'registry_shipping_address[last_name]', address.last_name, id: nil
|
21
|
+
= hidden_field_tag 'registry_shipping_address[company]', address.company, id: nil
|
22
|
+
= hidden_field_tag 'registry_shipping_address[street]', address.street, id: nil
|
23
|
+
= hidden_field_tag 'registry_shipping_address[street_2]', address.street_2, id: nil
|
24
|
+
= hidden_field_tag 'registry_shipping_address[city]', address.city, id: nil
|
25
|
+
= hidden_field_tag 'registry_shipping_address[country]', address.country, id: nil
|
26
|
+
= hidden_field_tag 'registry_shipping_address[region]', address.region, id: nil
|
27
|
+
= hidden_field_tag 'registry_shipping_address[postal_code]', address.postal_code, id: nil
|
28
|
+
= hidden_field_tag 'registry_shipping_address[phone_number]', address.phone_number, id: nil
|
@@ -0,0 +1 @@
|
|
1
|
+
%div{ data: { add_to_registry_button: '' } }
|
@@ -0,0 +1,39 @@
|
|
1
|
+
- @title = @page.browser_title
|
2
|
+
|
3
|
+
- add_css(@page.css)
|
4
|
+
- add_javascript(@page.javascript)
|
5
|
+
|
6
|
+
- content_for :head do
|
7
|
+
%meta{ property: 'global-id', content: @page.to_global_id.to_param }
|
8
|
+
|
9
|
+
%link{ href: "http://#{Workarea.config.host}", rel: 'canonical' }
|
10
|
+
- unless @page.meta_description.blank?
|
11
|
+
%meta{ name: :description, content: @page.meta_description }
|
12
|
+
|
13
|
+
%meta{ property: 'og:url', content: url_for(only_path: false) }
|
14
|
+
%meta{ property: 'og:title', content: page_title }
|
15
|
+
%meta{ property: 'og:type', content: 'website' }
|
16
|
+
%meta{ property: 'og:image', content: image_path('workarea/storefront/logo.png') }
|
17
|
+
|
18
|
+
.view
|
19
|
+
= render_content_blocks(@page.content_blocks) if @page.content_blocks.present?
|
20
|
+
|
21
|
+
.grid
|
22
|
+
.grid__cell.grid__cell--33-at-medium
|
23
|
+
.data-card.data-card--row
|
24
|
+
.data-card__cell
|
25
|
+
= link_to registry_search_path do
|
26
|
+
%h5.heading.heading--1= t('workarea.storefront.registries.index.find_link')
|
27
|
+
%p= t('workarea.storefront.registries.index.find')
|
28
|
+
.grid__cell.grid__cell--33-at-medium
|
29
|
+
.data-card.data-card--row
|
30
|
+
.data-card__cell
|
31
|
+
= link_to new_users_registry_path do
|
32
|
+
%h5.heading.heading--1= t('workarea.storefront.registries.index.create_link')
|
33
|
+
%p= t('workarea.storefront.registries.index.create')
|
34
|
+
.grid__cell.grid__cell--33-at-medium
|
35
|
+
.data-card.data-card--row
|
36
|
+
.data-card__cell
|
37
|
+
= link_to users_registries_path do
|
38
|
+
%h5.heading.heading--1= t('workarea.storefront.registries.index.manage_link')
|
39
|
+
%p= t('workarea.storefront.registries.index.manage')
|
@@ -0,0 +1,35 @@
|
|
1
|
+
- @title = t('workarea.storefront.registries.search_title')
|
2
|
+
|
3
|
+
- content_for :breadcrumbs do
|
4
|
+
%p.breadcrumbs__node-group
|
5
|
+
%span.breadcrumbs__node
|
6
|
+
= link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home'
|
7
|
+
%span.breadcrumbs__node
|
8
|
+
= link_to t('workarea.storefront.registries.registry_home'), registries_path
|
9
|
+
%span.breadcrumbs__node= t('workarea.storefront.registries.registry_search')
|
10
|
+
|
11
|
+
.view
|
12
|
+
|
13
|
+
%h1= t('workarea.storefront.registries.search.heading')
|
14
|
+
%p= t('workarea.storefront.registries.search_instructions')
|
15
|
+
|
16
|
+
- if params[:registry_query]
|
17
|
+
%h2= t('workarea.storefront.registries.results')
|
18
|
+
|
19
|
+
- unless @registries.present?
|
20
|
+
%p= t('workarea.storefront.searches.no_results', terms: params[:registry_query])
|
21
|
+
|
22
|
+
- else
|
23
|
+
%ol
|
24
|
+
- @registries.each do |registry|
|
25
|
+
%li= link_to registry.name, registry_path(registry)
|
26
|
+
|
27
|
+
%h2= t('workarea.storefront.searches.search_again')
|
28
|
+
|
29
|
+
= form_tag registry_search_path, method: 'get', id: 'find_registry_form' do
|
30
|
+
.property
|
31
|
+
= label_tag 'name_or_email', nil, class: 'property__name' do
|
32
|
+
%span.property__text= t('workarea.storefront.registries.name_or_email')
|
33
|
+
.value= text_field_tag :registry_query, params[:registry], id: 'name_or_email', class: 'text-box', required: true
|
34
|
+
|
35
|
+
%p= button_tag t('workarea.storefront.searches.search'), value: 'search', class: 'button'
|
@@ -0,0 +1,63 @@
|
|
1
|
+
- @title = t('workarea.storefront.registries.show_title', name: @registry.owner)
|
2
|
+
|
3
|
+
= render_schema_org(breadcrumb_list_schema([[t('workarea.storefront.layouts.home'), root_path], [t('workarea.storefront.registries.find_title'), registry_search_path], [@registry.name, registry_path(@registry)]]))
|
4
|
+
|
5
|
+
- content_for :breadcrumbs do
|
6
|
+
%p.breadcrumbs__node-group
|
7
|
+
%span.breadcrumbs__node
|
8
|
+
= link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home'
|
9
|
+
%span.breadcrumbs__node
|
10
|
+
= link_to t('workarea.storefront.registries.registry_search'), registry_search_path
|
11
|
+
%span.breadcrumbs__node= t('workarea.storefront.registries.show_title', name: @registry.owner)
|
12
|
+
|
13
|
+
.view
|
14
|
+
|
15
|
+
%h2= @registry.name
|
16
|
+
|
17
|
+
.registries__section
|
18
|
+
- if @registry.items.empty?
|
19
|
+
|
20
|
+
%p= t('workarea.storefront.registries.issues.nothing_to_purchase')
|
21
|
+
|
22
|
+
- else
|
23
|
+
|
24
|
+
%ul.product-list
|
25
|
+
- @registry.items.each do |item|
|
26
|
+
= render_schema_org(product_schema(item.product))
|
27
|
+
|
28
|
+
%li.product-list__item
|
29
|
+
.product-list__item-cell
|
30
|
+
.product-list__summary
|
31
|
+
%p.product-list__media= link_to image_tag(product_image_url(item.image, :small_thumb), alt: item.product_name, class: 'product-list__media-image'), product_url(item.product, sku: item.sku), class: 'product-list__media-link'
|
32
|
+
.product-list__info
|
33
|
+
%p.product-list__name= link_to item.product_name, product_path(item.product, sku: item.sku)
|
34
|
+
%p.product-list__id= item.sku_name
|
35
|
+
%p.product-list__inventory-status= item.inventory_status
|
36
|
+
- if item.has_options?
|
37
|
+
.product-list__option-group
|
38
|
+
- item.details.each do |name, value|
|
39
|
+
%p.product-list__option #{name.titleize}: #{value}
|
40
|
+
= form_tag cart_items_path, class: 'product-list__item-cell', data: { dialog_form: { dialogOptions: { closeAll: true, initModules: true } }, analytics: add_to_cart_analytics_data(item.product).to_json } do
|
41
|
+
= hidden_field_tag :product_id, item.product_id, id: nil
|
42
|
+
= hidden_field_tag :sku, item.sku, id: nil
|
43
|
+
= hidden_field_tag :registry_id, @registry.id, id: nil
|
44
|
+
%table.table
|
45
|
+
%thead
|
46
|
+
%tr
|
47
|
+
%th.table__prices= t('workarea.storefront.orders.price')
|
48
|
+
%th.table__quantity= t('workarea.storefront.orders.quantity')
|
49
|
+
%th.table__prices= t('workarea.storefront.orders.total')
|
50
|
+
%th.table__purchase
|
51
|
+
%tbody
|
52
|
+
%tr
|
53
|
+
%td.table__prices
|
54
|
+
%p.table__price
|
55
|
+
= render 'workarea/storefront/carts/pricing', item: item, css_block: 'table'
|
56
|
+
%td.table__quantity
|
57
|
+
.value= number_field_tag :quantity, 1, class: 'text-box text-box--x-small', min: 1, id: nil
|
58
|
+
%p= t('workarea.storefront.registries.requested', quantity: item.quantity - item.received)
|
59
|
+
%td.table__prices
|
60
|
+
%p.table__price
|
61
|
+
%span= number_to_currency(item.total_price)
|
62
|
+
%td.table__purchase
|
63
|
+
%p= button_tag t('workarea.storefront.products.add_to_cart'), class: 'button'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
= append_partials('storefront.registry_creation_mailer.top')
|
2
|
+
|
3
|
+
- content_for :preheader_text do
|
4
|
+
= @content
|
5
|
+
|
6
|
+
%tr
|
7
|
+
%td
|
8
|
+
%p= t('workarea.storefront.email.registries.creation.heading', registry_name: @registry.name)
|
9
|
+
= @content
|
10
|
+
%p
|
11
|
+
= link_to users_registry_url(@registry), users_registry_url(@registry)
|
12
|
+
|
13
|
+
= append_partials('storefront.registry_creation_mailer.bottom')
|
@@ -0,0 +1,51 @@
|
|
1
|
+
= append_partials('storefront.registry_gift_receipt_mailer.top')
|
2
|
+
|
3
|
+
- content_for :preheader_text do
|
4
|
+
= @content
|
5
|
+
|
6
|
+
%tr
|
7
|
+
%td
|
8
|
+
%p= t('workarea.storefront.email.registries.gift_receipt.heading', order_id: @order.id)
|
9
|
+
= @content
|
10
|
+
|
11
|
+
%tr
|
12
|
+
%td
|
13
|
+
%table.product-grid
|
14
|
+
- @order.items.each_slice(4) do |item_row|
|
15
|
+
%tr
|
16
|
+
- item_row.each do |item|
|
17
|
+
%td.stack-column-center
|
18
|
+
%table.product-grid__product{ role: 'presentation', width: '100%' }
|
19
|
+
%tr
|
20
|
+
%td.product-grid__image
|
21
|
+
= link_to product_url(item.product, sku: item.sku), class: 'product-grid__link' do
|
22
|
+
= image_tag(product_image_url(item.product.primary_image, :medium_thumb), alt: item.product_name)
|
23
|
+
%tr
|
24
|
+
%td.product-grid__info
|
25
|
+
= link_to product_url(item.product, sku: item.sku), class: 'product-grid__link' do
|
26
|
+
.product-grid__name= item.product_name
|
27
|
+
= item.sku
|
28
|
+
|
29
|
+
%tr
|
30
|
+
%td
|
31
|
+
%table
|
32
|
+
- item.details.each do |name, value|
|
33
|
+
%tr
|
34
|
+
%td.align-left
|
35
|
+
%strong= "#{name.titleize}:"
|
36
|
+
%td.align-right= value
|
37
|
+
|
38
|
+
- item.customizations.each do |name, value|
|
39
|
+
%tr
|
40
|
+
%td.align-left
|
41
|
+
%strong= "#{name.titleize}:"
|
42
|
+
%td.align-right= value
|
43
|
+
|
44
|
+
%tr
|
45
|
+
%td.align-left
|
46
|
+
%strong= t('workarea.storefront.orders.quantity')
|
47
|
+
%td.align-right= item.quantity
|
48
|
+
|
49
|
+
= append_partials('storefront.order_mailer_summary_order_details', item: item)
|
50
|
+
|
51
|
+
= append_partials('storefront.registry_gift_receipt_mailer.bottom')
|
@@ -0,0 +1,21 @@
|
|
1
|
+
= append_partials('storefront.registry_share_mailer.top')
|
2
|
+
|
3
|
+
- content_for :preheader_text do
|
4
|
+
= @content
|
5
|
+
|
6
|
+
%tr
|
7
|
+
%td
|
8
|
+
%h1= @content
|
9
|
+
%p
|
10
|
+
%strong= @share.from
|
11
|
+
%p= t('workarea.storefront.email.registries.share.from_info')
|
12
|
+
|
13
|
+
%p= link_to @share.registry_name, path_to_url(@share.url)
|
14
|
+
|
15
|
+
- if @share.message.present?
|
16
|
+
%p
|
17
|
+
%strong #{@share.from} #{t('workarea.storefront.email.share.from_message_html')}
|
18
|
+
%p= @share.message
|
19
|
+
|
20
|
+
|
21
|
+
= append_partials('storefront.registry_share_mailer.bottom')
|
@@ -0,0 +1,19 @@
|
|
1
|
+
= append_partials('storefront.registry_thank_mailer.top')
|
2
|
+
|
3
|
+
- content_for :preheader_text do
|
4
|
+
= @content
|
5
|
+
|
6
|
+
%tr
|
7
|
+
%td
|
8
|
+
%h1= @content
|
9
|
+
%p
|
10
|
+
%strong= @thank.from
|
11
|
+
%p= t('workarea.storefront.email.thank.thank_you')
|
12
|
+
|
13
|
+
- if @thank.message.present?
|
14
|
+
%p
|
15
|
+
%strong #{@thank.from} #{t('workarea.storefront.email.thank.from_message_html')}
|
16
|
+
%p= @thank.message
|
17
|
+
|
18
|
+
|
19
|
+
= append_partials('storefront.registry_thank_mailer.bottom')
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#registries-summary.box
|
2
|
+
.box__header
|
3
|
+
.box__action= link_to t('workarea.storefront.registries.create'), new_users_registry_path, data: { dialog_button: '' }, class: 'button'
|
4
|
+
%h2.box__heading= t('workarea.storefront.registries.title')
|
5
|
+
.box__body
|
6
|
+
- unless @user.registries.any?
|
7
|
+
%p
|
8
|
+
= t('workarea.storefront.registries.none')
|
9
|
+
- else
|
10
|
+
- @user.registries.take(3).each do |registry|
|
11
|
+
= render 'workarea/storefront/users/registries/summary', registry: registry
|
12
|
+
- if @user.registries.size > 3
|
13
|
+
%p
|
14
|
+
= link_to t('workarea.storefront.registries.view_all'), users_registries_path, class: 'button'
|
@@ -0,0 +1,56 @@
|
|
1
|
+
- if registry.errors.any?
|
2
|
+
- registry.errors.full_messages.each do |message|
|
3
|
+
= render_message 'error', message, data: { analytics: validation_error_analytics_data('registries').to_json }
|
4
|
+
|
5
|
+
= form_tag send(action, registry), method: method, id: 'registry_form' do
|
6
|
+
= hidden_field_tag :return_to, users_account_path, id: nil
|
7
|
+
= hidden_field_tag 'registry[user_id]', current_user.id, id: nil
|
8
|
+
|
9
|
+
.property
|
10
|
+
= label_tag 'registry[name]', nil, class: 'property__name' do
|
11
|
+
%span.property__text= t('workarea.storefront.registries.name')
|
12
|
+
%span.property__requirement.property__requirement--required= t('workarea.storefront.forms.required')
|
13
|
+
.value= text_field_tag 'registry[name]', @registry.name, required: true, class: 'text-box'
|
14
|
+
|
15
|
+
.property
|
16
|
+
= label_tag 'registry[email]', nil, class: 'property__name' do
|
17
|
+
%span.property__text= t('workarea.storefront.registries.email')
|
18
|
+
%span.property__requirement.property__requirement--required= t('workarea.storefront.forms.required')
|
19
|
+
.value= email_field_tag 'registry[email]', @registry.email, required: true, class: 'text-box', autocomplete: 'off'
|
20
|
+
|
21
|
+
.property
|
22
|
+
= label_tag 'registry[description]', nil, class: 'property__name' do
|
23
|
+
%span.property__text= t('workarea.storefront.registries.description')
|
24
|
+
.value= text_field_tag 'registry[description]', @registry.description, class: 'text-box', autocomplete: 'off', maxlength: 80
|
25
|
+
|
26
|
+
%fieldset
|
27
|
+
%legend
|
28
|
+
%span.heading.heading--2= t('workarea.storefront.registries.privacy_settings')
|
29
|
+
.property-group
|
30
|
+
.grid
|
31
|
+
.grid__cell.grid__cell--33-at-medium
|
32
|
+
.property
|
33
|
+
= label_tag 'registry[privacy]', nil, class: 'property__name' do
|
34
|
+
%span.button-property__text= t('workarea.storefront.registries.public_privacy')
|
35
|
+
.value= radio_button_tag 'registry[privacy]', 'public', @registry.default_privacy?
|
36
|
+
.grid__cell.grid__cell--33-at-medium
|
37
|
+
.property
|
38
|
+
= label_tag 'registry[privacy]', nil, class: 'property__name' do
|
39
|
+
%span.button-property__text= t('workarea.storefront.registries.shared_privacy')
|
40
|
+
.value= radio_button_tag 'registry[privacy]', 'shared', @registry.shared?
|
41
|
+
.grid__cell.grid__cell--33-at-medium
|
42
|
+
.property
|
43
|
+
= label_tag 'registry[privacy]', nil, class: 'property__name' do
|
44
|
+
%span.button-property__text= t('workarea.storefront.registries.private_privacy')
|
45
|
+
.value= radio_button_tag 'registry[privacy]', 'private', @registry.private?
|
46
|
+
|
47
|
+
.checkout-addresses__fields= render 'workarea/storefront/shared/address_fields', label: 'registry_address', address: @registry.address
|
48
|
+
|
49
|
+
.property
|
50
|
+
= label_tag 'registry[event_date]', nil, class: 'property__name' do
|
51
|
+
%span.property__text= t('workarea.storefront.registries.event_date')
|
52
|
+
.value= date_field_tag 'registry[event_date]', @registry.event_date, min: (Time.current + 1.day).to_date, pattern: '\d{4}-\d{2}-\d{2}', placeholder: 'yyyy-mm-dd', class: 'text-box'
|
53
|
+
|
54
|
+
.grid.grid--auto.grid--middle
|
55
|
+
.grid__cell= button_tag t('workarea.storefront.forms.save'), value: 'save_registry', class: 'button'
|
56
|
+
.grid__cell= link_to t('workarea.storefront.forms.cancel'), users_account_path, class: 'text-button', data: { dialog_close_button: '' }
|