Skip to content

Commit efc5fb9

Browse files
committed
Add ..
1 parent 4f6bdf8 commit efc5fb9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

routers/web/repo/wiki.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ func WikiPages(ctx *context.Context) {
731731
}
732732
ctx.Data["Pages"] = pages
733733
ctx.Data["PageDir"] = ctx.PathParamRaw("*")
734+
ctx.Data["ParentPageDir"] = path.Dir(ctx.PathParamRaw("*"))
734735

735736
ctx.HTML(http.StatusOK, tplWikiPages)
736737
}

templates/repo/wiki/pages.tmpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
{{if .IsRepositoryAdmin}}<div>{{ctx.Locale.Tr "repo.default_branch"}}: {{.Repository.DefaultWikiBranch}}</div>{{end}}
1414
<table class="ui table wiki-pages-list">
1515
<tbody>
16+
{{if .PageDir}}
17+
<tr>
18+
<td>
19+
{{svg "octicon-file-directory-fill"}}
20+
<a href="{{.RepoLink}}/wiki/{{.ParentPageDir}}?action=_pages">..</a>
21+
</td>
22+
<td></td>
23+
</tr>
24+
{{end}}
1625
{{range .Pages}}
1726
<tr>
1827
<td>

0 commit comments

Comments
 (0)