Sha256: e0599226422ebca082b672d9b2f830683cfc45012cd7aab14a27fd4f19449a03

Contents?: true

Size: 1010 Bytes

Versions: 21

Compression:

Stored size: 1010 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(language_id: node_editor.page&.language_id) %>",
    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

21 entries across 21 versions & 1 rubygems

Version Path
alchemy_cms-7.0.16 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.15 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.14 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.13 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.12 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.11 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.10 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.9 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.8 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.7 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.6 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.5 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.4 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.3 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.2 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.1 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.0 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.0.pre.rc1 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.0.pre.c app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-7.0.0.pre.b app/views/alchemy/ingredients/_node_editor.html.erb