diff options
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/commit_page.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/commits_list.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/diff/box.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/diff/options_dropdown.tmpl | 3 |
4 files changed, 15 insertions, 4 deletions
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 372cc4fb93..f19292fd99 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -18,9 +18,11 @@ {{end}} {{end}} <div class="ui top attached info clearing segment {{$class}}"> + {{if not $.PageIsWiki}} <a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}"> {{.i18n.Tr "repo.diff.browse_source"}} </a> + {{end}} <h3><span class="message-wrapper"><span class="commit-summary" title="{{.Commit.Summary}}">{{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</span></span>{{template "repo/commit_status" .CommitStatus}}</h3> {{if IsMultilineCommitMessage .Commit.Message}} <pre class="commit-body">{{RenderCommitBody .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre> @@ -61,7 +63,11 @@ </div> <div class="item"> {{range .Parents}} - <a class="ui blue sha label" href="{{$.RepoLink}}/commit/{{.}}">{{ShortSha .}}</a> + {{if $.PageIsWiki}} + <a class="ui blue sha label" href="{{$.RepoLink}}/wiki/commit/{{.}}">{{ShortSha .}}</a> + {{else}} + <a class="ui blue sha label" href="{{$.RepoLink}}/commit/{{.}}">{{ShortSha .}}</a> + {{end}} {{end}} </div> {{end}} diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 92da6c1b29..ad2369c042 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -39,7 +39,9 @@ {{$class = (printf "%s%s" $class " isWarning")}} {{end}} {{end}} - {{if $.Reponame}} + {{if $.PageIsWiki}} + <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/wiki/commit/{{.ID}}" rel="nofollow" class="{{$class}}"> + {{else if $.Reponame}} <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}"> {{else}} <span class="{{$class}}"> 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 @@ </div> <span class="file">{{$file.Name}}</span> <div>{{$.i18n.Tr "repo.diff.file_suppressed"}}</div> - {{if not $file.IsSubmodule}} + {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} <a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a> {{else}} @@ -103,7 +103,7 @@ {{end}} </div> <span class="file">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{end}}</span> - {{if not $file.IsSubmodule}} + {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} <a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a> {{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}} <a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a> <a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a> + {{else if $.PageIsWiki}} + <a class="item" href="{{$.RepoLink}}/wiki/commit/{{.Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a> + <a class="item" href="{{$.RepoLink}}/wiki/commit/{{.Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a> {{else if .Commit.ID.String}} <a class="item" href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a> <a class="item" href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a> |