Sha256: 016f5942495a1b2dfb5358930b7cc0906aa1a3cecab6499afcda4ae5a30780a1

Contents?: true

Size: 1.65 KB

Versions: 2

Compression:

Stored size: 1.65 KB

Contents

<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 Spree::Config[: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 Spree::Config[: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

2 entries across 2 versions & 1 rubygems

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