@@ -33,6 +33,7 @@ import (
33
33
"code.gitea.io/gitea/services/forms"
34
34
git_service "code.gitea.io/gitea/services/git"
35
35
notify_service "code.gitea.io/gitea/services/notify"
36
+ repo_service "code.gitea.io/gitea/services/repository"
36
37
wiki_service "code.gitea.io/gitea/services/wiki"
37
38
)
38
39
@@ -474,7 +475,7 @@ func Wiki(ctx *context.Context) {
474
475
return
475
476
}
476
477
477
- if ! ctx .Repo .Repository . HasWiki ( ) {
478
+ if ! repo_service . HasWiki ( ctx , ctx .Repo .Repository ) {
478
479
ctx .Data ["Title" ] = ctx .Tr ("repo.wiki" )
479
480
ctx .HTML (http .StatusOK , tplWikiStart )
480
481
return
@@ -510,7 +511,7 @@ func Wiki(ctx *context.Context) {
510
511
func WikiRevision (ctx * context.Context ) {
511
512
ctx .Data ["CanWriteWiki" ] = ctx .Repo .CanWrite (unit .TypeWiki ) && ! ctx .Repo .Repository .IsArchived
512
513
513
- if ! ctx .Repo .Repository . HasWiki ( ) {
514
+ if ! repo_service . HasWiki ( ctx , ctx .Repo .Repository ) {
514
515
ctx .Data ["Title" ] = ctx .Tr ("repo.wiki" )
515
516
ctx .HTML (http .StatusOK , tplWikiStart )
516
517
return
@@ -540,7 +541,7 @@ func WikiRevision(ctx *context.Context) {
540
541
541
542
// WikiPages render wiki pages list page
542
543
func WikiPages (ctx * context.Context ) {
543
- if ! ctx .Repo .Repository . HasWiki ( ) {
544
+ if ! repo_service . HasWiki ( ctx , ctx .Repo .Repository ) {
544
545
ctx .Redirect (ctx .Repo .RepoLink + "/wiki" )
545
546
return
546
547
}
@@ -648,7 +649,7 @@ func WikiRaw(ctx *context.Context) {
648
649
func NewWiki (ctx * context.Context ) {
649
650
ctx .Data ["Title" ] = ctx .Tr ("repo.wiki.new_page" )
650
651
651
- if ! ctx .Repo .Repository . HasWiki ( ) {
652
+ if ! repo_service . HasWiki ( ctx , ctx .Repo .Repository ) {
652
653
ctx .Data ["title" ] = "Home"
653
654
}
654
655
if ctx .FormString ("title" ) != "" {
@@ -701,7 +702,7 @@ func NewWikiPost(ctx *context.Context) {
701
702
func EditWiki (ctx * context.Context ) {
702
703
ctx .Data ["PageIsWikiEdit" ] = true
703
704
704
- if ! ctx .Repo .Repository . HasWiki ( ) {
705
+ if ! repo_service . HasWiki ( ctx , ctx .Repo .Repository ) {
705
706
ctx .Redirect (ctx .Repo .RepoLink + "/wiki" )
706
707
return
707
708
}
0 commit comments