summaryrefslogtreecommitdiffstats
path: root/templates/user/dashboard/navbar.tmpl
blob: 7afb975bbc5ebfea7bda173f22a4974efa3a476d (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
<div class="dashboard-navbar">
	<div class="ui secondary stackable menu">
		<div class="item">
			<div class="ui floating dropdown link jump">
				<span class="text">
					<img class="ui avatar image" src="{{.ContextUser.RelAvatarLink}}" title="{{.ContextUser.Name}}" width="28" height="28">
					{{.ContextUser.ShortName 20}}
					<i class="dropdown icon"></i>
				</span>
				<div class="context user overflow menu" tabindex="-1">
					<div class="ui header">
						{{.i18n.Tr "home.switch_dashboard_context"}}
					</div>
					<div class="scrolling menu items">
						<a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
							<img class="ui avatar image" src="{{.SignedUser.RelAvatarLink}}" width="28" height="28">
							{{.SignedUser.Name}}
						</a>
						{{range .Orgs}}
							<a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" title="{{.Name}}" href="{{AppSubUrl}}/org/{{.Name}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
								<img class="ui avatar image" src="{{.RelAvatarLink}}" width="28" height="28">
								{{.ShortName 20}}
							</a>
						{{end}}
					</div>
					{{if .SignedUser.CanCreateOrganization}}
					<a class="item" href="{{AppSubUrl}}/org/create">
						{{svg "octicon-plus" 16}}&nbsp;&nbsp;&nbsp;{{.i18n.Tr "new_org"}}
					</a>
					{{end}}
				</div>
			</div>
		</div>

		{{if .ContextUser.IsOrganization}}
			<div class="right stackable menu">
				<a class="{{if .PageIsNews}}active{{end}} item" style="margin-left: auto" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/dashboard">
					{{svg "octicon-rss" 16}}&nbsp;{{.i18n.Tr "activities"}}
				</a>
				<a class="{{if .PageIsIssues}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/issues">
					{{svg "octicon-issue-opened" 16}}&nbsp;{{.i18n.Tr "issues"}}
				</a>
				<a class="{{if .PageIsPulls}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/pulls">
					{{svg "octicon-git-pull-request" 16}}&nbsp;{{.i18n.Tr "pull_requests"}}
				</a>
				{{if .ShowMilestonesDashboardPage}}
					<a class="{{if .PageIsMilestonesDashboard}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/milestones">
						{{svg "octicon-milestone" 16}}&nbsp;{{.i18n.Tr "milestones"}}
					</a>
				{{end}}
				<div class="item">
					<a class="ui blue basic button" href="{{.ContextUser.HomeLink}}" title='{{.i18n.Tr "home.view_home" .ContextUser.Name}}'>
						{{.i18n.Tr "home.view_home" (.ContextUser.ShortName 10)}}
					</a>
				</div>
			</div>
		{{end}}
	</div>
</div>
<div class="ui divider"></div>