Sha256: 9c565a03c14359f2b8bf0c0b7ad67c2287991ee553f6c0815d8602081b95348c

Contents?: true

Size: 1.68 KB

Versions: 1

Compression:

Stored size: 1.68 KB

Contents

<% resource_class ||= @resource.class %>
<div id="attr_fields">
  <% available_locales.each do |locale| %>
    <%= f.mobility_fields_for locale.to_sym do |g| %>
      <% resource_class.mobility_attributes.each_with_index do |attr, i| %>
        <div class="panel panel-default <%= attr %> <%= locale %>" style="display:<%= i == 0 ? 'auto' : 'none' %>;">
          <div class="panel-heading">
            <% I18n.with_locale(locale) do %>
              <%= resource_class.human_attribute_name(attr) %>

              <div class="pull-right text-muted">
                <small><i><%= Spree.t(:'i18n.this_file_language') %></i></small>
              </div>
            <% end %>
          </div>

          <div class="panel-body">
            <% field_type = resource_class.translation_class.columns_hash[attr.to_s].type %>
            <% if @resource.kind_of?(Spree::Product) && attr.to_sym == :description %>
              <%= g.text_area :description, { rows: "30", class: "form-control #{"spree-rte" if SpreeMobility.product_wysiwyg_editor_enabled? }" } %>
            <% elsif @resource.kind_of?(Spree::Taxon) && attr.to_sym == :description %>
              <%= g.text_area :description, { rows: "30", class: "form-control #{"spree-rte" if SpreeMobility.taxon_wysiwyg_editor_enabled? }" } %>
            <% elsif field_type == :text %>
              <%= g.text_area attr, class: 'form-control', rows: 4 %>
            <% else %>
              <%= g.text_field attr, class: 'form-control' %>
            <% end %>
          </div>
        </div>
      <% end %>
    <% end %>
  <% end %>

  <p class="no-translations" style="display: none">
    <%= Spree.t(:'mobility.no_translations_for_criteria') %>
  </p>
</div>

<hr/>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_mobility-1.4.0 app/views/spree/admin/translations/_form_fields.html.erb