forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "title" }}
2 branches · {{ .RepoInfo.FullName }}
3{{ end }}
4
5{{ define "repoContent" }}
6<section id="branches-table" class="overflow-x-auto">
7 <h2 class="font-bold text-sm mb-4 uppercase dark:text-white">
8 Branches
9 </h2>
10
11 <!-- desktop view (hidden on small screens) -->
12 <table class="w-full border-collapse hidden md:table">
13 <thead>
14 <tr>
15 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Name</th>
16 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Commit</th>
17 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Message</th>
18 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Date</th>
19 </tr>
20 </thead>
21 <tbody>
22 {{ range $index, $branch := .Branches }}
23 <tr class="{{ if ne $index (sub (len $.Branches) 1) }}border-b border-gray-200 dark:border-gray-700{{ end }}">
24 <td class="py-3 whitespace-nowrap">
25 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Name | urlquery }}" class="no-underline hover:underline flex items-center gap-2">
26 <span class="dark:text-white">
27 {{ .Name }}
28 </span>
29 {{ if .IsDefault }}
30 <span class="
31 text-sm rounded
32 bg-gray-100 dark:bg-gray-700 text-black dark:text-white
33 font-mono
34 px-2 mx-1/2
35 inline-flex items-center
36 ">
37 default
38 </span>
39 {{ end }}
40 </a>
41 </td>
42 <td class="py-3 whitespace-nowrap">
43 {{ if .Commit }}
44 <a href="/{{ $.RepoInfo.FullName }}/commits/{{ .Name | urlquery }}" class="font-mono text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ slice .Commit.Hash.String 0 8 }}</a>
45 {{ end }}
46 </td>
47 <td class="py-3 whitespace-nowrap">
48 {{ if .Commit }}
49 {{ $messageParts := splitN .Commit.Message "\n\n" 2 }}
50 <span class="text-gray-700 dark:text-gray-300">{{ index $messageParts 0 }}</span>
51 {{ end }}
52 </td>
53 <td class="py-3 whitespace-nowrap text-gray-500 dark:text-gray-400">
54 {{ if .Commit }}
55 {{ .Commit.Author.When | timeFmt }}
56 {{ end }}
57 </td>
58 </tr>
59 {{ end }}
60 </tbody>
61 </table>
62
63 <!-- mobile view (visible only on small screens) -->
64 <div class="md:hidden">
65 {{ range $index, $branch := .Branches }}
66 <div class="relative p-2 {{ if ne $index (sub (len $.Branches) 1) }}border-b border-gray-200 dark:border-gray-700{{ end }}">
67 <div class="flex items-center justify-between">
68 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Name | urlquery }}" class="no-underline hover:underline flex items-center gap-2">
69 <span class="dark:text-white font-medium">
70 {{ .Name }}
71 </span>
72 {{ if .IsDefault }}
73 <span class="
74 text-xs rounded
75 bg-gray-100 dark:bg-gray-700 text-black dark:text-white
76 font-mono
77 px-2
78 inline-flex items-center
79 ">
80 default
81 </span>
82 {{ end }}
83 </a>
84 </div>
85
86 {{ if .Commit }}
87 <div class="text-xs text-gray-500 dark:text-gray-400 mt-1 flex items-center">
88 <span class="font-mono">
89 <a href="/{{ $.RepoInfo.FullName }}/commits/{{ .Name | urlquery }}" class="text-gray-500 dark:text-gray-400 no-underline hover:underline">
90 {{ slice .Commit.Hash.String 0 8 }}
91 </a>
92 </span>
93 <div class="inline-block px-1 select-none after:content-['·']"></div>
94 <span>{{ .Commit.Author.When | timeFmt }}</span>
95 </div>
96 {{ end }}
97 </div>
98 {{ end }}
99 </div>
100</section>
101{{ end }}