41 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
= form_with model: @form, url: "/contests/#{@contest.id}/import/#{@csv_import.id}" do |form|
 | 
						|
 | 
						|
  .row.mb-3
 | 
						|
    .col
 | 
						|
      .form-floating
 | 
						|
        = form.select :name_column, [[t("helpers.none"), -1]] + Array.new(@content[0].count) {|i| [t("helpers.field") + "_#{i}", i] }, {}, class: "form-select"
 | 
						|
        = form.label :name_column
 | 
						|
          = t("contestants.import.name_column")
 | 
						|
 | 
						|
  .row.mb-3
 | 
						|
    .col
 | 
						|
      .form-floating
 | 
						|
        = form.select :email_column, [[t("helpers.none"), -1]] + Array.new(@content[0].count) {|i| [t("helpers.field") + "_#{i}", i] }, {}, class: "form-select"
 | 
						|
        = form.label :email_column
 | 
						|
          = t("contestants.import.email_column")
 | 
						|
 | 
						|
  .row.mb-3
 | 
						|
    .col
 | 
						|
      = form.submit t("helpers.buttons.confirm"), class: "btn btn-primary"
 | 
						|
 | 
						|
  .row.g-3
 | 
						|
    .col
 | 
						|
      table.table.table-striped.table-hover
 | 
						|
        thead
 | 
						|
          tr
 | 
						|
            - @content[0].each_with_index do |_, i|
 | 
						|
              th scope="col"
 | 
						|
                = t("helpers.field") + "_#{i}"
 | 
						|
            th scope="col" style="white-space: nowrap"
 | 
						|
              = t("contestants.import.import_column")
 | 
						|
        tbody
 | 
						|
          - @content.each_with_index do |row, i|
 | 
						|
            tr scope="row"
 | 
						|
              - row.each do |value|
 | 
						|
                td
 | 
						|
                  = value
 | 
						|
              td
 | 
						|
                .form-check.form-switch
 | 
						|
                  = form.check_box "row_#{i}".to_sym, class: "form-check-input", checked: true
 | 
						|
    
 |