aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/home_sidebar_bottom.tmpl
blob: f780dc122d5af79a0f457486f612ced7d99f1f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<div class="repo-home-sidebar-bottom">
	<div class="flex-list">
		{{if .LatestRelease}}
		<div class="flex-item">
			<div class="flex-item-main">
				<div class="flex-item-title">
					<a class="item muted" href="{{.Link}}/releases">
						{{ctx.Locale.Tr "repo.releases"}}
						<span class="ui small label">{{.NumReleases}}</span>
					</a>
				</div>
				<div class="flex-item">
					<div class="flex-item-icon">
						{{svg "octicon-tag" 16}}
					</div>
					<div class="flex-item-main">
						<div class="flex-item-header">
							<div class="flex-item-title tw-gap-2">
								<a class="gt-ellipsis muted" href="{{.LatestRelease.Link}}" title="{{.LatestRelease.Title}}">{{.LatestRelease.Title}}</a>
								{{template "repo/release/label" (dict "Release" .LatestRelease "IsLatest" true)}}
							</div>
						</div>
						<div class="flex-item-body">
							<span class="time">{{DateUtils.TimeSince .LatestRelease.CreatedUnix}}</span>
						</div>
					</div>
				</div>
			</div>
		</div>
		{{end}}

		{{if and (not .IsEmptyRepo) .LanguageStats}}
		<div class="flex-item">
			<div class="flex-item-main">
				<div class="flex-item-title">
					{{ctx.Locale.Tr "repo.repo_lang"}}
				</div>

				<div class="flex-item-body">
					<div class="language-stats">
						{{range .LanguageStats}}
							<div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content={{.Language}} data-tooltip-follow-cursor="horizontal"></div>
						{{end}}
					</div>
					<div class="language-stats-details">
						{{range .LanguageStats}}
							<div class="item">
								<i class="color-icon" style="background-color: {{.Color}}"></i>
								<span class="tw-font-semibold">
									{{Iif (eq .Language "other") (ctx.Locale.Tr "repo.language_other") .Language}}
								</span>
								{{.Percentage}}%
							</div>
						{{end}}
					</div>
				</div>
			</div>
		</div>
		{{end}}
	</div>
</div>