summaryrefslogtreecommitdiffstats
path: root/templates/shared/searchfile.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/shared/searchfile.tmpl')
-rw-r--r--templates/shared/searchfile.tmpl25
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>