repos.html
·
78 строк
·
3.2 KB
| 1 | {{define "content"}} |
| 2 | <div class="container"> |
| 3 | {{if .ProfileUser}} |
| 4 | <div class="card p-4 mb-4 flex items-center justify-between flex-wrap gap-3"> |
| 5 | <div class="flex items-center gap-3"> |
| 6 | <span class="avatar avatar-lg">{{avatarInitial .ProfileUser.Username}}</span> |
| 7 | <div> |
| 8 | <div class="flex items-center gap-2"> |
| 9 | <h1 class="text-lg font-semibold" style="margin:0;">{{.ProfileUser.Username}}</h1> |
| 10 | {{if .ProfileUser.IsAdmin}} |
| 11 | <span class="badge">{{t .Lang "admin.role.admin"}}</span> |
| 12 | {{end}} |
| 13 | </div> |
| 14 | {{if .ProfileUser.Bio}} |
| 15 | <p class="text-sm text-muted mt-1" style="margin-bottom:0;">{{.ProfileUser.Bio}}</p> |
| 16 | {{end}} |
| 17 | </div> |
| 18 | </div> |
| 19 | {{if .CurrentUser}} |
| 20 | {{if eq .CurrentUser.ID .ProfileUser.ID}} |
| 21 | <a href="/settings" class="btn btn-outline btn-sm">{{icon "settings" "size-3.5"}} {{t .Lang "nav.settings"}}</a> |
| 22 | {{end}} |
| 23 | {{end}} |
| 24 | </div> |
| 25 | {{end}} |
| 26 | |
| 27 | <div class="flex items-center justify-between flex-wrap gap-3 mb-4"> |
| 28 | <h2 class="text-lg font-semibold" style="margin:0;">{{.PageHeading}}</h2> |
| 29 | <div class="flex items-center gap-2"> |
| 30 | <div class="flex items-center" style="position:relative;"> |
| 31 | <input type="text" class="input" style="height:1.9rem;width:14rem;padding-right:1.8rem;" placeholder="{{t .Lang "repo.filter_ph"}}" data-search-input data-file-filter> |
| 32 | <kbd class="kbd" style="position:absolute;right:0.4rem;pointer-events:none;">/</kbd> |
| 33 | </div> |
| 34 | {{if .CurrentUser}} |
| 35 | <a href="/new" class="btn btn-primary"> |
| 36 | {{icon "plus" "size-4"}} |
| 37 | <span>{{t .Lang "nav.new_repo"}}</span> |
| 38 | </a> |
| 39 | {{end}} |
| 40 | </div> |
| 41 | </div> |
| 42 | |
| 43 | {{if .Repos}} |
| 44 | <div class="card"> |
| 45 | {{range .Repos}} |
| 46 | <div class="dense-row" style="min-height:2.5rem;padding:0.4rem 0.85rem;" data-tree-row data-tree-name="{{.OwnerUsername}}/{{.Name}} {{.Description}}"> |
| 47 | <div class="flex items-center gap-2 min-w-0"> |
| 48 | {{if .IsPrivate}} |
| 49 | {{icon "lock" "size-4"}} |
| 50 | {{else}} |
| 51 | {{icon "git-branch" "size-4"}} |
| 52 | {{end}} |
| 53 | <a href="/{{.OwnerUsername}}/{{.Name}}" class="font-medium text-sm"> |
| 54 | <span class="text-muted">{{.OwnerUsername}} /</span> <strong>{{.Name}}</strong> |
| 55 | </a> |
| 56 | {{if .IsPrivate}} |
| 57 | <span class="badge badge-outline">{{t $.Lang "repo.private"}}</span> |
| 58 | {{end}} |
| 59 | {{if .Description}} |
| 60 | <span class="text-xs text-muted truncate">— {{.Description}}</span> |
| 61 | {{end}} |
| 62 | </div> |
| 63 | <div class="flex items-center gap-2.5 text-xs text-muted"> |
| 64 | <span class="font-mono">{{.DefaultBranch}}</span> |
| 65 | <span>{{timeAgo .UpdatedAt $.Lang}}</span> |
| 66 | </div> |
| 67 | </div> |
| 68 | {{end}} |
| 69 | </div> |
| 70 | {{else}} |
| 71 | {{if .CurrentUser}} |
| 72 | {{template "ui_empty_state" (dict "Icon" "git-branch" "Title" (t .Lang "repo.empty_list") "Subtitle" (t .Lang "repo.empty_list_sub") "ActionHref" "/new" "ActionLabel" (t .Lang "repo.new.title") "ActionIcon" "plus")}} |
| 73 | {{else}} |
| 74 | {{template "ui_empty_state" (dict "Icon" "git-branch" "Title" (t .Lang "repo.empty_list"))}} |
| 75 | {{end}} |
| 76 | {{end}} |
| 77 | </div> |
| 78 | {{end}} |