AlchemyCMS/alchemy_cms

View on GitHub
app/views/alchemy/admin/ingredients/_picture_fields.html.erb

Summary

Maintainability
Test Coverage
<%= f.input :caption, as: ingredient.settings[:caption_as_textarea] ? 'text' : 'string' %>
<%= f.input :title %>
<%= f.input :alt_tag, as: :text, placeholder: ingredient.alt_text(language: @language) %>
<%- if ingredient.settings[:sizes].present? && ingredient.settings[:srcset].blank? -%>
  <%= f.input :render_size,
    collection: [
      [Alchemy.t('Layout default'), ""]
    ] + ingredient.settings[:sizes].to_a,
    include_blank: false %>
<%- end -%>
<%- if ingredient.settings[:css_classes].present? -%>
  <%= f.input :css_class,
    collection: ingredient.settings[:css_classes],
    include_blank: Alchemy.t('None') %>
<%- else -%>
  <% Alchemy::Deprecation.warn %(Float positioning in Picture ingredients is deprecated. If you rely on them, please use `css_classes` in your "#{ingredient.role}" settings instead.) %>
  <%= f.input :css_class,
    label: Alchemy.t(:position_in_text),
    collection: [
      [Alchemy.t(:above), "no_float"],
      [Alchemy.t(:left), "left"],
      [Alchemy.t(:right), "right"]
    ], include_blank: Alchemy.t("Layout default") %>
<%- end -%>