Implementation of the feature to redirect to an external issue tracker
This commit is contained in:
parent
4a5faecd8f
commit
8dc49dc114
7 changed files with 18 additions and 3 deletions
|
@ -52,10 +52,15 @@ var (
|
|||
)
|
||||
|
||||
func MustEnableIssues(ctx *context.Context) {
|
||||
if !ctx.Repo.Repository.EnableIssues || ctx.Repo.Repository.EnableExternalTracker {
|
||||
if !ctx.Repo.Repository.EnableIssues {
|
||||
ctx.Handle(404, "MustEnableIssues", nil)
|
||||
return
|
||||
}
|
||||
|
||||
if ctx.Repo.Repository.EnableExternalTracker {
|
||||
ctx.Redirect(ctx.Repo.Repository.ExternalTrackerURL)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func MustAllowPulls(ctx *context.Context) {
|
||||
|
|
|
@ -146,6 +146,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
|
|||
repo.ExternalWikiURL = form.ExternalWikiURL
|
||||
repo.EnableIssues = form.EnableIssues
|
||||
repo.EnableExternalTracker = form.EnableExternalTracker
|
||||
repo.ExternalTrackerURL = form.ExternalTrackerURL
|
||||
repo.ExternalTrackerFormat = form.TrackerURLFormat
|
||||
repo.ExternalTrackerStyle = form.TrackerIssueStyle
|
||||
repo.EnablePulls = form.EnablePulls
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue