···
{{ define "title" }}commits · {{ .RepoInfo.FullName }}{{ end }}
{{ define "repoContent" }}
3
-
<section id="commit-table">
4
-
<table class="w-full border-collapse">
3
+
<section id="commit-table" class="overflow-x-auto">
4
+
<!-- desktop view (hidden on small screens) -->
5
+
<table class="w-full border-collapse hidden md:table">
<thead class="bg-gray-100 dark:bg-gray-700">
<th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Author</th>
···
61
+
<!-- mobile view (visible only on small screens) -->
62
+
<div class="md:hidden">
63
+
<h2 class="p-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">commits</h2>
64
+
{{ range $commit := .Commits }}
65
+
<div class="relative p-2 border-b border-gray-200 dark:border-gray-700">
66
+
<div id="commit-message">
67
+
{{ $messageParts := splitN $commit.Message "\n\n" 2 }}
68
+
<div class="text-base cursor-pointer">
70
+
<div class="flex items-center justify-between">
71
+
<div class="flex-1">
72
+
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
73
+
class="inline no-underline hover:underline dark:text-white">
74
+
{{ index $messageParts 0 }}
76
+
{{ if gt (len $messageParts) 1 }}
78
+
class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
79
+
hx-on:click="this.nextElementSibling.classList.toggle('hidden')">
80
+
{{ i "ellipsis" "w-3 h-3" }}
83
+
{{ if gt (len $messageParts) 1 }}
84
+
<p class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300">
85
+
{{ nl2br (index $messageParts 1) }}
89
+
<a href="/{{ $.RepoInfo.FullName }}/tree/{{ $commit.Hash.String }}"
90
+
class="p-1 mr-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
91
+
title="Browse repository at this commit">
92
+
{{ i "folder-code" "w-4 h-4" }}
100
+
<div class="text-xs text-gray-500 dark:text-gray-400">
101
+
<span class="font-mono">
102
+
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
103
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline">
104
+
{{ slice $commit.Hash.String 0 8 }}
107
+
<span class="mx-2 before:content-['·'] before:select-none"></span>
109
+
{{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
110
+
<a href="{{ if $didOrHandle }}/{{ $didOrHandle }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}"
111
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline">
112
+
{{ if $didOrHandle }}{{ $didOrHandle }}{{ else }}{{ $commit.Author.Name }}{{ end }}
115
+
<div class="inline-block px-1 select-none after:content-['·']"></div>
116
+
<span>{{ shortTimeFmt $commit.Author.When }}</span>
{{ $commits_len := len .Commits }}