diff --git a/app/assets/javascripts/repositories/index.js b/app/assets/javascripts/repositories/index.js index cb4013a2a..b9de01d84 100644 --- a/app/assets/javascripts/repositories/index.js +++ b/app/assets/javascripts/repositories/index.js @@ -10,11 +10,11 @@ pane = $(this); $.ajax({ - url: $(this).attr('data-url'), + url: pane.attr('data-url'), type: 'GET', dataType: 'json', - success: function (data) { - var tabBody = $(pane.context.hash).find(".tab-content-body"); + success: function(data) { + var tabBody = $(pane.context.hash).find('.tab-content-body'); tabBody.html(data.html); pane.tab('show'); }, @@ -40,6 +40,12 @@ }) } + function showParsedRecords() { + $('#form-records-file').bind('ajax:success', function(evt, data, status, xhr) { + debugger; + }); + } + $('.delete-repo-option').initializeModal('#delete-repo-modal'); $('.rename-repo-option').initializeModal('#rename-repo-modal'); $('.copy-repo-option').initializeModal('#copy-repo-modal'); @@ -47,7 +53,7 @@ $(document).ready(function() { loadRepositoryTab(); + showParsedRecords(); }); - alert('Banana'); })(); diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 81589a6b3..a6c1d7f26 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -186,7 +186,6 @@ class RepositoriesController < ApplicationController end def parse_sheet - # byebug render_404 unless params[:team_id].to_i == current_team.id repository = current_team.repositories.find_by_id(params[:id]) imported_file = ::ImportRepository.new(file: params[:file], diff --git a/app/views/repositories/_import_repository_records.html.erb b/app/views/repositories/_import_repository_records.html.erb index 7c9d15a7d..72ca2387a 100644 --- a/app/views/repositories/_import_repository_records.html.erb +++ b/app/views/repositories/_import_repository_records.html.erb @@ -8,7 +8,7 @@ <%= bootstrap_form_tag url: parse_sheet_repository_path(repository, format: :json), html: {'data-type' => 'json', - id: 'form-samples-file'}, + id: 'form-records-file'}, remote: :true do |f| %> <%= f.hidden_field :team_id, value: current_team.id %>