Commit 3d438870 authored by Phil Hughes's avatar Phil Hughes

Updated based on feedback

parent a650af12
...@@ -4,16 +4,16 @@ class @ImporterStatus ...@@ -4,16 +4,16 @@ class @ImporterStatus
this.setAutoUpdate() this.setAutoUpdate()
initStatusPage: -> initStatusPage: ->
$(".js-add-to-import") $('.js-add-to-import')
.off 'click' .off 'click'
.on 'click', (event) => .on 'click', (event) =>
new_namespace = null new_namespace = null
$btn = $(event.currentTarget) $btn = $(event.currentTarget)
$tr = $btn.closest("tr") $tr = $btn.closest('tr')
id = $tr.attr("id").replace("repo_", "") id = $tr.attr('id').replace('repo_', '')
if $tr.find(".import-target input").length > 0 if $tr.find('.import-target input').length > 0
new_namespace = $tr.find(".import-target input").prop("value") new_namespace = $tr.find('.import-target input').prop('value')
$tr.find(".import-target").empty().append(new_namespace + "/" + $tr.find(".import-target").data("project_name")) $tr.find('.import-target').empty().append("#{new_namespace} / #{$tr.find('.import-target').data('project_name')}")
$btn $btn
.disable() .disable()
...@@ -21,15 +21,15 @@ class @ImporterStatus ...@@ -21,15 +21,15 @@ class @ImporterStatus
$.post @import_url, {repo_id: id, new_namespace: new_namespace}, dataType: 'script' $.post @import_url, {repo_id: id, new_namespace: new_namespace}, dataType: 'script'
$(".js-import-all") $('.js-import-all')
.off 'click' .off 'click'
.on 'click', (event) => .on 'click', (e) =>
$btn = $(event.currentTarget) $btn = $(e.currentTarget)
$btn $btn
.disable() .disable()
.addClass 'is-loading' .addClass 'is-loading'
$(".js-add-to-import").each -> $('.js-add-to-import').each ->
$(this).click() $(this).click()
setAutoUpdate: -> setAutoUpdate: ->
......
...@@ -26,4 +26,4 @@ ...@@ -26,4 +26,4 @@
- else - else
:plain :plain
job = $("tr#repo_#{@repo_id}") job = $("tr#repo_#{@repo_id}")
job.find(".import-actions").html("<i class='fa fa-exclamation-circle'></i> Error saving project: #{escape_javascript(@project.errors.full_messages.join(','))}</i>") job.find(".import-actions").html("<i class='fa fa-exclamation-circle'></i> Error saving project: #{escape_javascript(@project.errors.full_messages.join(','))}")
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
- if @incompatible_repos.any? - if @incompatible_repos.any?
= button_tag class: "btn btn-import btn-success js-import-all" do = button_tag class: "btn btn-import btn-success js-import-all" do
Import all compatible projects Import all compatible projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
- else - else
= button_tag class: "btn btn-success js-import-all" do = button_tag class: "btn btn-success js-import-all" do
Import all projects Import all projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
.table-responsive .table-responsive
%table.table.import-jobs %table.table.import-jobs
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
%td.import-actions.job-status %td.import-actions.job-status
= button_tag class: "btn btn-import js-add-to-import" do = button_tag class: "btn btn-import js-add-to-import" do
Import Import
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
- @incompatible_repos.each do |repo| - @incompatible_repos.each do |repo|
%tr{id: "repo_#{repo["owner"]}___#{repo["slug"]}"} %tr{id: "repo_#{repo["owner"]}___#{repo["slug"]}"}
%td %td
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
%p %p
= button_tag class: 'btn btn-import btn-success js-import-all' do = button_tag class: 'btn btn-import btn-success js-import-all' do
Import all projects Import all projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
.table-responsive .table-responsive
%table.table.import-jobs %table.table.import-jobs
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
%td.import-actions.job-status %td.import-actions.job-status
= button_tag class: "btn btn-import js-add-to-import" do = button_tag class: "btn btn-import js-add-to-import" do
Import Import
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
:javascript :javascript
new ImporterStatus("#{jobs_import_fogbugz_path}", "#{import_fogbugz_path}"); new ImporterStatus("#{jobs_import_fogbugz_path}", "#{import_fogbugz_path}");
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%p %p
= button_tag class: "btn btn-import btn-success js-import-all" do = button_tag class: "btn btn-import btn-success js-import-all" do
Import all projects Import all projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
.table-responsive .table-responsive
%table.table.import-jobs %table.table.import-jobs
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
%td.import-actions.job-status %td.import-actions.job-status
= button_tag class: "btn btn-import js-add-to-import" do = button_tag class: "btn btn-import js-add-to-import" do
Import Import
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
:javascript :javascript
new ImporterStatus("#{jobs_import_github_path}", "#{import_github_path}"); new ImporterStatus("#{jobs_import_github_path}", "#{import_github_path}");
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%p %p
= button_tag class: "btn btn-import btn-success js-import-all" do = button_tag class: "btn btn-import btn-success js-import-all" do
Import all projects Import all projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
.table-responsive .table-responsive
%table.table.import-jobs %table.table.import-jobs
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
%td.import-actions.job-status %td.import-actions.job-status
= button_tag class: "btn js-add-to-import" do = button_tag class: "btn js-add-to-import" do
Import Import
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
:javascript :javascript
new ImporterStatus("#{jobs_import_gitlab_path}", "#{import_gitlab_path}"); new ImporterStatus("#{jobs_import_gitlab_path}", "#{import_gitlab_path}");
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%p %p
= button_tag class: "btn btn-import btn-success js-import-all" do = button_tag class: "btn btn-import btn-success js-import-all" do
Import all projects Import all projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
.table-responsive .table-responsive
%table.table.import-jobs %table.table.import-jobs
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
%td.import-actions.job-status %td.import-actions.job-status
= button_tag class: "btn btn-import js-add-to-import" do = button_tag class: "btn btn-import js-add-to-import" do
Import Import
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
:javascript :javascript
new ImporterStatus("#{jobs_import_gitorious_path}", "#{import_gitorious_path}"); new ImporterStatus("#{jobs_import_gitorious_path}", "#{import_gitorious_path}");
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
- if @incompatible_repos.any? - if @incompatible_repos.any?
= button_tag class: "btn btn-import btn-success js-import-all" do = button_tag class: "btn btn-import btn-success js-import-all" do
Import all compatible projects Import all compatible projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
- else - else
= button_tag class: "btn btn-import btn-success js-import-all" do = button_tag class: "btn btn-import btn-success js-import-all" do
Import all projects Import all projects
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
.table-responsive .table-responsive
%table.table.import-jobs %table.table.import-jobs
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
%td.import-actions.job-status %td.import-actions.job-status
= button_tag class: "btn btn-import js-add-to-import" do = button_tag class: "btn btn-import js-add-to-import" do
Import Import
= icon('spinner spin', class: 'loading-icon') = icon("spinner spin", class: "loading-icon")
- @incompatible_repos.each do |repo| - @incompatible_repos.each do |repo|
%tr{id: "repo_#{repo.id}"} %tr{id: "repo_#{repo.id}"}
%td %td
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment