Browse Source

#2114 External URL for wiki

for-closed-social
Unknwon 9 years ago
parent
commit
40f3142264
11 changed files with 33 additions and 6 deletions
  1. +1
    -1
      README.md
  2. +3
    -0
      conf/locale/locale_en-US.ini
  3. +1
    -1
      gogs.go
  4. +2
    -0
      models/repo.go
  5. +2
    -0
      modules/auth/repo_form.go
  6. +2
    -2
      modules/bindata/bindata.go
  7. +1
    -0
      routers/repo/http.go
  8. +2
    -0
      routers/repo/setting.go
  9. +6
    -0
      routers/repo/wiki.go
  10. +1
    -1
      templates/.VERSION
  11. +12
    -1
      templates/repo/settings/options.tmpl

+ 1
- 1
README.md View File

@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](public/img/gogs-large-resize.png)
##### Current version: 0.7.41 Beta
##### Current version: 0.7.42 Beta
| Web | UI | Preview |
|:-------------:|:-------:|:-------:|

+ 3
- 0
conf/locale/locale_en-US.ini View File

@ -569,6 +569,9 @@ settings.update_settings = Update Settings
settings.change_reponame_prompt = This change will affect how links relate to the repository.
settings.advanced_settings = Advanced Settings
settings.wiki_desc = Enable wiki to allow people write documents
settings.use_external_wiki = Use external wiki
settings.external_wiki_url = External Wiki URL
settings.external_wiki_url_desc = Visitors will be redirected to URL when they click on the tab.
settings.issues_desc = Enable builtin lightweight issue tracker
settings.use_external_issue_tracker = Use external issue tracker
settings.tracker_url_format = External Issue Tracker URL Format

+ 1
- 1
gogs.go View File

@ -18,7 +18,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
const APP_VER = "0.7.41.1210 Beta"
const APP_VER = "0.7.42.1211 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())

+ 2
- 0
models/repo.go View File

@ -164,6 +164,8 @@ type Repository struct {
// Advanced settings
EnableWiki bool `xorm:"NOT NULL DEFAULT true"`
EnableExternalWiki bool
ExternalWikiURL string
EnableIssues bool `xorm:"NOT NULL DEFAULT true"`
EnableExternalTracker bool
ExternalTrackerFormat string

+ 2
- 0
modules/auth/repo_form.go View File

@ -91,6 +91,8 @@ type RepoSettingForm struct {
// Advanced settings
EnableWiki bool
EnableExternalWiki bool
ExternalWikiURL string
EnableIssues bool
EnableExternalTracker bool
TrackerURLFormat string

+ 2
- 2
modules/bindata/bindata.go
File diff suppressed because it is too large
View File


+ 1
- 0
routers/repo/http.go View File

@ -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

+ 2
- 0
routers/repo/setting.go View File

@ -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

+ 6
- 0
routers/repo/wiki.go View File

@ -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
}
}

+ 1
- 1
templates/.VERSION View File

@ -1 +1 @@
0.7.41.1210 Beta
0.7.42.1211 Beta

+ 12
- 1
templates/repo/settings/options.tmpl View File

@ -84,6 +84,17 @@
<label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<input name="enable_external_wiki" type="checkbox" {{if .Repository.EnableExternalWiki}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
</div>
</div>
<div class="field">
<label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
<input id="external_wiki_url" name="external_wiki_url" type="url" value="{{.Repository.ExternalWikiURL}}">
<p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
</div>
<div class="ui divider"></div>
@ -102,7 +113,7 @@
</div>
<div class="field">
<label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
<input id="tracker_url_format" name="tracker_url_format" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
<input id="tracker_url_format" name="tracker_url_format" type="url" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
<p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
</div>

Loading…
Cancel
Save