Sha256: b57da81b4b4c0b8a6904893ec02b01ca7aaf834280f9d3ba09d1cdd1369b42c2

Contents?: true

Size: 1.21 KB

Versions: 16

Compression:

Stored size: 1.21 KB

Contents

<%= f.field_container save_to do %>
  <%= f.label save_to, Spree.t('admin.cms.link_to_taxon') %>
  <%= f.select save_to, options_from_collection_for_select([resource], save_to, save_to, resource.send(save_to) || nil), { include_blank: true },
                          id: "cms_section_#{save_to}",
                          data: { autocomplete_placeholder_value: Spree.t('admin.navigation.search_for_a_taxon'),
                                  autocomplete_clear_value: true,
                                  autocomplete_url_value: 'taxons_api_v2',
                                  autocomplete_return_attr_value: 'pretty_name',
                                  autocomplete_custom_return_id_value: 'permalink' } %>

  <%= f.error_message_on :save_to %>
<% end %>

<% if resource.link_one.present? %>
  <script>
    populateSelectOptionsFromApi({
      targetElement: "#cms_section_<%= save_to %>",
      apiUrl: Spree.routes.taxons_api_v2 + "?filter[permalink_matches]=<%= resource.send(save_to) %>",
      returnValueFromAttributes: 'permalink',
      returnOptionText: 'pretty_name',

      <% if resource.send(save_to) %>
        selectedOption: "<%= resource.send(save_to) %>"
      <% end %>
    })
  </script>
<% end %>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spree_backend-4.8.4 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.8.3 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.8.2 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.8.1 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.7.2 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.6.2 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.7.1 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.7.0 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.6.1 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.6.0 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.5.1 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.5.0 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.4.1 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.4.0 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.4.0.rc2 app/views/spree/admin/shared/cms/_spree_taxon.html.erb
spree_backend-4.4.0.rc1 app/views/spree/admin/shared/cms/_spree_taxon.html.erb