summaryrefslogtreecommitdiffstats
path: root/templates/user/dashboard/dashboard.tmpl
blob: 667a0e6b64d8c7cccfba3c9878b57abbb9601572 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{{template "base/head" .}}
<div class="dashboard feeds">
	{{template "user/dashboard/navbar" .}}
	<div class="ui container">
		<div class="ui grid">
			<div class="ten wide column">
				{{template "user/dashboard/feeds" .}}
			</div>
			<div class="six wide column">
				<div class="ui {{if not .ContextUser.IsOrganization}}three{{else}}two{{end}} item tabable menu">
					<a class="item active" data-tab="repos">{{.i18n.Tr "repository"}}</a>
					{{if not .ContextUser.IsOrganization}}
						<a class="item" data-tab="orgs">{{.i18n.Tr "organization"}}</a>
					{{end}}
					<a class="item" data-tab="mirrors">{{.i18n.Tr "mirror"}}</a>
				</div>
				<div class="ui tab active list" data-tab="repos">
					<h4 class="ui top attached header">
						{{.i18n.Tr "home.my_repos"}} <span class="ui grey label">{{.ContextUser.NumRepos}}</span>
						<div class="ui right">
							<a class="poping up" href="{{AppSubUrl}}/repo/create" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center">
								<i class="plus icon"></i>
								<span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
							</a>
						</div>
					</h4>
					<div class="ui attached table segment">
						<ul class="repo-owner-name-list">
							{{range .Repos}}
								<li {{if .IsPrivate}}class="private"{{end}}>
									<a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}">
										<i class="icon octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
										<strong class="text truncate item-name">{{.Name}}</strong>
										<span class="ui right text light grey">
											<i class="octicon octicon-star"></i>{{.NumStars}}
										</span>
									</a>
								</li>
							{{end}}
						</ul>
					</div>

					{{if not .ContextUser.IsOrganization}}
						<h4 class="ui top attached header">
							{{.i18n.Tr "home.collaborative_repos"}} <span class="ui grey label">{{.CollaborateCount}}</span>
						</h4>
						<div class="ui attached table segment">
							<ul id="collaborative-repo-list">
								{{range .CollaborativeRepos}}
									<li {{if .IsPrivate}}class="private"{{end}}>
										<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">
											<i class="icon octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
											<span class="text truncate owner-and-repo">
												<span class="text truncate owner-name">{{.Owner.Name}}</span> / <strong>{{.Name}}</strong>
											</span>
											<span class="ui right text light grey">
												<i class="octicon octicon-star"></i>{{.NumStars}}
											</span>
										</a>
									</li>
								{{end}}
							</ul>
						</div>
					{{end}}
				</div>

				{{if not .ContextUser.IsOrganization}}
					<div class="ui tab list" data-tab="orgs">
						<h4 class="ui top attached header">
							{{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">{{.ContextUser.GetOrganizationCount}}</span>
							<div class="ui right">
								<a class="poping up" href="{{AppSubUrl}}/org/create" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
									<i class="plus icon"></i>
									<span class="sr-only">{{.i18n.Tr "new_org"}}</span>
								</a>
							</div>
						</h4>
						<div class="ui attached table segment">
							<ul class="repo-owner-name-list">
								{{range .ContextUser.Orgs}}
									<li>
										<a href="{{AppSubUrl}}/{{.Name}}">
											<i class="icon octicon octicon-organization"></i>
											<strong class="text truncate item-name">{{.Name}}</strong>
											<span class="ui right text light grey">
												<i class="octicon octicon-repo"></i>{{.NumRepos}}
											</span>
										</a>
									</li>
								{{end}}
							</ul>
						</div>
					</div>
				{{end}}

				<div class="ui tab list" data-tab="mirrors">
					<h4 class="ui top attached header">
						{{.i18n.Tr "home.my_mirrors"}} <span class="ui grey label">{{.MirrorCount}}</span>
						<div class="ui right">
							<a class="poping up" href="{{AppSubUrl}}/repo/migrate?mirror=1" data-content="{{.i18n.Tr "new_mirror"}}" data-variation="tiny inverted" data-position="left center">
								<i class="plus icon"></i>
								<span class="sr-only">{{.i18n.Tr "new_mirror"}}</span>
							</a>
						</div>
					</h4>
					<div class="ui attached table segment">
						<ul class="repo-owner-name-list">
							{{range .Mirrors}}
								<li {{if .IsPrivate}}class="private"{{end}}>
									<a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}">
										<i class="icon octicon octicon-repo-clone"></i>
										<strong class="text truncate item-name">{{.Name}}</strong>
										<span class="ui right text light grey">
											<i class="octicon octicon-sync"></i>{{.Interval}}H
										</span>
									</a>
								</li>
							{{end}}
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
{{template "base/footer" .}}