diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl index 35f3614ec56..d4ca269f020 100644 --- a/templates/repo/migrate/codebase.tmpl +++ b/templates/repo/migrate/codebase.tmpl @@ -3,13 +3,15 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/codecommit.tmpl b/templates/repo/migrate/codecommit.tmpl index f75112f896b..53ca7dda3d6 100644 --- a/templates/repo/migrate/codecommit.tmpl +++ b/templates/repo/migrate/codecommit.tmpl @@ -3,13 +3,15 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl index b10c49c10ee..3f447f76eb3 100644 --- a/templates/repo/migrate/git.tmpl +++ b/templates/repo/migrate/git.tmpl @@ -3,13 +3,15 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl index 80d2491e915..559988951b4 100644 --- a/templates/repo/migrate/gitbucket.tmpl +++ b/templates/repo/migrate/gitbucket.tmpl @@ -3,13 +3,15 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl index 220295662e8..3d692129d52 100644 --- a/templates/repo/migrate/gitea.tmpl +++ b/templates/repo/migrate/gitea.tmpl @@ -3,12 +3,14 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl index d1aa4c1f298..850a2b3c718 100644 --- a/templates/repo/migrate/github.tmpl +++ b/templates/repo/migrate/github.tmpl @@ -3,12 +3,14 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl index 87a04d78493..9bafa122f18 100644 --- a/templates/repo/migrate/gitlab.tmpl +++ b/templates/repo/migrate/gitlab.tmpl @@ -3,12 +3,14 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl index a4d05e8acdc..0495ce67fb2 100644 --- a/templates/repo/migrate/gogs.tmpl +++ b/templates/repo/migrate/gogs.tmpl @@ -3,12 +3,14 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{.CsrfTokenHtml}} + + +
diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl index a27188ed242..55945154efd 100644 --- a/templates/repo/migrate/onedev.tmpl +++ b/templates/repo/migrate/onedev.tmpl @@ -3,13 +3,15 @@

{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} -

{{template "base/alert" .}} {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} + + +
diff --git a/tests/integration/migrate_test.go b/tests/integration/migrate_test.go index 4c784dd22b9..59dd6907db4 100644 --- a/tests/integration/migrate_test.go +++ b/tests/integration/migrate_test.go @@ -79,8 +79,12 @@ func TestMigrateGiteaForm(t *testing.T) { resp := session.MakeRequest(t, req, http.StatusOK) // Step 2: load the form htmlDoc := NewHTMLParser(t, resp.Body) - link, exists := htmlDoc.doc.Find(`form.ui.form[action^="/repo/migrate"]`).Attr("action") + form := htmlDoc.doc.Find(`form.ui.form[action^="/repo/migrate"]`) + link, exists := form.Attr("action") assert.True(t, exists, "The template has changed") + serviceInput, exists := form.Find(`input[name="service"]`).Attr("value") + assert.True(t, exists) + assert.EqualValues(t, fmt.Sprintf("%d", structs.GiteaService), serviceInput) // Step 4: submit the migration to only migrate issues migratedRepoName := "otherrepo" req = NewRequestWithValues(t, "POST", link, map[string]string{