Sha256: de97f2f10e79db62c0246ee300d047b5adfb8319e5eab0770f0a47e08a427676

Contents?: true

Size: 1.14 KB

Versions: 27

Compression:

Stored size: 1.14 KB

Contents

<% select_values = content.settings_value(:select_values, local_assigns.fetch(:options, {})) %>
<% inline = content.settings_value(:display_inline, local_assigns.fetch(:options, {})) %>

<%= content_tag :div,
  id: content.dom_id,
  class: [
    "content_editor",
    "essence_select",
    inline ? 'display_inline' : nil
  ].compact, data: {content_id: content.id} do %>
  <%= content_label(content) %>

  <% if select_values.nil? %>
    <%== warning(':select_values is nil',
    "<strong>No select values given.</strong>
    <br>Please provide :<code>select_values</code> either as argument to
    <code>render_essence_editor</code> helper or as setting on the content definition in
    <code>elements.yml</code>.") %>
  <% else %>
    <%
    if select_values.is_a?(Hash)
      options_tags = grouped_options_for_select(select_values, content.ingredient)
    else
      options_tags = options_for_select(select_values, content.ingredient)
    end %>
    <%= select_tag content.form_field_name, options_tags, {
      class: ["alchemy_selectbox", "essence_editor_select", html_options[:class]].compact,
      style: html_options[:style]
    } %>
  <% end %>
<% end %>

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-3.6.7 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-3.6.6 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.1.2 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.1.1 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.2.0.rc1 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.1.0 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.0.5 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.0.4 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.1.0.rc1 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.0.3 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-3.6.5 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.0.2 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.1.0.beta app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.0.1 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-3.6.4 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.0.0 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-3.6.3 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-3.6.2 app/views/alchemy/essences/_essence_select_editor.html.erb
alchemy_cms-4.0.0.rc2 app/views/alchemy/essences/_essence_select_editor.html.erb