Sha256: a1b0c5fbc39e8f73d2e99f3ae50014e0f03bd3e06626fb644bf31275420f2f75

Contents?: true

Size: 902 Bytes

Versions: 5

Compression:

Stored size: 902 Bytes

Contents

<% content ||= local_assigns[:content] || local_assigns[:essence_spree_taxon_editor] %>

<div class="content_editor essence_spree_taxon" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
  <%= content_label(content) %>
  <%= text_field_tag(
    content.form_field_name,
    content.essence.taxon_id,
    id: content.form_field_id,
    class: 'alchemy_selectbox full_width'
  ) %>
</div>

<script>
  $('#<%= content.form_field_id %>').alchemyTaxonSelect({
    placeholder: "<%= Alchemy.t(:search_taxon, scope: 'solidus') %>",
    apiToken: "<%= current_alchemy_user.spree_api_key %>",
    baseUrl: "<%= spree.api_taxons_path %>",
    query_params: <%== content.settings[:query_params].to_json %>,
    <% if content.essence.taxon %>
    initialSelection: {
      id: <%= content.essence.taxon_id %>,
      text: "<%= content.essence.taxon.pretty_name %>"
    }
    <% end %>
  })
</script>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alchemy-solidus-5.0.0 app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb
alchemy-solidus-4.1.0 app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb
alchemy-solidus-4.0.0 app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb
alchemy-solidus-4.0.0.pre.b2 app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb
alchemy-solidus-4.0.0.pre.b1 app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb