HTML · 5747 bytes Raw Blame History
1 {{ define "page" -}}
2 <section class="shithub-org-repositories-page">
3 <header class="shithub-org-pagehead">
4 <div class="shithub-org-pagehead-inner">
5 <a class="shithub-org-pagehead-title" href="/{{ .Org.Slug }}">
6 <img src="{{ .AvatarURL }}" alt="" width="30" height="30">
7 <span>{{ if .Org.DisplayName }}{{ .Org.DisplayName }}{{ else }}{{ .Org.Slug }}{{ end }}</span>
8 </a>
9 </div>
10 </header>
11
12 <main class="shithub-org-repositories-shell">
13 <div class="shithub-org-repositories-titlebar">
14 <div>
15 <h1>Repositories</h1>
16 <p>
17 {{ if .HasActiveFilters }}
18 {{ .FilteredCount }} result{{ if ne .FilteredCount 1 }}s{{ end }}
19 {{ else }}
20 {{ .RepoCount }} repositor{{ if eq .RepoCount 1 }}y{{ else }}ies{{ end }}
21 {{ end }}
22 </p>
23 </div>
24 {{ if .CanCreateRepo }}<a href="/new?owner={{ .Org.Slug }}" class="shithub-button shithub-button-primary">{{ octicon "repo" }} New</a>{{ end }}
25 </div>
26
27 <div class="shithub-org-repositories-toolbar">
28 <form action="/orgs/{{ .Org.Slug }}/repositories" method="get" role="search" class="shithub-org-repositories-search">
29 <span aria-hidden="true">{{ octicon "search" }}</span>
30 <label class="sr-only" for="org-repositories-search">Find a repository</label>
31 <input id="org-repositories-search" type="search" name="q" value="{{ .Query }}" placeholder="Find a repository...">
32 {{ if ne .SelectedType "all" }}<input type="hidden" name="type" value="{{ .SelectedType }}">{{ end }}
33 {{ if .SelectedLanguage }}<input type="hidden" name="language" value="{{ .SelectedLanguage }}">{{ end }}
34 {{ if ne .SelectedSort "updated" }}<input type="hidden" name="sort" value="{{ .SelectedSort }}">{{ end }}
35 </form>
36
37 <div class="shithub-org-repositories-filters">
38 <details class="shithub-filter-menu">
39 <summary>Type: <span>{{ .SelectedTypeLabel }}</span> {{ octicon "triangle-down" }}</summary>
40 <div>
41 {{ range .TypeFilters }}
42 <a href="{{ .Href }}" class="{{ if .Selected }}is-selected{{ end }}">{{ .Label }} <span class="shithub-filter-count">{{ .Count }}</span></a>
43 {{ end }}
44 </div>
45 </details>
46 <details class="shithub-filter-menu">
47 <summary>Language: <span>{{ .SelectedLanguageLabel }}</span> {{ octicon "triangle-down" }}</summary>
48 <div>
49 {{ range .LanguageFilters }}
50 <a href="{{ .Href }}" class="{{ if .Selected }}is-selected{{ end }}">{{ .Label }} <span class="shithub-filter-count">{{ .Count }}</span></a>
51 {{ end }}
52 </div>
53 </details>
54 <details class="shithub-filter-menu">
55 <summary>Sort: <span>{{ .SelectedSortLabel }}</span> {{ octicon "triangle-down" }}</summary>
56 <div>
57 {{ range .SortOptions }}
58 <a href="{{ .Href }}" class="{{ if .Selected }}is-selected{{ end }}">{{ .Label }}</a>
59 {{ end }}
60 </div>
61 </details>
62 </div>
63 </div>
64
65 {{ if .Repos }}
66 <ul class="shithub-org-repo-list shithub-org-repositories-list">
67 {{ range .Repos }}
68 <li class="shithub-org-repo-row">
69 <div class="shithub-org-repo-row-main">
70 <h3>
71 <a href="/{{ $.Org.Slug }}/{{ .Name }}">{{ .Name }}</a>
72 {{ if eq .Visibility "private" }}<span class="shithub-pill shithub-pill-private">Private</span>{{ else }}<span class="shithub-pill">Public</span>{{ end }}
73 {{ if .IsArchived }}<span class="shithub-pill shithub-pill-archived">Archived</span>{{ end }}
74 </h3>
75 {{ if .Description }}<p>{{ .Description }}</p>{{ end }}
76 {{ if .Topics }}
77 <div class="shithub-org-row-topics">
78 {{ range .Topics }}<a href="/search?q=topic:{{ . }}&amp;type=repositories" class="shithub-topic">{{ . }}</a>{{ end }}
79 </div>
80 {{ end }}
81 <div class="shithub-org-repo-meta">
82 {{ if .PrimaryLanguage }}<span><span class="shithub-language-dot" style="background-color: {{ .PrimaryLanguageColor }};"></span>{{ .PrimaryLanguage }}</span>{{ end }}
83 {{ if .LicenseKey }}<span>{{ octicon "law" }} {{ .LicenseKey }}</span>{{ end }}
84 <span>{{ octicon "star" }} {{ .StarCount }}</span>
85 <span>{{ octicon "repo-forked" }} {{ .ForkCount }}</span>
86 <time datetime="{{ .UpdatedAt.Format "2006-01-02T15:04:05Z" }}">Updated {{ relativeTime .UpdatedAt }}</time>
87 </div>
88 </div>
89 {{ .ActivitySparkline }}
90 </li>
91 {{ end }}
92 </ul>
93 {{ else }}
94 <div class="shithub-org-empty shithub-org-repositories-empty">
95 {{ if .HasActiveFilters }}
96 <h2>No repositories matched your search.</h2>
97 <p>Try another search term or a different filter.</p>
98 {{ else }}
99 <h2>No repositories yet.</h2>
100 {{ if .CanCreateRepo }}<a href="/new?owner={{ .Org.Slug }}" class="shithub-button shithub-button-primary">Create a repository</a>{{ end }}
101 {{ end }}
102 </div>
103 {{ end }}
104
105 {{ if gt .PageCount 1 }}
106 <nav class="shithub-org-repositories-pagination" aria-label="Pagination">
107 {{ if .HasPrev }}<a href="{{ .PrevHref }}">Previous</a>{{ else }}<span class="is-disabled" aria-disabled="true">Previous</span>{{ end }}
108 {{ range .PaginationPages }}
109 {{ if .Current }}<span class="is-current" aria-current="page">{{ .Number }}</span>{{ else }}<a href="{{ .Href }}">{{ .Number }}</a>{{ end }}
110 {{ end }}
111 {{ if .HasNext }}<a href="{{ .NextHref }}">Next</a>{{ else }}<span class="is-disabled" aria-disabled="true">Next</span>{{ end }}
112 </nav>
113 {{ end }}
114 </main>
115 </section>
116 {{- end }}