2014-12-31 08:07:48 -05:00
|
|
|
- if @already_been_taken
|
|
|
|
:plain
|
|
|
|
target_field = $("tr#repo_#{@repo_id} .import-target")
|
|
|
|
origin_target = target_field.text()
|
|
|
|
project_name = "#{@project_name}"
|
|
|
|
origin_namespace = "#{@target_namespace}"
|
|
|
|
target_field.empty()
|
|
|
|
target_field.append("<p class='alert alert-danger'>This namespace already been taken! Please choose another one</p>")
|
|
|
|
target_field.append("<input type='text' name='target_namespace' />")
|
|
|
|
target_field.append("/" + project_name)
|
|
|
|
target_field.data("project_name", project_name)
|
|
|
|
target_field.find('input').prop("value", origin_namespace)
|
2015-02-17 10:59:50 -05:00
|
|
|
- elsif @access_denied
|
|
|
|
:plain
|
|
|
|
job = $("tr#repo_#{@repo_id}")
|
2015-04-14 04:20:07 -04:00
|
|
|
job.find(".import-actions").html("<p class='alert alert-danger'>Access denied! Please verify you can add deploy keys to this repository.</p>")
|
2015-08-11 02:56:01 -04:00
|
|
|
- elsif @project.persisted?
|
2014-12-31 08:07:48 -05:00
|
|
|
:plain
|
2015-01-20 14:52:55 -05:00
|
|
|
job = $("tr#repo_#{@repo_id}")
|
|
|
|
job.attr("id", "project_#{@project.id}")
|
2015-02-17 10:59:50 -05:00
|
|
|
target_field = job.find(".import-target")
|
|
|
|
target_field.empty()
|
2015-08-11 02:56:01 -04:00
|
|
|
target_field.append('<strong>#{link_to @project.path_with_namespace, namespace_project_path(@project.namespace, @project)}</strong>')
|
2015-01-20 14:52:55 -05:00
|
|
|
$("table.import-jobs tbody").prepend(job)
|
|
|
|
job.addClass("active").find(".import-actions").html("<i class='fa fa-spinner fa-spin'></i> started")
|
2015-08-11 02:56:01 -04:00
|
|
|
- else
|
|
|
|
:plain
|
|
|
|
job = $("tr#repo_#{@repo_id}")
|
2015-08-11 09:36:42 -04:00
|
|
|
job.find(".import-actions").html("<i class='fa fa-exclamation-circle'> Error saving project: #{escape_javascript(@project.errors.full_messages.join(','))}</i>")
|