From b2b86ea8701cab901cd9e6a02c918aa5c61748d6 Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Sat, 16 May 2020 12:38:40 -0400 Subject: Support view individual commit for wiki pages (#11415) Currently you can see a list of commit history for wiki pages but aren't able to view the commit diff itself. This adds the feature to view an individual commit to a wiki repo. Closes #8999 Co-authored-by: Lauris BH Co-authored-by: Lunny Xiao --- templates/repo/diff/box.tmpl | 4 ++-- templates/repo/diff/options_dropdown.tmpl | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'templates/repo/diff') diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index a789350525..b6d1fdf3a0 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -69,7 +69,7 @@ {{$file.Name}}
{{$.i18n.Tr "repo.diff.file_suppressed"}}
- {{if not $file.IsSubmodule}} + {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} {{$.i18n.Tr "repo.diff.view_file"}} {{else}} @@ -103,7 +103,7 @@ {{end}} {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{end}} - {{if not $file.IsSubmodule}} + {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} {{$.i18n.Tr "repo.diff.view_file"}} {{else}} diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl index 4bc6a3b994..8dcf398240 100644 --- a/templates/repo/diff/options_dropdown.tmpl +++ b/templates/repo/diff/options_dropdown.tmpl @@ -6,6 +6,9 @@ {{if .Issue.Index}} {{.i18n.Tr "repo.diff.download_patch"}} {{.i18n.Tr "repo.diff.download_diff"}} + {{else if $.PageIsWiki}} + {{.i18n.Tr "repo.diff.download_patch"}} + {{.i18n.Tr "repo.diff.download_diff"}} {{else if .Commit.ID.String}} {{.i18n.Tr "repo.diff.download_patch"}} {{.i18n.Tr "repo.diff.download_diff"}} -- cgit v1.2.3