alpha
Login
or
Join now
dunkirk.sh
/
core
forked from
tangled.org/core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
even better commit messages
author
Anirudh Oppiliappan
date
1 year ago
(Feb 17, 2025, 7:31 AM +0200)
commit
c57fbb7c
c57fbb7cb7b2fb68fdd485bed8dd9d2b636d0aab
parent
93ba0b2d
93ba0b2d2dc00efe4f27f916a3ec08810f620490
+25
-6
2 changed files
Expand all
Collapse all
Unified
Split
appview
pages
pages.go
templates
repo
index.html
+13
appview/pages/pages.go
Reviewed
···
79
79
"unescapeHtml": func(s string) template.HTML {
80
80
return template.HTML(s)
81
81
},
82
82
+
"nl2br": func(text string) template.HTML {
83
83
+
return template.HTML(strings.Replace(template.HTMLEscapeString(text), "\n", "<br>", -1))
84
84
+
},
85
85
+
"unwrapText": func(text string) string {
86
86
+
paragraphs := strings.Split(text, "\n\n")
87
87
+
88
88
+
for i, p := range paragraphs {
89
89
+
lines := strings.Split(p, "\n")
90
90
+
paragraphs[i] = strings.Join(lines, " ")
91
91
+
}
92
92
+
93
93
+
return strings.Join(paragraphs, "\n\n")
94
94
+
},
82
95
}
83
96
}
84
97
+12
-6
appview/pages/templates/repo/index.html
Reviewed
···
103
103
<div id="commit-message">
104
104
{{ $messageParts := splitN .Message "\n\n" 2 }}
105
105
<div class="text-base cursor-pointer">
106
106
-
{{ index $messageParts 0 }}
107
107
-
{{ if gt (len $messageParts) 1 }}
108
108
-
<div class="text-sm inline rounded-sm bg-gray-300 text-gray-700 px-1"
109
109
-
hx-on:click="this.nextElementSibling.classList.toggle('hidden')">...</div>
110
110
-
<div class="hidden mt-1 text-sm">{{ index $messageParts 1 }}</div>
111
111
-
{{ end }}
106
106
+
<div>
107
107
+
<div class="flex items-center gap-1">
108
108
+
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" class="inline no-underline hover:underline hover:text-sky-400">{{ index $messageParts 0 }}</a>
109
109
+
{{ if gt (len $messageParts) 1 }}
110
110
+
<button class="text-sm inline rounded-sm bg-gray-300 text-gray-700 px-1 w-fit hover:bg-gray-400"
111
111
+
hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')">…</button>
112
112
+
{{ end }}
113
113
+
</div>
114
114
+
{{ if gt (len $messageParts) 1 }}
115
115
+
<p class="hidden mt-1 text-sm cursor-text pb-2">{{ nl2br (unwrapText (index $messageParts 1)) }}</p>
116
116
+
{{ end }}
117
117
+
</div>
112
118
</div>
113
119
</div>
114
120