spree_backend 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d62e3e74918cc0fb8fd2a44ffa6607f6d7a287572cbe9babf81f47882ce8a3d0
4
- data.tar.gz: cca019c472ef786fe7d706eaae189dede52524fa2d26c4fc2f2e33b9cced1a05
3
+ metadata.gz: d04215d2de0a86fa11317efd09b3c254427e4c75f164edf7b30025fd8b51a952
4
+ data.tar.gz: b44803c8f02239ec8822a301005db2d30929d847d7cf77fd3ba3b52a2d661a57
5
5
  SHA512:
6
- metadata.gz: 58083d7dd7588a54b3d872d77f389ad21136274cb96cbb14994bd7a81c7919a3edc6c49d525afb73029a55ef89aec8c5b157568113acaea3691791679f2525a4
7
- data.tar.gz: 63bac296530375223bd8523ce427d0145ebc6296389c9e5f894919da6df0107d41981bc84f4510556e139394f207a8428453da91b49501e577f8d740170e2bef
6
+ metadata.gz: 632f08517f0870c060a3d240e893b1ef2fff52ec6f79ecece0b4e4a9ea4dd2d3ef422f04aa695ae8594867dab34f5711bb233c41693f4f3bc7a62d3e040e53c4
7
+ data.tar.gz: 68b50bd16165b000965318cd54fb5a4590d7270d64687e751714223947d87494c201a226b0a43e357327e8e1bb8ed7d250b16f77c78989002f69691f7265ea58
@@ -8,3 +8,10 @@ Handlebars.registerHelper('t', function (key) {
8
8
  Handlebars.registerHelper('edit_product_url', function (productId) {
9
9
  return Spree.routes.edit_product(productId)
10
10
  })
11
+ Handlebars.registerHelper('name_or_presentation', function (optionValue) {
12
+ if (optionValue.name === 'color') {
13
+ return optionValue.name
14
+ } else {
15
+ return optionValue.presentation
16
+ }
17
+ })
@@ -150,12 +150,24 @@ module Spree
150
150
  end
151
151
 
152
152
  def order_time(time)
153
+ return '' if time.blank?
154
+
153
155
  [I18n.l(time.to_date), time.strftime('%l:%M %p').strip].join(' ')
154
156
  end
155
157
 
156
158
  def required_span_tag
157
159
  content_tag(:span, ' *', class: 'required')
158
160
  end
161
+
162
+ def product_preview_link(product)
163
+ return unless frontend_available?
164
+
165
+ button_link_to(
166
+ Spree.t(:preview_product),
167
+ spree.product_url(product),
168
+ class: 'btn-outline-secondary', icon: 'eye-open', id: 'admin_preview_product', target: :blank
169
+ )
170
+ end
159
171
  end
160
172
  end
161
173
  end
@@ -1,6 +1,10 @@
1
1
  <%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :images } %>
2
2
 
3
3
  <% content_for :page_actions do %>
4
+ <div class="page-actions col-6 pr-0" data-hook="toolbar">
5
+ <%= yield :page_actions %>
6
+ </div>
7
+ <%= product_preview_link(@product) %>
4
8
  <%= button_link_to(Spree.t(:new_image), spree.new_admin_product_image_url(@product), { class: "btn-success", icon: 'add', id: 'new_image_link' }) if can? :create, Spree::Image %>
5
9
  <% end %>
6
10
 
@@ -20,10 +20,10 @@
20
20
  <% order.line_items.each do |item| %>
21
21
  <tr class="line-item" id="line-item-<%= item.id %>">
22
22
  <td class="line-item-image image text-center">
23
- <%= mini_image(item.variant) %>
23
+ <%= link_to mini_image(item.variant), edit_admin_product_path(item.variant.product) %>
24
24
  </td>
25
25
  <td class="line-item-name text-center">
26
- <%= item.name %>
26
+ <%= link_to item.name, edit_admin_product_path(item.variant.product) %>
27
27
  <br />
28
28
  <%= "(#{item.options_text})" if item.options_text.present? %>
29
29
  </td>
@@ -1,11 +1,11 @@
1
1
  <% shipment.manifest.each do |item| %>
2
2
  <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
3
3
  <td class="item-image image text-center">
4
- <%= mini_image(item.variant) %>
4
+ <%= link_to mini_image(item.variant), edit_admin_product_path(item.variant.product) %>
5
5
  </td>
6
6
 
7
7
  <td class="item-name">
8
- <%= item.variant.product.name %>
8
+ <%= link_to item.variant.product.name, edit_admin_product_path(item.variant.product) %>
9
9
  <br />
10
10
  <%= "(#{item.variant.options_text})" if item.variant.options_text.present? %>
11
11
  <% if item.variant.sku.present? %>
@@ -2,6 +2,8 @@
2
2
  <%= render 'spree/admin/shared/error_messages', target: @product %>
3
3
 
4
4
  <% content_for :page_actions do %>
5
+ <%= product_preview_link(@product) %>
6
+
5
7
  <%= button_link_to(
6
8
  Spree.t(:add_product_properties),
7
9
  "javascript:;",
@@ -3,6 +3,9 @@
3
3
  <%= Spree.t(:add_stock) %>
4
4
  </h1>
5
5
  </div>
6
+ <% content_for :page_actions do %>
7
+ <%= product_preview_link(@product) %>
8
+ <% end %>
6
9
  <div class="card-body">
7
10
  <%= form_for [:admin, Spree::StockMovement.new], url: admin_stock_items_path do |f| %>
8
11
  <div data-hook="admin_stock_movements_form_fields" class="row">
@@ -1,7 +1,5 @@
1
1
  <% content_for :page_actions do %>
2
- <% if frontend_available? %>
3
- <%= button_link_to Spree.t(:preview_product), product_url(@product), { class: "btn-outline-secondary", icon: 'eye-open', id: 'admin_preview_product', target: :_blank } %>
4
- <% end %>
2
+ <%= product_preview_link(@product) %>
5
3
  <% if can?(:create, Spree::Product) %>
6
4
  <%= button_link_to Spree.t(:new_product), new_object_url, { class: "btn-success", icon: 'add', id: 'admin_new_product' } %>
7
5
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <div class="content-header <%= "with-page-tabs" if content_for?(:page_tabs) %> page-header">
3
3
  <div class="row align-items-center <%= if content_for?(:page_tabs) then "pb-0" else "border-bottom" end %> mb-4">
4
4
  <% if content_for?(:page_title) %>
5
- <h1 class="h4 pl-0 mb-0 col-<%= content_for?(:page_actions) ? '6' : '12' %>">
5
+ <h1 class="h4 pl-0 mb-0 col-<%= content_for?(:page_actions) ? '5' : '12' %>">
6
6
  <%= yield :page_title %>
7
7
  <% if content_for?(:page_title_small) %>
8
8
  <small><%= yield :page_title_small %></small>
@@ -11,7 +11,7 @@
11
11
  <% end %>
12
12
 
13
13
  <% if content_for?(:page_actions) %>
14
- <div class="page-actions col-6 pr-0" data-hook="toolbar">
14
+ <div class="page-actions col-7 pr-0" data-hook="toolbar">
15
15
  <%= yield :page_actions %>
16
16
  </div>
17
17
  <% end %>
@@ -12,7 +12,7 @@
12
12
  <h5 class="variant-name media-heading h6 mb-0">{{variant.name}}</h5>
13
13
  {{#if variant.option_values}}
14
14
  {{#each variant.option_values}}
15
- <strong>{{this.option_type_presentation}}:</strong> {{this.presentation}}<br/>
15
+ <strong>{{this.option_type_presentation}}:</strong> {{name_or_presentation this}}<br/>
16
16
  {{/each}}
17
17
  {{/if}}
18
18
  <strong><%= Spree.t(:sku) %>:</strong> {{variant.sku}}
@@ -4,8 +4,13 @@
4
4
  <% @product.option_types.each do |option_type| %>
5
5
  <div class="form-group" data-hook="presentation">
6
6
  <%= label :new_variant, option_type.presentation %>
7
- <%= f.collection_select 'option_value_ids', option_type.option_values, :id, :presentation,
8
- { include_blank: true }, { name: 'variant[option_value_ids][]', class: 'select2' } %>
7
+ <% if option_type.name == 'color' %>
8
+ <%= f.collection_select 'option_value_ids', option_type.option_values, :id, :name,
9
+ { include_blank: true }, { name: 'variant[option_value_ids][]', class: 'select2' } %>
10
+ <% else %>
11
+ <%= f.collection_select 'option_value_ids', option_type.option_values, :id, :presentation,
12
+ { include_blank: true }, { name: 'variant[option_value_ids][]', class: 'select2' } %>
13
+ <% end %>
9
14
  </div>
10
15
  <% end %>
11
16
 
@@ -59,6 +59,7 @@
59
59
  <% end %>
60
60
  <% else %>
61
61
  <% content_for :page_actions do %>
62
+ <%= product_preview_link(@product) %>
62
63
  <%= button_link_to(Spree.t(:new_variant), spree.new_admin_product_variant_url(@product), { icon: 'add', :'data-update' => 'new_variant', class: 'btn-success', id: 'new_var_link' }) if can? :create, Spree::Variant %>
63
64
  <%= button_link_to (@deleted.blank? ? Spree.t(:show_deleted) : Spree.t(:show_active)), spree.admin_product_variants_url(@product, deleted: @deleted.blank? ? "on" : "off"), { class: 'btn-outline-secondary', icon: 'filter' } %>
64
65
  <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2020-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0
19
+ version: 4.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.0
26
+ version: 4.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.0
33
+ version: 4.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.1.0
40
+ version: 4.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap
43
43
  requirement: !ruby/object:Gem::Requirement