spree_admin 5.1.0.rc1 → 5.1.0
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/views/spree/admin/option_types/edit.html.erb +4 -0
- 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/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 +36 -28
- data/app/views/spree/admin/translations/option_types/_form.html.erb +17 -0
- data/app/views/spree/admin/translations/products/_form.html.erb +11 -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 +41 -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
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c11ae8c30724208b7082248ce95459e064dc46464cf0f984f8890f6f6fb3d5c6
|
4
|
+
data.tar.gz: 0ae40837806e61a1c1b871cf07be224b2027fc35511afb150a015bb32330d551
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 846341ef938847490b94ab25fc12028e6feeb7ef108976eb290a28ff5f3a6abc90d1fc4720b04cbe0b5bce8b7f6331d79957b333c10d4b49feeb4e7403e90d46
|
7
|
+
data.tar.gz: af23c0940838885d2225a883992e1761acbd17a910e9a90dd5627a2d638a1b377ef72ab87e1bfeaf488deca193d60aab74d0a86c28a2a77aa5d2ea1d2e089fae
|
@@ -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| %>
|
@@ -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>
|
@@ -11,35 +11,43 @@
|
|
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 text-center"><%= Spree.t(:field) %></th>
|
23
|
+
<th scope="col" class="w-40 text-center"><%= Spree.t('i18n.this_file_language', locale: @default_locale) %> (<%= Spree.t(:default) %>)</th>
|
24
|
+
<th scope="col" class="w-50 text-center"><%= 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,17 @@
|
|
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
|
+
<%= render "spree/admin/translations/translation_rows/text_field_row", f: ff, field: field, locale: locale %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
@@ -1,23 +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 :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="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
14
|
<% 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,41 @@
|
|
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 class="text-center"><%= Spree.t(field) %></td>
|
15
|
+
<td>
|
16
|
+
<div class="form-group">
|
17
|
+
<div class="input-group">
|
18
|
+
<% if base_permalink.present? %>
|
19
|
+
<div class="input-group-prepend">
|
20
|
+
<span class="input-group-text"><%= base_permalink %></span>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= value %>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</td>
|
28
|
+
<td>
|
29
|
+
<div class="form-group">
|
30
|
+
<div class="input-group">
|
31
|
+
<% if base_permalink_translated.present? %>
|
32
|
+
<div class="input-group-prepend">
|
33
|
+
<span class="input-group-text"><%= base_permalink_translated %></span>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
36
|
+
|
37
|
+
<%= f.text_field "#{field}_#{locale}", value: translated_value, class: 'form-control' %>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</td>
|
41
|
+
</tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%# locals: (f:, field:, locale:) %>
|
2
|
+
|
3
|
+
<tr>
|
4
|
+
<td class="text-center"><%= 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_textarea "#{field}_#{locale}" %>
|
11
|
+
</div>
|
12
|
+
</td>
|
13
|
+
</tr>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# locals: (f:, field:, locale:) %>
|
2
|
+
|
3
|
+
<tr>
|
4
|
+
<td class="text-center"><%= Spree.t(field) %></td>
|
5
|
+
<td>
|
6
|
+
<%= @resource.send(field) %>
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
<%= f.textarea "#{field}_#{locale}", rows: 5, class: "form-control", data: { controller: 'textarea-autogrow'} %>
|
10
|
+
</td>
|
11
|
+
</tr>
|
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.0
|
4
|
+
version: 5.1.0
|
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-03 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.0
|
19
|
+
version: 5.1.0
|
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.0
|
26
|
+
version: 5.1.0
|
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.0
|
33
|
+
version: 5.1.0
|
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.0
|
40
|
+
version: 5.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: active_link_to
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1040,10 +1040,16 @@ 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
|
1047
1053
|
- app/views/spree/admin/user_passwords/edit.html.erb
|
1048
1054
|
- app/views/spree/admin/user_passwords/new.html.erb
|
1049
1055
|
- app/views/spree/admin/user_sessions/new.html.erb
|
@@ -1138,9 +1144,9 @@ licenses:
|
|
1138
1144
|
- AGPL-3.0-or-later
|
1139
1145
|
metadata:
|
1140
1146
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1141
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0
|
1147
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0
|
1142
1148
|
documentation_uri: https://docs.spreecommerce.org/
|
1143
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.1.0
|
1149
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.1.0
|
1144
1150
|
post_install_message:
|
1145
1151
|
rdoc_options: []
|
1146
1152
|
require_paths:
|