Wiki: UI for page new
This commit is contained in:
parent
2f28a0310b
commit
2b10fdc4dc
20 changed files with 307 additions and 49 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue