HTML · 6592 bytes Raw Blame History
1 {{ define "page" -}}
2 <section class="shithub-explore-page">
3 <div class="shithub-explore-shell{{ if .Viewer.ID }} has-dashboard-left{{ end }}">
4 {{ if .Viewer.ID }}
5 <aside class="shithub-dashboard-left" aria-label="Dashboard navigation">
6 <details class="shithub-dashboard-identity">
7 <summary>
8 <img src="/avatars/{{ .Viewer.Username }}" alt="" width="20" height="20">
9 <span>{{ .Viewer.Username }}</span>
10 {{ octicon "triangle-down" }}
11 </summary>
12 <div class="shithub-dashboard-identity-menu">
13 <div class="shithub-dashboard-identity-title">Go to organization dashboard</div>
14 <label class="shithub-dashboard-org-search">
15 <span>{{ octicon "search" }}</span>
16 <input type="search" aria-label="Find an organization" autocomplete="off">
17 </label>
18 <ol class="shithub-dashboard-org-list">
19 <li>
20 <a href="/{{ .Viewer.Username }}">
21 {{ octicon "check" }}
22 <img src="/avatars/{{ .Viewer.Username }}" alt="" width="20" height="20">
23 <span>{{ .Viewer.Username }}</span>
24 </a>
25 </li>
26 {{ range .ViewerOrgs }}
27 <li>
28 <a href="/{{ .Slug }}">
29 <span aria-hidden="true"></span>
30 <img src="/avatars/{{ .Slug }}" alt="" width="20" height="20">
31 <span>{{ .Slug }}</span>
32 </a>
33 </li>
34 {{ end }}
35 </ol>
36 <div class="shithub-dashboard-identity-actions">
37 <a href="/settings/organizations">{{ octicon "organization" }} Manage organizations</a>
38 <a href="/organizations/new">{{ octicon "plus" }} Create organization</a>
39 </div>
40 </div>
41 </details>
42
43 <div class="shithub-dashboard-sidehead">
44 <h2>Top repositories</h2>
45 <a href="/new" class="shithub-button shithub-button-primary shithub-button-small">{{ octicon "repo" }} New</a>
46 </div>
47 <label class="sr-only" for="dashboard-repo-filter">Find a repository</label>
48 <input id="dashboard-repo-filter" class="shithub-dashboard-filter" type="search" placeholder="Find a repository..." autocomplete="off" data-dashboard-repo-filter>
49 {{ if .TopRepos }}
50 <ol class="shithub-dashboard-repo-list" data-dashboard-repo-list>
51 {{ range .TopRepos }}
52 <li data-dashboard-repo-row data-repo-name="{{ .Owner }}/{{ .Name }}">
53 <a href="/{{ .Owner }}/{{ .Name }}"><img src="/avatars/{{ .Owner }}" alt="" width="18" height="18"> {{ .Owner }}/{{ .Name }}</a>
54 </li>
55 {{ end }}
56 </ol>
57 {{ else }}
58 <p class="shithub-dashboard-empty">No repositories yet.</p>
59 {{ end }}
60 </aside>
61 {{ end }}
62
63 <main class="shithub-explore-main">
64 <div class="shithub-explore-head">
65 <h1>{{ .PageHeading }}</h1>
66 <nav class="shithub-explore-tabs" aria-label="Explore">
67 <a href="/explore"{{ if eq .ActiveTab "activity" }} class="is-selected" aria-current="page"{{ end }}>{{ octicon "pulse" }} Activity</a>
68 <a href="/trending"{{ if eq .ActiveTab "trending" }} class="is-selected" aria-current="page"{{ end }}>{{ octicon "star" }} Trending</a>
69 </nav>
70 </div>
71
72 {{ if eq .ActiveTab "trending" }}
73 <section class="shithub-trending-section" aria-labelledby="trending-repositories-title">
74 <h2 id="trending-repositories-title">Trending repositories</h2>
75 {{ if .TrendingRepos }}
76 <ol class="shithub-trending-repo-list">
77 {{ range .TrendingRepos }}
78 <li class="shithub-trending-repo-row">
79 <div>
80 <h3><a href="/{{ .Owner }}/{{ .Name }}">{{ octicon "repo" }} {{ .Owner }}/{{ .Name }}</a></h3>
81 {{ if .Description }}<p>{{ .Description }}</p>{{ end }}
82 <ul class="shithub-feed-meta">
83 {{ if .PrimaryLanguage }}<li><span class="shithub-lang-dot" aria-hidden="true"></span>{{ .PrimaryLanguage }}</li>{{ end }}
84 <li>{{ octicon "star" }} {{ .StarCount }}</li>
85 <li>{{ octicon "repo-forked" }} {{ .ForkCount }}</li>
86 </ul>
87 </div>
88 <span class="shithub-trending-score">{{ .Score }}</span>
89 </li>
90 {{ end }}
91 </ol>
92 {{ else }}<p class="shithub-feed-empty-inline">No public repositories are trending yet.</p>{{ end }}
93 </section>
94 {{ else }}
95 <div class="shithub-feed-toolbar">
96 <h2>{{ .FeedHeading }}</h2>
97 <button type="button" class="shithub-button shithub-button-small" disabled>{{ octicon "list-unordered" }} Filter</button>
98 </div>
99 {{ if .Feed }}
100 <ol id="shithub-feed-list" class="shithub-feed-list" aria-live="polite">
101 {{ range .Feed }}{{ template "feed-row" . }}{{ end }}
102 </ol>
103 {{ else }}
104 <div class="shithub-feed-empty">
105 <h2>{{ octicon "people" }} {{ .FeedEmptyTitle }}</h2>
106 <p>{{ .FeedEmptyBody }}</p>
107 {{ if .Viewer.ID }}<a href="/trending" class="shithub-button">Explore trending repositories</a>{{ end }}
108 </div>
109 {{ end }}
110 {{ template "explore-feed-pagination" . }}
111 {{ end }}
112 </main>
113
114 <aside class="shithub-explore-right" aria-label="Trending">
115 <section class="shithub-side-panel">
116 <h2>{{ octicon "pulse" }} Trending repositories</h2>
117 {{ if .TrendingRepos }}
118 <ol class="shithub-trending-mini-list">
119 {{ range .TrendingRepos }}
120 <li>
121 <a href="/{{ .Owner }}/{{ .Name }}">{{ .Owner }}/{{ .Name }}</a>
122 {{ if .Description }}<p>{{ .Description }}</p>{{ end }}
123 <span>{{ octicon "star" }} {{ .StarCount }}</span>
124 </li>
125 {{ end }}
126 </ol>
127 {{ else }}<p class="shithub-dashboard-empty">No public activity yet.</p>{{ end }}
128 </section>
129
130 <section class="shithub-side-panel">
131 <h2>{{ octicon "people" }} Trending developers</h2>
132 {{ if .TrendingUsers }}
133 <ol class="shithub-trending-user-list">
134 {{ range .TrendingUsers }}
135 <li>
136 <a href="/{{ .Username }}"><img src="/avatars/{{ .Username }}" alt="" width="24" height="24"> {{ if .DisplayName }}{{ .DisplayName }}{{ else }}{{ .Username }}{{ end }}</a>
137 <span>@{{ .Username }}</span>
138 </li>
139 {{ end }}
140 </ol>
141 {{ else }}<p class="shithub-dashboard-empty">No developers trending yet.</p>{{ end }}
142 </section>
143 </aside>
144 </div>
145 </section>
146 {{- end }}