]> source.dussan.org Git - gitea.git/commitdiff
Show `View at this point in history` for every commit (#29122)
authorTim-Nicas Oelschläger <72873130+zokkis@users.noreply.github.com>
Tue, 13 Feb 2024 08:07:59 +0000 (09:07 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2024 08:07:59 +0000 (09:07 +0100)
Shows the 'View at this point in history'-link (from #27354) for every
commit

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/0e5cd763-e099-4bb4-9519-653fe21f85a6)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/2b57346f-51e3-4901-b85e-63a690878939)

templates/repo/commits_list.tmpl

index 7702770c406f01f86a7854b79e449b77159d3acf..4eb31e0e8e6971999cfdf13816bae1a1d595d722 100644 (file)
                                                {{end}}
                                                <td class="text right aligned gt-py-0">
                                                        <button class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>
-                                                       {{if $.FileName}}
-                                                               <a class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{printf "%s/src/commit/%s/%s" $commitRepoLink (PathEscape .ID.String) (PathEscapeSegments $.FileName)}}">{{svg "octicon-file-code"}}</a>
-                                                       {{end}}
+                                                       <a
+                                                               class="btn interact-bg gt-p-3"
+                                                               data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}"
+                                                               href="{{if $.FileName}}{{printf "%s/src/commit/%s/%s" $commitRepoLink (PathEscape .ID.String) (PathEscapeSegments $.FileName)}}{{else}}{{printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}}{{end}}">
+                                                               {{svg "octicon-file-code"}}
+                                                       </a>
                                                </td>
                                        </tr>
                                {{end}}