spree_admin 5.1.0.rc1 → 5.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 +4 -4
- data/app/assets/stylesheets/spree/admin/shared/_base.scss +2 -6
- data/app/controllers/spree/admin/orders_controller.rb +6 -1
- data/app/controllers/spree/admin/translations_controller.rb +31 -25
- data/app/helpers/spree/admin/base_helper.rb +0 -4
- data/app/javascript/spree/admin/controllers/calendar_range_controller.js +1 -0
- data/app/views/spree/admin/option_types/edit.html.erb +4 -0
- data/app/views/spree/admin/products/form/_base.html.erb +1 -1
- data/app/views/spree/admin/properties/_property.html.erb +2 -2
- data/app/views/spree/admin/properties/edit.html.erb +3 -0
- data/app/views/spree/admin/shared/_head.html.erb +1 -0
- data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +1 -1
- data/app/views/spree/admin/storefront/edit.html.erb +1 -1
- data/app/views/spree/admin/stores/form/_basic.html.erb +3 -3
- data/app/views/spree/admin/translations/edit.html.erb +37 -29
- data/app/views/spree/admin/translations/option_types/_form.html.erb +21 -0
- data/app/views/spree/admin/translations/products/_form.html.erb +9 -20
- data/app/views/spree/admin/translations/properties/_form.html.erb +5 -0
- data/app/views/spree/admin/translations/stores/_form.html.erb +11 -22
- data/app/views/spree/admin/translations/taxonomies/_form.html.erb +3 -18
- data/app/views/spree/admin/translations/taxons/_form.html.erb +11 -34
- data/app/views/spree/admin/translations/translation_rows/_permalink_field_row.html.erb +33 -0
- data/app/views/spree/admin/translations/translation_rows/_rich_textarea_row.html.erb +13 -0
- data/app/views/spree/admin/translations/translation_rows/_text_field_row.html.erb +7 -0
- data/app/views/spree/admin/translations/translation_rows/_textarea_row.html.erb +11 -0
- data/app/views/spree/admin/translations/translation_rows/_tinymce_row.html.erb +13 -0
- data/app/views/spree/admin/variants/form/_inventory.html.erb +12 -2
- data/lib/spree/admin/testing_support/capybara_utils.rb +0 -4
- metadata +15 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccc54cd595d9baf8f9e0f76c71b4682977fcac768b4ac6f5fe911fdd24c5d373
|
4
|
+
data.tar.gz: 969cf056d3745ae281b89421893ccef0ade5f41bcabacd5bc81254cc8404aa7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dbf7da3b5c957af7f63e69425516a4ecf45901cba3364db52356e63d00ced386a9031863025c67a68a5519d93ad904a1f6af4c2facd6ef4544e8c8104733846
|
7
|
+
data.tar.gz: bc6c07589f1aef8e58de7c5f025f98155cfa65a7bc6f0db41661ccd156cebf46d1134ff37192cbe9df8d77b66292ff7e0e6f21e0b3b205039f7098b25b38a2d6
|
@@ -86,8 +86,8 @@ strong {
|
|
86
86
|
.w-15 {
|
87
87
|
width: 15%;
|
88
88
|
}
|
89
|
-
.w-
|
90
|
-
width:
|
89
|
+
.w-20 {
|
90
|
+
width: 20%;
|
91
91
|
}
|
92
92
|
.w-25 {
|
93
93
|
width: 25%;
|
@@ -322,10 +322,6 @@ small,
|
|
322
322
|
|
323
323
|
// tailwind matchers
|
324
324
|
|
325
|
-
.w-20 {
|
326
|
-
width: 20%;
|
327
|
-
}
|
328
|
-
|
329
325
|
.gap-1 {
|
330
326
|
gap: calc($spacer / 4);
|
331
327
|
}
|
@@ -10,7 +10,7 @@ module Spree
|
|
10
10
|
before_action :load_order_items, only: :edit
|
11
11
|
before_action :load_user, only: [:index]
|
12
12
|
|
13
|
-
helper_method :model_class
|
13
|
+
helper_method :model_class, :object_url
|
14
14
|
|
15
15
|
# POST /admin/orders
|
16
16
|
def create
|
@@ -108,6 +108,11 @@ module Spree
|
|
108
108
|
def model_class
|
109
109
|
Spree::Order
|
110
110
|
end
|
111
|
+
|
112
|
+
# needed to show the delete button in the content header
|
113
|
+
def object_url
|
114
|
+
spree.admin_order_path(@order)
|
115
|
+
end
|
111
116
|
end
|
112
117
|
end
|
113
118
|
end
|
@@ -8,13 +8,7 @@ module Spree
|
|
8
8
|
def edit; end
|
9
9
|
|
10
10
|
def update
|
11
|
-
|
12
|
-
translations[@selected_translation_locale]
|
13
|
-
end
|
14
|
-
|
15
|
-
Mobility.with_locale(@selected_translation_locale) do
|
16
|
-
@resource.update!(locale_translation_params)
|
17
|
-
end
|
11
|
+
@resource.update!(permitted_translation_params)
|
18
12
|
|
19
13
|
flash[:success] = Spree.t('notice_messages.translations_saved')
|
20
14
|
|
@@ -28,11 +22,20 @@ module Spree
|
|
28
22
|
private
|
29
23
|
|
30
24
|
def permitted_translation_params
|
31
|
-
params.require(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
25
|
+
params.require(@resource.model_name.param_key).permit(translation_fields(resource_class), **nested_params)
|
26
|
+
end
|
27
|
+
|
28
|
+
def nested_params
|
29
|
+
case resource_class.to_s
|
30
|
+
when 'Spree::OptionType'
|
31
|
+
{ option_values_attributes: [ :id, *translation_fields(Spree::OptionValue)] }
|
32
|
+
else
|
33
|
+
{}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def translation_fields(klass)
|
38
|
+
klass.translatable_fields.map { |field| "#{field}_#{@selected_translation_locale}" }
|
36
39
|
end
|
37
40
|
|
38
41
|
def resource_class
|
@@ -61,20 +64,23 @@ module Spree
|
|
61
64
|
|
62
65
|
def load_data
|
63
66
|
@locales = (current_store.supported_locales_list - [@default_locale]).sort
|
67
|
+
@resource_name = @resource.try(:name)
|
64
68
|
|
65
|
-
case @resource
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
69
|
+
@back_path = case @resource.class.name
|
70
|
+
when 'Spree::OptionType'
|
71
|
+
spree.edit_admin_option_type_path(@resource)
|
72
|
+
when 'Spree::Product'
|
73
|
+
spree.edit_admin_product_path(@resource)
|
74
|
+
when 'Spree::Property'
|
75
|
+
spree.edit_admin_property_path(@resource)
|
76
|
+
when 'Spree::Store'
|
77
|
+
spree.edit_admin_store_path(section: "general-settings")
|
78
|
+
when 'Spree::Taxon'
|
79
|
+
spree.edit_admin_taxonomy_taxon_path(@resource.taxonomy, @resource.id)
|
80
|
+
when 'Spree::Taxonomy'
|
81
|
+
spree.admin_taxonomy_path(@resource)
|
82
|
+
else
|
83
|
+
[:edit, :admin, @resource]
|
78
84
|
end
|
79
85
|
end
|
80
86
|
end
|
@@ -3,6 +3,10 @@
|
|
3
3
|
<%= @option_type.presentation %>
|
4
4
|
<% end %>
|
5
5
|
|
6
|
+
<% content_for :page_actions_dropdown do %>
|
7
|
+
<%= link_to_edit_translations(@option_type) %>
|
8
|
+
<% end %>
|
9
|
+
|
6
10
|
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @option_type } %>
|
7
11
|
|
8
12
|
<%= form_for [:admin, @option_type], data: { controller: 'nested-form', nested_form_wrapper_selector_value: '.nested-form-wrapper' } do |f| %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<div class="form-group mb-0">
|
10
10
|
<%= f.label :description, Spree.t(:description) %>
|
11
|
-
<div class="
|
11
|
+
<div class="trix-container mb-0">
|
12
12
|
<%= f.text_area :description, { rows: 10, class: "form-control spree-rte", data: { seo_form_target: 'sourceDescriptionInput' } } %>
|
13
13
|
</div>
|
14
14
|
</div>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= icon('grip-vertical', class: 'rounded hover-gray p-2') %>
|
4
4
|
</td>
|
5
5
|
<td class="w-20 cursor-pointer py-0" data-action="click->row-link#openLink">
|
6
|
-
<code><%= property.name %></
|
6
|
+
<code><%= property.name %></code>
|
7
7
|
</td>
|
8
8
|
<td class="w-20 cursor-pointer" data-action="click->row-link#openLink">
|
9
9
|
<%= link_to property.presentation, spree.edit_admin_property_path(property), class: 'text-decoration-none d-flex align-items-center font-weight-bold text-dark', data: { row_link_target: :link } %>
|
@@ -22,4 +22,4 @@
|
|
22
22
|
<td class="w-10 actions">
|
23
23
|
<%= link_to_edit(property, class: 'btn btn-light btn-sm') if can?(:edit, property) %>
|
24
24
|
</td>
|
25
|
-
</tr>
|
25
|
+
</tr>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<% end %>
|
27
27
|
</div>
|
28
28
|
|
29
|
-
<div class="d-flex align-items-center px-3 ml-3">
|
29
|
+
<div class="d-flex align-items-center px-3 ml-3 gap-2">
|
30
30
|
<%= link_to_edit(taxon, url: spree.edit_admin_taxonomy_taxon_path(taxonomy, taxon.id), data: { row_link_target: :link }) if can?(:edit, taxon) %>
|
31
31
|
|
32
32
|
<div class="dropdown h-100">
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<%= content_for(:page_actions) do %>
|
10
|
-
<%= link_to_edit_translations(@store
|
10
|
+
<%= link_to_edit_translations(@store) %>
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @store }, class: 'mb-5 pb-5' %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<%= Spree.t(:store_details) %>
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
<%= content_for(:
|
6
|
-
<%= link_to_edit_translations(@store
|
5
|
+
<%= content_for(:page_actions_dropdown) do %>
|
6
|
+
<%= link_to_edit_translations(@store) %>
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<div class="row">
|
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
<div class="form-group">
|
45
45
|
<%= f.label :address, Spree.t(:address) %>
|
46
|
-
<%= f.text_area :address, class: 'form-control', data: { controller: 'textarea-autogrow' } %>
|
46
|
+
<%= f.text_area :address, rows: 5, class: 'form-control', data: { controller: 'textarea-autogrow' } %>
|
47
47
|
</div>
|
48
48
|
</div>
|
49
49
|
</div>
|
@@ -4,42 +4,50 @@
|
|
4
4
|
<% end %>
|
5
5
|
<% if @locales.any?%>
|
6
6
|
<% if @locales.many? %>
|
7
|
-
<%= form_with url: spree.edit_admin_translation_path(@resource, resource_type: @resource.class.to_s), class: "w-100 d-flex justify-content-end", data: { controller: 'auto-submit', turbo_frame: 'translations_table'}, method: :get do |f| %>
|
7
|
+
<%= form_with url: spree.edit_admin_translation_path(@resource, resource_type: @resource.class.to_s), class: "w-100 d-flex justify-content-end mb-3", data: { controller: 'auto-submit', turbo_frame: 'translations_table'}, method: :get do |f| %>
|
8
8
|
<div class="form-inline gap-2">
|
9
9
|
<%= f.label :translation_locale, Spree.t(:language) %>
|
10
10
|
<%= f.select :translation_locale, options_for_select(@locales.map { |locale| [Spree.t('i18n.this_file_language', locale: locale), locale] }, @selected_translation_locale), {}, { class: 'custom-select', data: { action: 'change->auto-submit#submit' } } %>
|
11
11
|
</div>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
|
-
<%= form_with url: spree.admin_translation_path(@resource, resource_type: @resource.class.to_s), method: :put, class: 'form-horizontal' do |f| %>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<
|
20
|
-
<
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
14
|
+
<%= form_with model: @resource, url: spree.admin_translation_path(@resource, resource_type: @resource.class.to_s), method: :put, class: 'form-horizontal' do |f| %>
|
15
|
+
<div class="card mb-4">
|
16
|
+
<div class="card-body p-0">
|
17
|
+
<%= turbo_frame_tag :translations_table, refresh: "morph" do %>
|
18
|
+
<%= hidden_field_tag :translation_locale, @selected_translation_locale %>
|
19
|
+
<table class="table">
|
20
|
+
<thead>
|
21
|
+
<tr>
|
22
|
+
<th scope="col" class="w-10"><%= Spree.t(:field) %></th>
|
23
|
+
<th scope="col" class="w-40"><%= Spree.t('i18n.this_file_language', locale: @default_locale) %> (<%= Spree.t(:default) %>)</th>
|
24
|
+
<th scope="col" class="w-50"><%= Spree.t('i18n.this_file_language', locale: @selected_translation_locale) %></th>
|
25
|
+
</tr>
|
26
|
+
</thead>
|
27
|
+
<tbody>
|
28
|
+
<% options = { f: f, resource: @resource, locale: @selected_translation_locale } %>
|
29
|
+
<% case @resource.class.name %>
|
30
|
+
<% when 'Spree::OptionType' %>
|
31
|
+
<%= render 'spree/admin/translations/option_types/form', options %>
|
32
|
+
<% when 'Spree::Product' %>
|
33
|
+
<%= render 'spree/admin/translations/products/form', options %>
|
34
|
+
<% when 'Spree::Property' %>
|
35
|
+
<%= render 'spree/admin/translations/properties/form', options %>
|
36
|
+
<% when 'Spree::Store' %>
|
37
|
+
<%= render 'spree/admin/translations/stores/form', options %>
|
38
|
+
<% when 'Spree::Taxon' %>
|
39
|
+
<%= render 'spree/admin/translations/taxons/form', options %>
|
40
|
+
<% when 'Spree::Taxonomy' %>
|
41
|
+
<%= render 'spree/admin/translations/taxonomies/form', options %>
|
42
|
+
<% end %>
|
43
|
+
</tbody>
|
44
|
+
</table>
|
45
|
+
<% end %>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
<div class="form-actions d-flex justify-content-between">
|
41
49
|
<%= turbo_save_button_tag Spree.t('actions.update') %>
|
42
|
-
<%= link_to Spree.t('actions.
|
50
|
+
<%= link_to Spree.t('actions.discard'), @back_path, class: 'btn btn-light', data: { turbo_frame: '_top' } %>
|
43
51
|
</div>
|
44
52
|
<% end %>
|
45
53
|
<% else %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%# locals: (f:, resource:, locale:) %>
|
2
|
+
|
3
|
+
<% resource.class.translatable_fields.each do |field| %>
|
4
|
+
<%= render "spree/admin/translations/translation_rows/text_field_row", f: f, field: field, locale: locale %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<% if resource.option_values.any? %>
|
8
|
+
<tr class="bg-light">
|
9
|
+
<th colspan="3"><%= Spree.t(:option_values) %></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<%= f.fields_for :option_values do |ff| %>
|
13
|
+
<% ff.object.class.translatable_fields.each do |field| %>
|
14
|
+
<tr>
|
15
|
+
<td><%= Spree.t(field) %></td>
|
16
|
+
<td><%= ff.object.send(field) %></td>
|
17
|
+
<td><%= ff.text_field "#{field}_#{locale}", class: 'form-control' %></td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
@@ -1,23 +1,12 @@
|
|
1
|
+
<%# locals: (f:, resource:, locale:) %>
|
2
|
+
|
1
3
|
<% resource.class.translatable_fields.each do |field| %>
|
2
|
-
<%
|
3
|
-
|
4
|
+
<% case field%>
|
5
|
+
<% when :description %>
|
6
|
+
<%= render "spree/admin/translations/translation_rows/tinymce_row", f: f, field: field, locale: locale %>
|
7
|
+
<% when :meta_description %>
|
8
|
+
<%= render "spree/admin/translations/translation_rows/textarea_row", f: f, field: field, locale: locale %>
|
9
|
+
<% else %>
|
10
|
+
<%= render "spree/admin/translations/translation_rows/text_field_row", f: f, field: field, locale: locale %>
|
4
11
|
<% end %>
|
5
|
-
<tr>
|
6
|
-
<td class="text-left">
|
7
|
-
<%= Spree.t(field) %>
|
8
|
-
</td>
|
9
|
-
<% [@default_locale, selected_translation_locale].each do |translation_locale| %>
|
10
|
-
<% readonly = translation_locale == @default_locale %>
|
11
|
-
<td <% if readonly %>style="width: 40%;"<% else %>style="width: 60%;"<% end %>>
|
12
|
-
<% case field%>
|
13
|
-
<% when :description %>
|
14
|
-
<div class="border rounded mb-0">
|
15
|
-
<%= text_area_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), { rows: 10, class: "form-control spree-rte", readonly: readonly, contenteditable: !readonly } %>
|
16
|
-
</div>
|
17
|
-
<% else %>
|
18
|
-
<%= text_field_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), class: 'form-control', readonly: readonly %>
|
19
|
-
<% end %>
|
20
|
-
</td>
|
21
|
-
<% end %>
|
22
|
-
</tr>
|
23
12
|
<% end %>
|
@@ -1,25 +1,14 @@
|
|
1
|
+
<%# locals: (f:, resource:, locale:) %>
|
2
|
+
|
1
3
|
<% resource.class.translatable_fields.each do |field| %>
|
2
|
-
<% if field == :meta_keywords %>
|
3
|
-
|
4
|
+
<% next if field == :meta_keywords %>
|
5
|
+
|
6
|
+
<% case field %>
|
7
|
+
<% when :description %>
|
8
|
+
<%= render "spree/admin/translations/translation_rows/rich_textarea_row", f: f, field: field, locale: locale %>
|
9
|
+
<% when :address, :meta_description %>
|
10
|
+
<%= render "spree/admin/translations/translation_rows/textarea_row", f: f, field: field, locale: locale %>
|
11
|
+
<% else %>
|
12
|
+
<%= render "spree/admin/translations/translation_rows/text_field_row", f: f, field: field, locale: locale %>
|
4
13
|
<% end %>
|
5
|
-
<tr>
|
6
|
-
<td class="text-left">
|
7
|
-
<%= Spree.t(field) %>
|
8
|
-
</td>
|
9
|
-
<% [@default_locale, selected_translation_locale].each do |translation_locale| %>
|
10
|
-
<% readonly = translation_locale == @default_locale %>
|
11
|
-
<td <% if readonly %>style="width: 40%;"<% else %>style="width: 60%;"<% end %>>
|
12
|
-
<% case field%>
|
13
|
-
<% when :description %>
|
14
|
-
<div class="trix-container mb-0">
|
15
|
-
<%= rich_text_area_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), { contenteditable: !readonly } %>
|
16
|
-
</div>
|
17
|
-
<% when :address %>
|
18
|
-
<%= text_area_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), class: 'form-control', readonly: readonly, data: { controller: 'textarea-autogrow'} %>
|
19
|
-
<% else %>
|
20
|
-
<%= text_field_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), class: 'form-control', readonly: readonly %>
|
21
|
-
<% end %>
|
22
|
-
</td>
|
23
|
-
<% end %>
|
24
|
-
</tr>
|
25
14
|
<% end %>
|
@@ -1,20 +1,5 @@
|
|
1
|
+
<%# locals: (f:, resource:, locale:) %>
|
2
|
+
|
1
3
|
<% resource.class.translatable_fields.each do |field| %>
|
2
|
-
|
3
|
-
<td class="text-left">
|
4
|
-
<%= Spree.t(field) %>
|
5
|
-
</td>
|
6
|
-
<% [@default_locale, selected_translation_locale].each do |translation_locale| %>
|
7
|
-
<% readonly = translation_locale == @default_locale %>
|
8
|
-
<td <% if readonly %>style="width: 40%;"<% else %>style="width: 60%;"<% end %>>
|
9
|
-
<% case field%>
|
10
|
-
<% when :description %>
|
11
|
-
<div class="trix-container mb-0">
|
12
|
-
<%= rich_text_area_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), { contenteditable: !readonly } %>
|
13
|
-
</div>
|
14
|
-
<% else %>
|
15
|
-
<%= text_field_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), class: 'form-control', readonly: readonly %>
|
16
|
-
<% end %>
|
17
|
-
</td>
|
18
|
-
<% end %>
|
19
|
-
</tr>
|
4
|
+
<%= render "spree/admin/translations/translation_rows/text_field_row", f: f, field: field, locale: locale %>
|
20
5
|
<% end %>
|
@@ -1,37 +1,14 @@
|
|
1
|
+
<%# locals: (f:, resource:, locale:) %>
|
2
|
+
|
1
3
|
<% resource.class.translatable_fields.each do |field| %>
|
2
|
-
<% if field == :pretty_name %>
|
3
|
-
|
4
|
+
<% next if field == :pretty_name %>
|
5
|
+
|
6
|
+
<% case field %>
|
7
|
+
<% when :description %>
|
8
|
+
<%= render "spree/admin/translations/translation_rows/rich_textarea_row", f: f, field: field, locale: locale %>
|
9
|
+
<% when :permalink %>
|
10
|
+
<%= render "spree/admin/translations/translation_rows/permalink_field_row", f: f, field: field, locale: locale %>
|
11
|
+
<% else %>
|
12
|
+
<%= render "spree/admin/translations/translation_rows/text_field_row", f: f, field: field, locale: locale %>
|
4
13
|
<% end %>
|
5
|
-
<tr>
|
6
|
-
<td class="text-left">
|
7
|
-
<%= Spree.t(field) %>
|
8
|
-
</td>
|
9
|
-
<% [@default_locale, selected_translation_locale].each do |translation_locale| %>
|
10
|
-
<% readonly = translation_locale == @default_locale %>
|
11
|
-
<td <% if readonly %>style="width: 40%;"<% else %>style="width: 60%;"<% end %>>
|
12
|
-
<% case field%>
|
13
|
-
<% when :description %>
|
14
|
-
<div class="trix-container mb-0">
|
15
|
-
<%= rich_text_area_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), { contenteditable: !readonly } %>
|
16
|
-
</div>
|
17
|
-
<% when :permalink %>
|
18
|
-
<% parent_permalink = resource.parent.present? ? I18n.with_locale(translation_locale) { resource.parent.permalink } + "/" : "" %>
|
19
|
-
<div class="form-group">
|
20
|
-
<div class="input-group">
|
21
|
-
<% if parent_permalink.present? %>
|
22
|
-
<div class="input-group-prepend">
|
23
|
-
<span class="input-group-text">
|
24
|
-
<%= parent_permalink %>
|
25
|
-
</span>
|
26
|
-
</div>
|
27
|
-
<% end %>
|
28
|
-
<%= text_field_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field)&.delete_prefix(parent_permalink), class: 'form-control', readonly: readonly %>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
<% else %>
|
32
|
-
<%= text_field_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), class: 'form-control', readonly: readonly %>
|
33
|
-
<% end %>
|
34
|
-
</td>
|
35
|
-
<% end %>
|
36
|
-
</tr>
|
37
14
|
<% end %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<%# locals: (f:, field:, locale:) %>
|
2
|
+
|
3
|
+
<%
|
4
|
+
parent = f.object.parent
|
5
|
+
|
6
|
+
base_permalink = parent.present? ? parent.send(field).to_s + "/" : ""
|
7
|
+
value = f.object.send(field)&.delete_prefix(base_permalink)
|
8
|
+
|
9
|
+
base_permalink_translated = parent.present? ? I18n.with_locale(locale) { parent.send(field) } + "/" : ""
|
10
|
+
translated_value = f.object.send("#{field}_#{locale}")&.delete_prefix(base_permalink_translated)
|
11
|
+
%>
|
12
|
+
|
13
|
+
<tr>
|
14
|
+
<td><%= Spree.t(field) %></td>
|
15
|
+
<td>
|
16
|
+
<code>
|
17
|
+
<%= f.object.permalink %>
|
18
|
+
</code>
|
19
|
+
</td>
|
20
|
+
<td>
|
21
|
+
<div class="form-group">
|
22
|
+
<div class="input-group">
|
23
|
+
<% if base_permalink_translated.present? %>
|
24
|
+
<div class="input-group-prepend">
|
25
|
+
<span class="input-group-text"><%= base_permalink_translated %></span>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<%= f.text_field "#{field}_#{locale}", value: translated_value, class: 'form-control' %>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</td>
|
33
|
+
</tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%# locals: (f:, field:, locale:) %>
|
2
|
+
|
3
|
+
<tr>
|
4
|
+
<td><%= Spree.t(field) %></td>
|
5
|
+
<td class="text-wrap">
|
6
|
+
<%= @resource.send(field)%>
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
<div class="trix-container mb-0">
|
10
|
+
<%= f.rich_text_area "#{field}_#{locale}" %>
|
11
|
+
</div>
|
12
|
+
</td>
|
13
|
+
</tr>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# locals: (f:, field:, locale:) %>
|
2
|
+
|
3
|
+
<tr>
|
4
|
+
<td><%= Spree.t(field) %></td>
|
5
|
+
<td>
|
6
|
+
<%= @resource.send(field) %>
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
<%= f.text_area "#{field}_#{locale}", rows: 5, class: "form-control", data: { controller: 'textarea-autogrow'} %>
|
10
|
+
</td>
|
11
|
+
</tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%# locals: (f:, field:, locale:) %>
|
2
|
+
|
3
|
+
<tr>
|
4
|
+
<td><%= Spree.t(field) %></td>
|
5
|
+
<td>
|
6
|
+
<%= @resource.send(field) %>
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
<div class="trix-container">
|
10
|
+
<%= f.text_area "#{field}_#{locale}", rows: 10, class: "form-control spree-rte" %>
|
11
|
+
</div>
|
12
|
+
</td>
|
13
|
+
</tr>
|
@@ -4,8 +4,18 @@
|
|
4
4
|
<%= Spree.t(:inventory) %>
|
5
5
|
</h5>
|
6
6
|
</div>
|
7
|
-
<div class="card-body p-0">
|
8
|
-
<
|
7
|
+
<div class="card-body p-0" data-controller="reveal" data-reveal-hidden-class="d-none">
|
8
|
+
<div class="custom-control custom-checkbox mb-4 m-3">
|
9
|
+
<%= f.check_box :track_inventory,
|
10
|
+
class: 'custom-control-input',
|
11
|
+
data: {
|
12
|
+
action: 'change->reveal#toggle'
|
13
|
+
}
|
14
|
+
%>
|
15
|
+
<%= f.label :track_inventory, Spree.t(:track_quantity), class: 'custom-control-label' %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<table class="table <%= 'd-none' unless f.object.track_inventory? %>" data-reveal-target="item">
|
9
19
|
<thead>
|
10
20
|
<tr>
|
11
21
|
<th><%= Spree.t(:stock_location) %></th>
|
@@ -35,10 +35,6 @@ module Spree
|
|
35
35
|
rescue Selenium::WebDriver::Error::TimeoutError
|
36
36
|
default_options[:error].nil? ? false : raise(default_options[:error])
|
37
37
|
end
|
38
|
-
|
39
|
-
def fill_in_trix_editor(id, with:)
|
40
|
-
page.find(id, visible: :all).click.set(with)
|
41
|
-
end
|
42
38
|
end
|
43
39
|
end
|
44
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vendo Connect Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.1.
|
19
|
+
version: 5.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: 5.1.
|
26
|
+
version: 5.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_api
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.1.
|
33
|
+
version: 5.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: 5.1.
|
40
|
+
version: 5.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: active_link_to
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1040,10 +1040,17 @@ files:
|
|
1040
1040
|
- app/views/spree/admin/themes/update.turbo_stream.erb
|
1041
1041
|
- app/views/spree/admin/translations/_translations_unavailable.html.erb
|
1042
1042
|
- app/views/spree/admin/translations/edit.html.erb
|
1043
|
+
- app/views/spree/admin/translations/option_types/_form.html.erb
|
1043
1044
|
- app/views/spree/admin/translations/products/_form.html.erb
|
1045
|
+
- app/views/spree/admin/translations/properties/_form.html.erb
|
1044
1046
|
- app/views/spree/admin/translations/stores/_form.html.erb
|
1045
1047
|
- app/views/spree/admin/translations/taxonomies/_form.html.erb
|
1046
1048
|
- app/views/spree/admin/translations/taxons/_form.html.erb
|
1049
|
+
- app/views/spree/admin/translations/translation_rows/_permalink_field_row.html.erb
|
1050
|
+
- app/views/spree/admin/translations/translation_rows/_rich_textarea_row.html.erb
|
1051
|
+
- app/views/spree/admin/translations/translation_rows/_text_field_row.html.erb
|
1052
|
+
- app/views/spree/admin/translations/translation_rows/_textarea_row.html.erb
|
1053
|
+
- app/views/spree/admin/translations/translation_rows/_tinymce_row.html.erb
|
1047
1054
|
- app/views/spree/admin/user_passwords/edit.html.erb
|
1048
1055
|
- app/views/spree/admin/user_passwords/new.html.erb
|
1049
1056
|
- app/views/spree/admin/user_sessions/new.html.erb
|
@@ -1138,9 +1145,9 @@ licenses:
|
|
1138
1145
|
- AGPL-3.0-or-later
|
1139
1146
|
metadata:
|
1140
1147
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1141
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.
|
1148
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.1
|
1142
1149
|
documentation_uri: https://docs.spreecommerce.org/
|
1143
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.1.
|
1150
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.1.1
|
1144
1151
|
post_install_message:
|
1145
1152
|
rdoc_options: []
|
1146
1153
|
require_paths:
|