|
|
@ -72,6 +72,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { |
|
|
|
err := models.NewRepoRedirect(ctx.Repo.Owner.ID, repo.ID, repo.Name, newRepoName) |
|
|
|
err := models.NewRepoRedirect(ctx.Repo.Owner.ID, repo.ID, repo.Name, newRepoName) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "NewRepoRedirect", err) |
|
|
|
ctx.Handle(500, "NewRepoRedirect", err) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newRepoName) |
|
|
|
log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newRepoName) |
|
|
@ -151,6 +152,12 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { |
|
|
|
|
|
|
|
|
|
|
|
if form.EnableWiki { |
|
|
|
if form.EnableWiki { |
|
|
|
if form.EnableExternalWiki { |
|
|
|
if form.EnableExternalWiki { |
|
|
|
|
|
|
|
if !strings.HasPrefix(form.ExternalWikiURL, "http://") && !strings.HasPrefix(form.ExternalWikiURL, "https://") { |
|
|
|
|
|
|
|
ctx.Flash.Error(ctx.Tr("repo.settings.external_wiki_url_error")) |
|
|
|
|
|
|
|
ctx.Redirect(repo.Link() + "/settings") |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
units = append(units, models.RepoUnit{ |
|
|
|
units = append(units, models.RepoUnit{ |
|
|
|
RepoID: repo.ID, |
|
|
|
RepoID: repo.ID, |
|
|
|
Type: models.UnitTypeExternalWiki, |
|
|
|
Type: models.UnitTypeExternalWiki, |
|
|
@ -171,10 +178,15 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { |
|
|
|
|
|
|
|
|
|
|
|
if form.EnableIssues { |
|
|
|
if form.EnableIssues { |
|
|
|
if form.EnableExternalTracker { |
|
|
|
if form.EnableExternalTracker { |
|
|
|
|
|
|
|
if !strings.HasPrefix(form.ExternalTrackerURL, "http://") && !strings.HasPrefix(form.ExternalTrackerURL, "https://") { |
|
|
|
|
|
|
|
ctx.Flash.Error(ctx.Tr("repo.settings.external_tracker_url_error")) |
|
|
|
|
|
|
|
ctx.Redirect(repo.Link() + "/settings") |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
units = append(units, models.RepoUnit{ |
|
|
|
units = append(units, models.RepoUnit{ |
|
|
|
RepoID: repo.ID, |
|
|
|
RepoID: repo.ID, |
|
|
|
Type: models.UnitTypeExternalWiki, |
|
|
|
Type: models.UnitTypeExternalTracker, |
|
|
|
Index: int(models.UnitTypeExternalWiki), |
|
|
|
Index: int(models.UnitTypeExternalTracker), |
|
|
|
Config: &models.ExternalTrackerConfig{ |
|
|
|
Config: &models.ExternalTrackerConfig{ |
|
|
|
ExternalTrackerURL: form.ExternalTrackerURL, |
|
|
|
ExternalTrackerURL: form.ExternalTrackerURL, |
|
|
|
ExternalTrackerFormat: form.TrackerURLFormat, |
|
|
|
ExternalTrackerFormat: form.TrackerURLFormat, |
|
|
|