tangled
alpha
login
or
join now
moll.dev
/
core
forked from
tangled.org/core
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
better commit messages, fix html escaping in code
oppi.li
1 year ago
e160b0db
4304f90b
+19
-2
3 changed files
expand all
collapse all
unified
split
appview
pages
pages.go
templates
repo
blob.html
index.html
+6
appview/pages/pages.go
···
73
"length": func(v []string) int {
74
return len(v)
75
},
0
0
0
0
0
0
76
}
77
}
78
···
73
"length": func(v []string) int {
74
return len(v)
75
},
76
+
"splitN": func(s, sep string, n int) []string {
77
+
return strings.SplitN(s, sep, n)
78
+
},
79
+
"unescapeHtml": func(s string) template.HTML {
80
+
return template.HTML(s)
81
+
},
82
}
83
}
84
+1
-1
appview/pages/templates/repo/blob.html
···
18
{{ if .IsBinary }}<p class="text-center text-gray-400">This is a binary file and will not be displayed.</p>{{ else }}
19
<pre class="font-mono text-sm overflow-auto relative text-ellipsis"><code>{{ range $idx, $line := $lines }}<span class="flex">
20
<span class="{{ $code_number_style }}" style="min-width: {{$tot_chars}}ch;">{{ add $idx 1 }}</span>
21
-
<span class="whitespace-pre">{{ $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre>{{ end}}
22
{{ end }}
···
18
{{ if .IsBinary }}<p class="text-center text-gray-400">This is a binary file and will not be displayed.</p>{{ else }}
19
<pre class="font-mono text-sm overflow-auto relative text-ellipsis"><code>{{ range $idx, $line := $lines }}<span class="flex">
20
<span class="{{ $code_number_style }}" style="min-width: {{$tot_chars}}ch;">{{ add $idx 1 }}</span>
21
+
<span class="whitespace-pre">{{ unescapeHtml $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre>{{ end}}
22
{{ end }}
+12
-1
appview/pages/templates/repo/index.html
···
51
before:top-1/2
52
before:-translate-y-1/2
53
">
54
-
<div class="text-base">{{ .Message }}</div>
0
0
0
0
0
0
0
0
0
0
0
55
56
<div class="text-xs text-gray-500">
57
<span class="font-mono">
···
51
before:top-1/2
52
before:-translate-y-1/2
53
">
54
+
55
+
<div id="commit-message">
56
+
{{ $messageParts := splitN .Message "\n\n" 2 }}
57
+
<div class="text-base cursor-pointer">
58
+
{{ index $messageParts 0 }}
59
+
{{ if gt (len $messageParts) 1 }}
60
+
<div class="text-sm inline rounded-sm bg-gray-300 text-gray-700 px-1"
61
+
hx-on:click="this.nextElementSibling.classList.toggle('hidden')">...</div>
62
+
<div class="hidden mt-1 text-sm">{{ index $messageParts 1 }}</div>
63
+
{{ end }}
64
+
</div>
65
+
</div>
66
67
<div class="text-xs text-gray-500">
68
<span class="font-mono">