first pass at csv import functionality for tracks

This commit is contained in:
Darren Cato 2013-07-21 13:37:35 -04:00
parent d093ba39bd
commit 3450c22e97
9 changed files with 144 additions and 4 deletions

View file

View file

@ -0,0 +1,11 @@
<h3>Map fields to be imported<h3>
<%= form_tag csv_import_data_path do %>
<% @labels.each do |l| %>
<%= label_tag l %>:
<%= select_tag(l, options_for_select(@headers) ) %>
<br>
<% end %>
<%= hidden_field_tag :file, @path %>
<%= hidden_field_tag :import_to, @import_to %>
<%= submit_tag "Import" %>
<% end %>

View file

@ -0,0 +1,18 @@
<div id="display_box">
<div id="feeds">
<div id="feedlegend">
<h2>Importing data</h2>
<div>
<h3>Please upload your CSV file</h3>
<%= form_tag csv_map_data_path, :id => 'upload_form', multipart: true do %>
<label for="import_to">Import to:</label>
<%= select_tag(:import_to, options_for_select([['Projects', 'projects'], ['Todos', 'todos']], 1) ) %>
<br><br>
<%= file_field_tag :file %>
<%= submit_tag "Upload", :id => "upload_form_submit" %>
<% end %>
</div>
</div>
</div>
</div>