diff options
author | Unknwon <u@gogs.io> | 2015-11-25 20:10:25 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-25 20:10:25 -0500 |
commit | 2b10fdc4dcb987b347b031f460cf4f02fd48a31a (patch) | |
tree | f3f723c75684c4213a58d57a2ce0b6afdc597d25 /models | |
parent | 2f28a0310b0f391dd74bb3a2ab0ae06379a4fb1a (diff) | |
download | gitea-2b10fdc4dcb987b347b031f460cf4f02fd48a31a.tar.gz gitea-2b10fdc4dcb987b347b031f460cf4f02fd48a31a.zip |
Wiki: UI for page new
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go index b628e7521b..485523a0f1 100644 --- a/models/repo.go +++ b/models/repo.go @@ -264,6 +264,14 @@ func (repo *Repository) RepoPath() (string, error) { return repo.repoPath(x) } +func (repo *Repository) WikiPath() (string, error) { + if err := repo.GetOwner(); err != nil { + return "", err + } + + return WikiPath(repo.Owner.Name, repo.Name), nil +} + func (repo *Repository) RepoLink() (string, error) { if err := repo.GetOwner(); err != nil { return "", err @@ -877,6 +885,11 @@ func RepoPath(userName, repoName string) string { return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".git") } +// WikiPath returns wiki data path by given user and repository name. +func WikiPath(userName, repoName string) string { + return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".wiki.git") +} + // TransferOwnership transfers all corresponding setting from old user to new one. func TransferOwnership(u *User, newOwnerName string, repo *Repository) error { newOwner, err := GetUserByName(newOwnerName) |