diff options
author | Daniel Baumann <daniel@debian.org> | 2024-10-18 20:33:49 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2024-12-12 23:57:56 +0100 |
commit | e68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch) | |
tree | 97775d6c13b0f416af55314eb6a89ef792474615 /templates/shared/searchfile.tmpl | |
parent | Initial commit. (diff) | |
download | forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip |
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to '')
-rw-r--r-- | templates/shared/searchfile.tmpl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/templates/shared/searchfile.tmpl b/templates/shared/searchfile.tmpl new file mode 100644 index 0000000..a051742 --- /dev/null +++ b/templates/shared/searchfile.tmpl @@ -0,0 +1,25 @@ +<div class="file-body file-code code-view"> + <div> + <ol class="tw-p-0 tw-m-0"> + {{/* if the expected line number does not match + the actual line number end the ordered list + and begin a new one */}} + {{$expNum := 0}} + {{range .SearchResult.Lines}} + {{if and (gt $expNum 0) (ne .Num $expNum)}} + </ol> + <ol class="tw-p-0 tw-m-0 tw-pt-2 tw-mt-2 tw-border-t-4 tw-border-secondary"> + {{end}} + <li value="{{.Num}}" class="tw-grid tw-grid-cols-[minmax(50px,_1%)_auto] tw-list-none"> + <div class="lines-num"> + <a href="{{$.RepoLink}}/src/commit/{{PathEscape $.SearchResult.CommitID}}/{{PathEscapeSegments $.SearchResult.Filename}}#L{{.Num}}"> + {{.Num}} + </a> + </div> + <div class="lines-code chroma"><code class="code-inner">{{.FormattedContent}}</code></div> + </li> + {{$expNum = Eval .Num "+" 1}} + {{end}} + </ol> + </div> +</div> |