diff options
author | Rémy Boulanouar <rboulanouar@gmail.com> | 2016-11-04 09:06:54 +0100 |
---|---|---|
committer | Rémy Boulanouar <rboulanouar@gmail.com> | 2016-11-04 09:06:54 +0100 |
commit | 8dc49dc1149fccda2b4da63fa63d23f2b6260466 (patch) | |
tree | 826472b0f25062dd952359e395e48c960ccdf2df /routers/repo | |
parent | 4a5faecd8f90b4849ab671051e832b3872818b0a (diff) | |
download | gitea-8dc49dc1149fccda2b4da63fa63d23f2b6260466.tar.gz gitea-8dc49dc1149fccda2b4da63fa63d23f2b6260466.zip |
Implementation of the feature to redirect to an external issue tracker
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/issue.go | 7 | ||||
-rw-r--r-- | routers/repo/setting.go | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index f638b6f51f..8e8328c7e4 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -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) { diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 4bcc470e99..869b98897c 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -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 |