Sha256: 48f228fbf2dd27c2d8a719d880bf19b4cfddcf4715d5c4ffe1046712b37be780
Contents?: true
Size: 1.96 KB
Versions: 7
Compression:
Stored size: 1.96 KB
Contents
<% columns = @importer.importable_columns(@importer.parser).map { |column| [@importer.source_klass.human_attribute_name(column), column] }.unshift([t('csv_import_magic.views.importers.edit.ignore_column_label'), :ignore]) %> <h3 class='page-title'> <%= t('csv_import_magic.views.importers.edit.title') %> </br> <small><%= t('csv_import_magic.views.importers.edit.description') %></small> </h3> <%= simple_form_for @importer, url: importer_path(@importer) do |f| %> <div class="row csv_import"> <% import_file_csv.headers.each_with_index do |header, i| %> <div class="column"> <div class="portlet light bordered"> <div class="portlet-body form"> <header> <%= t('csv_import_magic.views.importers.edit.column') %> <b><%= header %></b> </header> <% selected = columns.find { |c| c.join(' ').match(/#{header}/i) }.try(:last).presence || :ignore %> <%= f.input "columns][", as: :select, collection: columns, label: false, hint: t('csv_import_magic.views.importers.edit.hint'), include_blank: false, selected: f.object.columns[i] || selected %> <header class="examples"><%= t('csv_import_magic.views.importers.edit.example_of_values') %></header> <table> <tbody> <% import_file_csv.first(5).each_with_index do |row, c| %> <tr> <td class="number"><%= c + 1 %></td> <td><%= row[header] || t('csv_import_magic.views.importers.edit.empty_values') %></td> </tr> <% end %> </tbody> </table> </div> </div> </div> <% end %> </div> <div class="form-row actions"> <%= link_to t('csv_import_magic.views.importers.edit.buttons.cancel'), 'javascript:history.back()', class: 'button button--secondary' %> <%= f.submit t('csv_import_magic.views.importers.edit.buttons.import', count: import_file_csv.count), class: 'button button--primary' %> </div> <% end %>
Version data entries
7 entries across 7 versions & 1 rubygems