rin
Публичный Open-source lightweight git hosting.
commits.html · 66 строк · 2.8 KB
Raw
1 {{define "content"}}
2 <div class="container">
3 {{template "repo_header" .}}
4
5 <div class="flex items-center justify-between flex-wrap gap-2 mb-3">
6 <div class="dropdown" data-dropdown>
7 <button type="button" class="btn btn-outline btn-sm font-mono" data-dropdown-trigger aria-haspopup="true" aria-expanded="false">
8 {{icon "git-branch" "size-3.5"}}
9 <span>{{.Ref}}</span>
10 {{icon "chevron-down" "size-3.5"}}
11 </button>
12 <div class="dropdown-menu" data-dropdown-menu role="menu" style="min-width:13rem;">
13 <div class="palette-group-title">{{t .Lang "repo.branches"}}</div>
14 {{range .Branches}}
15 <a href="/{{$.Repo.OwnerUsername}}/{{$.Repo.Name}}/commits/{{.}}" class="dropdown-item font-mono {{if eq . $.Ref}}active{{end}}" role="menuitem">
16 <span class="flex items-center gap-2">{{icon "git-branch" "size-3.5"}} {{.}}</span>
17 {{if eq . $.Ref}}{{icon "check" "size-3.5"}}{{end}}
18 </a>
19 {{end}}
20 </div>
21 </div>
22
23 <span class="text-xs text-muted">{{t .Lang "repo.history"}} · {{.Ref}}</span>
24 </div>
25
26 {{if .Commits}}
27 <div class="card">
28 {{range .Commits}}
29 <div class="dense-row" style="min-height:2.6rem;padding:0.4rem 0.85rem;">
30 <div class="flex items-center gap-2.5 min-w-0">
31 {{icon "git-commit" "size-4"}}
32 <div class="min-w-0">
33 <a href="/{{$.Repo.OwnerUsername}}/{{$.Repo.Name}}/commit/{{.Hash}}" class="font-medium text-sm truncate block">{{.Subject}}</a>
34 <div class="text-xs text-muted flex items-center gap-1.5 mt-1">
35 <span>{{.AuthorName}}</span>
36 <span>·</span>
37 <span>{{timeAgo .AuthoredAt $.Lang}}</span>
38 </div>
39 </div>
40 </div>
41
42 <div class="flex items-center gap-1.5">
43 <a href="/{{$.Repo.OwnerUsername}}/{{$.Repo.Name}}/commit/{{.Hash}}" class="btn btn-outline btn-sm font-mono">{{.ShortHash}}</a>
44 <button type="button" class="btn btn-ghost btn-icon" style="width:1.7rem;height:1.7rem;" data-copy="{{.Hash}}" aria-label="{{t $.Lang "common.copy"}}">
45 {{icon "copy" "size-3.5"}}
46 </button>
47 </div>
48 </div>
49 {{end}}
50 </div>
51
52 <div class="flex items-center justify-between mt-4">
53 {{if gt .Page 1}}
54 <a href="?page={{sub .Page 1}}" class="btn btn-outline btn-sm">{{icon "arrow-left" "size-3.5"}} {{t .Lang "common.newer"}}</a>
55 {{else}}
56 <span></span>
57 {{end}}
58 {{if .HasMore}}
59 <a href="?page={{add .Page 1}}" class="btn btn-outline btn-sm">{{t .Lang "common.older"}} {{icon "arrow-right" "size-3.5"}}</a>
60 {{end}}
61 </div>
62 {{else}}
63 {{template "ui_empty_state" (dict "Icon" "git-commit" "Title" (t .Lang "repo.no_commits"))}}
64 {{end}}
65 </div>
66 {{end}}