Sha256: 151f58e81950545ae2926b99d25c3c55c13241e96ead8bd78b909b2160d03a35

Contents?: true

Size: 966 Bytes

Versions: 37

Compression:

Stored size: 966 Bytes

Contents

<%= content_tag :div,
  class: node_editor.css_classes,
  data: node_editor.data_attributes do %>
  <%= element_form.fields_for(:ingredients, node_editor.ingredient) do |f| %>
    <%= ingredient_label(node_editor, :node_id) %>
    <%= f.text_field :node_id,
      value: node_editor.node&.id,
      id: node_editor.form_field_id(:node_id),
      class: 'alchemy_selectbox full_width' %>
  <% end %>
<% end %>

<script>
  <% query_params = node_editor.settings.fetch(:query_params, {}).merge({
    include: :ancestors
  }) %>
  $('#<%= node_editor.form_field_id(:node_id) %>').alchemyNodeSelect({
    placeholder: "<%= Alchemy.t(:search_node) %>",
    url: "<%= alchemy.api_nodes_path %>",
    query_params: <%== query_params.to_json %>,
    <% if node_editor.node %>
    <% serialized_node = ActiveModelSerializers::SerializableResource.new(node_editor.node, include: :ancestors) %>
    initialSelection: <%== serialized_node.to_json %>
    <% end %>
  })
</script>

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.9 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.8 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.7 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.6 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.5 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.14 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.4 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.13 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.3 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.2 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.1 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.1.0 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.12 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.11 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.10 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.9 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.8 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.7 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.6 app/views/alchemy/ingredients/_node_editor.html.erb