mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-23 23:54:07 +01:00
first pass at csv import functionality for tracks
This commit is contained in:
parent
d093ba39bd
commit
3450c22e97
9 changed files with 144 additions and 4 deletions
0
app/views/data/csv_import.html.erb
Normal file
0
app/views/data/csv_import.html.erb
Normal file
11
app/views/data/csv_map.html.erb
Normal file
11
app/views/data/csv_map.html.erb
Normal 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 %>
|
||||
18
app/views/data/import.html.erb
Normal file
18
app/views/data/import.html.erb
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue