mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 10:19:54 +02:00
#2114 External URL for wiki
This commit is contained in:
1 parent
b21160a13a
commit
40f3142264
11 files changed
+33
-6
No files matched your search
@@ -496,6 +496,7 @@ func updateServerInfo(gitBinPath, dir string) []byte {
|
||||
return gitCommand(gitBinPath, dir, args...)
|
||||
}
|
||||
|
||||
// FIXME: use process module
|
||||
func gitCommand(gitBinPath, dir string, args ...string) []byte {
|
||||
command := exec.Command(gitBinPath, args...)
|
||||
command.Dir = dir
|
||||
|
||||
@@ -125,6 +125,8 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
|
||||
case "advanced":
|
||||
repo.EnableWiki = form.EnableWiki
|
||||
repo.EnableExternalWiki = form.EnableExternalWiki
|
||||
repo.ExternalWikiURL = form.ExternalWikiURL
|
||||
repo.EnableIssues = form.EnableIssues
|
||||
repo.EnableExternalTracker = form.EnableExternalTracker
|
||||
repo.ExternalTrackerFormat = form.TrackerURLFormat
|
||||
|
||||
@@ -27,6 +27,12 @@ const (
|
||||
func MustEnableWiki(ctx *middleware.Context) {
|
||||
if !ctx.Repo.Repository.EnableWiki {
|
||||
ctx.Handle(404, "MustEnableWiki", nil)
|
||||
return
|
||||
}
|
||||
|
||||
if ctx.Repo.Repository.EnableExternalWiki {
|
||||
ctx.Redirect(ctx.Repo.Repository.ExternalWikiURL)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user