{{template "base/head" .}}
<div class="dashboard feeds">
	{{template "user/dashboard/navbar" .}}
	<div class="ui container">
		{{if not .Feeds}}
			{{if not .ContextUser.IsOrganization}}
				{{if .PageIsDashboard}}
				{{if .IsAdmin}}
					{{template "user/dashboard/bootcamp" .}}
				{{end}}
				{{end}}
			{{end}}
		{{end}}
		<div class="ui grid">
			<div class="ten wide column">
				{{template "user/dashboard/feeds" .}}
				{{if .AfterID}}
					<center>
						<button class="ui basic green show-modal button ajax-load-button" data-url="{{.Link}}?after_id={{.AfterID}}">🔮 More</button>
					</center>
				{{end}}
				<div class="ui stackable grid container home-footer">
					<div class="seven wide left floated column">
						<span class="ui header"><img src="https://cdn.jsdelivr.net/npm/gitote@1.0.1/logo.png">© 2018 {{AppName}}</span>
					</div>
					<div class="three wide column">
						<div class="ui link list">
							<a class="item" href="https://blog.gitote.in">Blog</a>
							<a class="item" href="{{AppURL}}about">About</a>
							<a class="item" href="{{AppURL}}shop">Shop</a>
							<a class="item" href="{{AppURL}}contact">Contact</a>
						</div>
					</div>
					<div class="three wide column">
						<div class="ui link list">
							<a class="item" href="{{AppURL}}developers">API</a>
							<a class="item" href="{{AppURL}}faq">FAQ</a>
							<a class="item" href="https://status.gitote.in">Status</a>
							<a class="item" href="{{AppURL}}security">Security</a>
						</div>
					</div>
					<div class="three wide column">
						<div class="ui link list">
							<a class="item" href="{{AppURL}}terms">Terms</a>
							<a class="item" href="{{AppURL}}privacy">Privacy</a>
							<a class="item" href="{{AppURL}}help">Help</a>
						</div>
					</div>
				</div>
			</div>
			<div class="six wide column">
				{{if not .ContextUser.IsOrganization}}
				<div class="ui cards">
					<div class="profile-card card">
						<div class="content">
							<img class="right floated mini ui image" src="{{.LoggedUser.RelAvatarLink}}">
							<div class="header">
								<a style="color:#212121" href="{{AppSubURL}}/{{.LoggedUser.Name}}">
									{{.Owner.FullName}}
									{{if .Owner.IsVerified}}<a class="poping up" target="_blank" href="/verified" data-content="Verified" data-variation="inverted tiny" data-position="right center"><i class="verified octicon octicon-verified"></i></a>{{end}}
									{{if .Owner.IsMaker}}<a class="poping up" target="_blank" href="/maker" data-content="Maker" data-variation="inverted tiny" data-position="right center"><i class="maker octicon octicon-paintcan"></i></a>{{end}}
									{{if .Owner.IsBugHunter}}<a class="poping up" target="_blank" href="/security" data-content="Bug Hunter" data-variation="inverted tiny" data-position="right center"><i class="bughunter octicon octicon-gist-secret"></i></a>{{end}}
									{{if .Owner.IsBeta}}<a class="poping up" target="_blank" href="/developer" data-content="Beta Member" data-variation="inverted tiny" data-position="right center"><i class="developer octicon octicon-circuit-board"></i></a>{{end}}
									{{if .Owner.IsStaff}}<a class="poping up" target="_blank" href="/jobs" data-content="Staff" data-variation="inverted tiny" data-position="right center"><i class="isstaff octicon octicon-tools"></i></a>{{end}}
								</a>
							</div>
							<div class="meta">
								@{{.Owner.Name}}
							</div>
							<div class="profile-card meta">
								{{if .Owner.Description}}
									<div class="description card-desc">
										<span>{{.Owner.Description}}</span>
									</div>
								{{end}}
								{{if .Owner.Website}}
									<div class="description">
										<a target="_blank" rel="noopener noreferrer" href="{{.Owner.Website}}"><i class="menu-icon octicon">🔗</i> {{.Owner.Website}}</a>
									</div>
								{{end}}
							</div>
						</div>
						<div class="extra content">
						<div class="ui two buttons">
							<div style="font-weight:bold;font-size:15px" class="ui basic button">
								<a href="{{.Owner.HomeLink}}/followers">{{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}}</a>
							</div>
							<div class="v-divider"></div>
							<div style="font-weight:bold;font-size:15px" class="ui basic button">
								<a href="{{.Owner.HomeLink}}/following">{{.Owner.NumFollowing}} {{.i18n.Tr "user.following"}}</a>
							</div>
						</div>
						</div>
					</div>
  				</div>
				{{end}}
				<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">
					<div class="ui top attached header">
						<i class="menu-icon octicon">📁</i> {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">{{.RepoCount}}</span>
						<div class="ui right">
							<a class="poping up" href="{{AppSubURL}}/repo/create{{if .ContextUser.IsOrganization}}?org={{.ContextUser.ID}}{{end}}" 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>
					</div>
					<div class="ui attached table segment">
						<ul class="repo-owner-name-list">
							{{if not .RepoCount}}
								<center>
									<h5 style="padding-top:20px">No Repos Found 🤷</h5>
									<a href="{{AppSubURL}}/repo/create">
										<button style="margin-bottom:20px" class="ui green button">
											{{.i18n.Tr "repo.create_repo"}}
										</button>
									</a>
								</center>
							{{end}}
							{{range .Repos}}
								<li {{if .IsPrivate}}class="private"{{end}}>
									<a href="{{AppSubURL}}/{{$.ContextUser.Name}}/{{.Name}}">
										<i class="octicon octicon-{{if .IsFork}}repo-forked{{else if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
										<strong class="text truncate item-name">{{.Name}}</strong>
										<span class="ui right text light grey">
											{{.NumStars}} <i class="menu-icon octicon">⭐</i>
										</span>
									</a>
								</li>
							{{end}}
							{{if gt .ContextUser.NumRepos .MaxShowRepoNum}}
							<li>
								<a href="{{.ContextUser.HomeLink}}">{{.i18n.Tr "home.show_more_repos"}}</a>
							</li>
							{{end}}
						</ul>
					</div>

					{{if not .ContextUser.IsOrganization}}
						<h4 class="ui top attached header">
							<i class="menu-icon octicon">👯</i> {{.i18n.Tr "home.collaborative_repos"}}
						</h4>
						<div class="ui attached table segment">
							<ul id="collaborative-repo-list">
								{{if not .CollaborativeRepos}}
									<center>
										<h5 style="padding-top:20px">No Repos Found 🤷</h5>
										<a href="{{AppSubURL}}/explore/repos">
											<button style="margin-bottom:20px" class="ui green button">
												{{.i18n.Tr "explore"}}
											</button>
										</a>
									</center>
								{{end}}
								{{range .CollaborativeRepos}}
									<li {{if .IsPrivate}}class="private"{{end}}>
										<a href="{{AppSubURL}}/{{.Owner.Name}}/{{.Name}}">
											<i class="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">
												{{.NumStars}} <i class="menu-icon octicon">⭐</i>
											</span>
										</a>
									</li>
								{{end}}
							</ul>
						</div>
					{{end}}
				</div>

				{{if not .ContextUser.IsOrganization}}
					<div class="ui tab list" data-tab="orgs">
						<div class="ui top attached header">
							<i class="menu-icon octicon">🏢</i> {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">{{.ContextUser.GetOrganizationCount}}</span>
							{{if .LoggedUser.CanCreateOrganization}}
								<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>
							{{end}}
						</div>
						<div class="ui attached table segment">
							<ul class="repo-owner-name-list">
								{{if not .ContextUser.Orgs}}
									<center>
										<h5 style="padding-top:20px">No Orgs Found 🤷</h5>
										<a href="{{AppSubURL}}/explore/organizations">
											<button style="margin-bottom:20px" class="ui green button">
												{{.i18n.Tr "explore"}}
											</button>
										</a>
									</center>
								{{end}}
								{{range .ContextUser.Orgs}}
									<li>
										<a href="{{AppSubURL}}/{{.Name}}">
											<i class="octicon octicon-organization"></i>
											<strong class="text truncate item-name">{{.Name}}</strong>
											<span class="ui right text light grey">
												{{.NumRepos}} <i class="menu-icon octicon">📁</i>
											</span>
										</a>
									</li>
								{{end}}
							</ul>
						</div>
					</div>
				{{end}}

				<div class="ui tab list" data-tab="mirrors">
					<div class="ui top attached header">
						<i class="menu-icon octicon">🤳</i> {{.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>
					</div>
					<div class="ui attached table segment">
						<ul class="repo-owner-name-list">
							{{if not .Mirrors}}
								<center>
									<h5 style="padding-top:20px">No Mirrors Found 🤷</h5>
									<a href="{{AppSubURL}}/repo/migrate?mirror=1">
										<button style="margin-bottom:20px" class="ui green button">
											{{.i18n.Tr "repo.create_repo"}}
										</button>
									</a>
								</center>
							{{end}}
							{{range .Mirrors}}
								<li {{if .IsPrivate}}class="private"{{end}}>
									<a href="{{AppSubURL}}/{{$.ContextUser.Name}}/{{.Name}}">
										<i class="octicon octicon-repo-clone"></i>
										<strong class="text truncate item-name">{{.Name}}</strong>
										<span class="ui right text light grey">
											{{.Interval}}H <i class="octicon octicon-sync rear"></i>
										</span>
									</a>
								</li>
							{{end}}
						</ul>
					</div>
				</div>

				{{template "misc/sponsor" .}}

				<div class="side-footer"> 
					<span class="side-footer">© 2018 Gitote</span>
					<a class="contents" href="{{AppURL}}about">About</a>
					<a class="contents" href="{{AppURL}}faq">FAQ</a>
					<a class="contents" href="{{AppURL}}help">Help</a>
					<a class="contents" href="https://status.gitote.in" target="_blank">
						Status
						<span style="font-size:8px" class="sitestatus ui empty circular label mini"></span>
					</a>
					<a class="contents" href="{{AppURL}}developers">Developers</a>
					<a class="contents" href="{{AppURL}}tos">Terms</a>
					<a class="contents" href="{{AppURL}}privacy">Privacy</a>
					<a class="contents" href="{{AppURL}}brand">Brand</a>
					<a class="contents" href="https://blog.gitote.in">Blog</a>
					<a class="contents" href="{{AppURL}}contact">Contact</a>
				</div>
			</div>
		</div>
	</div>
</div>
{{template "base/footer" .}}
