this repo has no description
1{{ define "repo/fragments/splitDiff" }}
2 {{ $name := .Id }}
3 {{- $lineNrStyle := "min-w-[3.5rem] flex-shrink-0 select-none text-right bg-white dark:bg-gray-800" -}}
4 {{- $linkStyle := "text-gray-400 dark:text-gray-500 hover:underline" -}}
5 {{- $lineNrSepStyle := "pr-2 border-r border-gray-200 dark:border-gray-700" -}}
6 {{- $containerStyle := "flex min-w-full items-center target:border target:rounded-sm target:border-yellow-200 target:dark:border-yellow-700 scroll-mt-20" -}}
7 {{- $emptyStyle := "bg-gray-200/30 dark:bg-gray-700/30" -}}
8 {{- $addStyle := "bg-green-100 dark:bg-green-800/30 text-green-700 dark:text-green-400" -}}
9 {{- $delStyle := "bg-red-100 dark:bg-red-800/30 text-red-700 dark:text-red-400 " -}}
10 {{- $ctxStyle := "bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400" -}}
11 {{- $opStyle := "w-5 flex-shrink-0 select-none text-center" -}}
12 <div class="grid grid-cols-2 divide-x divide-gray-200 dark:divide-gray-700">
13 <pre
14 class="overflow-x-auto col-span-1"><div class="overflow-x-auto"><div class="min-w-full inline-block">{{- range .TextFragments -}}
15 <div
16 class="bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 select-none text-center">
17 ···
18 </div>
19 {{- range .LeftLines -}}
20 {{- if .IsEmpty -}}
21 <div class="{{ $emptyStyle }} {{ $containerStyle }}">
22 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle }}">
23 <span aria-hidden="true" class="invisible">
24 {{ .LineNumber }}
25 </span>
26 </div>
27 <div class="{{ $opStyle }}">
28 <span aria-hidden="true" class="invisible">{{ .Op.String }}</span>
29 </div>
30 <div class="px-2 invisible" aria-hidden="true">{{ .Content }}</div>
31 </div>
32 {{- else if eq .Op.String "-" -}}
33 <div
34 class="{{ $delStyle }} {{ $containerStyle }}"
35 id="{{ $name }}-O{{ .LineNumber }}">
36 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle }}">
37 <a
38 class="{{ $linkStyle }}"
39 href="#{{ $name }}-O{{ .LineNumber }}">
40 {{ .LineNumber }}
41 </a>
42 </div>
43 <div class="{{ $opStyle }}">{{ .Op.String }}</div>
44 <div class="px-2">{{ .Content }}</div>
45 </div>
46 {{- else if eq .Op.String " " -}}
47 <div
48 class="{{ $ctxStyle }} {{ $containerStyle }}"
49 id="{{ $name }}-O{{ .LineNumber }}">
50 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle }}">
51 <a
52 class="{{ $linkStyle }}"
53 href="#{{ $name }}-O{{ .LineNumber }}">
54 {{ .LineNumber }}
55 </a>
56 </div>
57 <div class="{{ $opStyle }}">{{ .Op.String }}</div>
58 <div class="px-2">{{ .Content }}</div>
59 </div>
60 {{- end -}}
61 {{- end -}}
62 {{- end -}}
63 </div></div></pre>
64
65 <pre
66 class="overflow-x-auto col-span-1"><div class="overflow-x-auto"><div class="min-w-full inline-block">{{- range .TextFragments -}}
67 <div
68 class="bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 select-none text-center">
69 ···
70 </div>
71 {{- range .RightLines -}}
72 {{- if .IsEmpty -}}
73 <div class="{{ $emptyStyle }} {{ $containerStyle }}">
74 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle }}">
75 <span aria-hidden="true" class="invisible">
76 {{ .LineNumber }}
77 </span>
78 </div>
79 <div class="{{ $opStyle }}">
80 <span aria-hidden="true" class="invisible">{{ .Op.String }}</span>
81 </div>
82 <div class="px-2 invisible" aria-hidden="true">{{ .Content }}</div>
83 </div>
84 {{- else if eq .Op.String "+" -}}
85 <div
86 class="{{ $addStyle }} {{ $containerStyle }}"
87 id="{{ $name }}-N{{ .LineNumber }}">
88 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle }}">
89 <a
90 class="{{ $linkStyle }}"
91 href="#{{ $name }}-N{{ .LineNumber }}">
92 {{ .LineNumber }}
93 </a>
94 </div>
95 <div class="{{ $opStyle }}">{{ .Op.String }}</div>
96 <div class="px-2">{{ .Content }}</div>
97 </div>
98 {{- else if eq .Op.String " " -}}
99 <div
100 class="{{ $ctxStyle }} {{ $containerStyle }}"
101 id="{{ $name }}-N{{ .LineNumber }}">
102 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle }}">
103 <a
104 class="{{ $linkStyle }}"
105 href="#{{ $name }}-N{{ .LineNumber }}">
106 {{ .LineNumber }}
107 </a>
108 </div>
109 <div class="{{ $opStyle }}">{{ .Op.String }}</div>
110 <div class="px-2">{{ .Content }}</div>
111 </div>
112 {{- end -}}
113 {{- end -}}
114 {{- end -}}</div></div></pre>
115 </div>
116{{ end }}