aboutsummaryrefslogtreecommitdiff
path: root/templates/gitlist.qtpl
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2025-02-06 22:56:46 +0100
committerGabriel A. Giovanini <mail@gabrielgio.me>2025-02-06 22:56:46 +0100
commit77f5ad1047dc2ae72cd616dc2acc839ea38d881f (patch)
tree81f3d562ee93252e52e3ede5e3167ed62a96f84f /templates/gitlist.qtpl
parentcb9036aab96895ddf03cab68f75d3356f5227968 (diff)
downloadcerrado-77f5ad1047dc2ae72cd616dc2acc839ea38d881f.tar.gz
cerrado-77f5ad1047dc2ae72cd616dc2acc839ea38d881f.tar.bz2
cerrado-77f5ad1047dc2ae72cd616dc2acc839ea38d881f.zip
feat: Add last commit information
Diffstat (limited to 'templates/gitlist.qtpl')
-rw-r--r--templates/gitlist.qtpl15
1 files changed, 15 insertions, 0 deletions
diff --git a/templates/gitlist.qtpl b/templates/gitlist.qtpl
index fc047eb..4f25fc6 100644
--- a/templates/gitlist.qtpl
+++ b/templates/gitlist.qtpl
@@ -1,5 +1,6 @@
{% import "git.gabrielgio.me/cerrado/pkg/service" %}
{% import "context" %}
+{% import "strings" %}
{% code
type GitListPage struct {
@@ -8,6 +9,16 @@ type GitListPage struct {
}
%}
+
+{% code func firstLine(text string) string {
+ lines := strings.Split(text, "\n")
+ if len(lines) > 0 {
+ return lines[0]
+ }
+ return ""
+}
+%}
+
{% func (p *GitListPage) Title(ctx context.Context) %}Git | List{% endfunc %}
{% func (p *GitListPage) Navbar(ctx context.Context) %}{%= Navbar(ctx, Git) %}{% endfunc %}
@@ -28,6 +39,10 @@ type GitListPage struct {
</div>
</hr>
<p>{%s r.Description %}</p>
+ <p style="background: #dadada">
+ <a title="{%s r.LastCommit.Hash.String() %}" href="/{%s r.Name %}/commit/{%s r.LastCommit.Hash.String() %}/">{%s r.LastCommit.Hash.String()[0:8] %}</a> -
+ <a title="{%s r.LastCommit.Author.Email %}">{%s r.LastCommit.Author.Name %}</a> -
+ {%s firstLine(r.LastCommit.Message) %}</p>
<p>
<a href="/{%s r.Name %}/log/{%s r.Ref %}/">log</a>
<a href="/{%s r.Name %}/tree/{%s r.Ref %}/">tree</a>