|
{{$notificationUnreadCount := 0}} |
|
{{if and .IsSigned .NotificationUnreadCount}} |
|
{{$notificationUnreadCount = call .NotificationUnreadCount}} |
|
{{end}} |
|
|
|
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}"> |
|
<div class="navbar-left ui secondary menu"> |
|
|
|
<a class="item-non" style="/*min-width:160px;*/" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}"> |
|
<img width="183" height="31" src="{{AssetUrlPrefix}}/img/logo3.png" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true"> |
|
</a> |
|
|
|
<div class="ui secondary menu item navbar-mobile-right" style="min-width:40px;width:40px;"> |
|
<button class="item gt-w-auto ui icon mini button gt-p-3 gt-m-0" id="navbar-expand-toggle" style="min-width: 80px;color:white;">{{svg "octicon-three-bars"}}</button> |
|
</div> |
|
|
|
|
|
<div class = "nav-countent"> |
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos"> |
|
{{ctx.Locale.Tr "explore"}} |
|
<span class="img"> |
|
<img src="{{AssetUrlPrefix}}/img/icon/models.png" width="24" height="24"> |
|
</span> |
|
</a> |
|
{{template "custom/extra_links" .}} |
|
<a class="item{{if .PageIsDataset}} active{{end}}" rel="noopener noreferrer" href="{{AppSubUrl}}/explore/datasets"> |
|
{{ctx.Locale.Tr "datasets"}} |
|
<span class="img"> |
|
<img src="{{AssetUrlPrefix}}/img/icon/database.png" width="24" height="24"> |
|
</span> |
|
</a> |
|
|
|
<a class="item{{if .PageIsSpace}} active{{end}}" rel="noopener noreferrer" href="{{AppSubUrl}}/explore/spaces"> |
|
{{ctx.Locale.Tr "spaces"}} |
|
<span class="img"> |
|
<img src="{{AssetUrlPrefix}}/img/icon/spaces.png" width="24" height="24"> |
|
</span> |
|
</a> |
|
|
|
<a class="item{{if .PageIsBlockchain}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "blcokchain"}} |
|
<span class="img"> |
|
<img src="{{AssetUrlPrefix}}/img/icon/blockchain.png" width="24" height="24"/> |
|
</span> |
|
</a> |
|
|
|
<a class="item{{if .PageIsDocs}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "docs"}} |
|
<span class="img"> |
|
<img src="{{AssetUrlPrefix}}/img/icon/docs.png" width="24" height="24"/> |
|
</span> |
|
</a> |
|
|
|
<a class="item{{if .PageIsPricing}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "pricing"}} |
|
<span class="img"> |
|
<img src="{{AssetUrlPrefix}}/img/icon/pricing.png" width="24" height="24"/> |
|
</span> |
|
</a> |
|
|
|
<a class="item{{if .PageIsOther}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "other"}} |
|
<span class="img"> |
|
<img src="{{AssetUrlPrefix}}/img/icon/other.png" width="24" height="24"/> |
|
</span> |
|
</a> |
|
</div> |
|
</div> |
|
|
|
|
|
<div class="navbar-right ui secondary menu"> |
|
|
|
<span class="img-container"></span> |
|
<a class="item search_img {{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="/" > |
|
<img class="links" width="100%" height="100%" src="{{AssetUrlPrefix}}/img/suod.png" alt="{{ctx.Locale.Tr "sousuo"}}" aria-hidden="true"> |
|
</a> |
|
|
|
<div class="item right-links" role="group" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}"> |
|
<div class="ui dropdown upward language"> |
|
{{if eq ctx.Locale.Lang "en-US"}} |
|
{{AssetUrlPrefix}} |
|
{{else if eq ctx.Locale.Lang "zh-CN"}} |
|
{{AssetUrlPrefix}} |
|
{{end}} |
|
<span class="flex-text-inline">{{ctx.Locale.LangName}}</span> |
|
<div class="menu language-menu"> |
|
{{range .AllLangs}} |
|
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq ctx.Locale.Lang .Lang}}active selected{{end}}" style="width: auto; text-align: center;"> |
|
{{if eq .Lang "en-US"}} |
|
<span><img src="{{AssetUrlPrefix}}/img/flags/ENG.png"></span> |
|
{{else if eq .Lang "zh-CN"}} |
|
<span><img src="{{AssetUrlPrefix}}/img/flags/CN.png"></span> |
|
{{end}} |
|
{{.Name}} |
|
{{if eq ctx.Locale.Lang .Lang}} |
|
{{AssetUrlPrefix}} |
|
{{end}} |
|
</a> |
|
{{end}} |
|
</div> |
|
</div> |
|
</div> |
|
|
|
{{if and .IsSigned .MustChangePassword}} |
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}"> |
|
<span class="text gt-df gt-ac"> |
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}} |
|
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span> |
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
|
</span> |
|
<div class="menu user-menu"> |
|
<div class="ui header"> |
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> |
|
</div> |
|
|
|
<div class="divider"></div> |
|
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout"> |
|
{{svg "octicon-sign-out"}} |
|
{{ctx.Locale.Tr "sign_out"}} |
|
</a> |
|
</div> |
|
</div> |
|
{{else if .IsSigned}} |
|
{{if EnableTimetracking}} |
|
<div class="active-stopwatch-popup item tippy-target gt-p-3"> |
|
<div class="gt-df gt-ac"> |
|
<a class="stopwatch-link gt-df gt-ac" href="{{.ActiveStopwatch.IssueLink}}"> |
|
{{svg "octicon-issue-opened" 16 "gt-mr-3"}} |
|
<span class="stopwatch-issue">{{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}</span> |
|
<span class="ui primary label stopwatch-time gt-my-0 gt-mx-4" data-seconds="{{.ActiveStopwatch.Seconds}}"> |
|
{{if .ActiveStopwatch}}{{Sec2Time .ActiveStopwatch.Seconds}}{{end}} |
|
</span> |
|
</a> |
|
<form class="stopwatch-commit" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/toggle"> |
|
{{.CsrfTokenHtml}} |
|
<button |
|
type="submit" |
|
class="ui button mini compact basic icon" |
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}" |
|
>{{svg "octicon-square-fill"}}</button> |
|
</form> |
|
<form class="stopwatch-cancel" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel"> |
|
{{.CsrfTokenHtml}} |
|
<button |
|
type="submit" |
|
class="ui button mini compact basic icon" |
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}" |
|
>{{svg "octicon-trash"}}</button> |
|
</form> |
|
</div> |
|
</div> |
|
{{end}} |
|
|
|
|
|
{{ctx.Locale.Tr "create_new"}} |
|
|
|
{{svg "octicon-plus"}} |
|
{{svg "octicon-triangle-down"}} |
|
{{ctx.Locale.Tr "create_new"}} |
|
|
|
|
|
{{AppSubUrl}} |
|
{{svg "octicon-plus"}}{{ctx.Locale.Tr "new_repo"}} |
|
|
|
|
|
{{AppSubUrl}} |
|
{{svg "octicon-plus"}} |
|
{{svg "octicon-plus"}}{{ctx.Locale.Tr "new_repo"}} |
|
|
|
{{AppSubUrl}} |
|
{{svg "octicon-plus"}} |
|
{{svg "octicon-plus"}}{{ctx.Locale.Tr "new_repo"}} |
|
|
|
{{AppSubUrl}} |
|
{{svg "octicon-plus"}} |
|
{{svg "octicon-plus"}}{{ctx.Locale.Tr "new_repo"}} |
|
|
|
|
|
{{if .SignedUser.CanCreateOrganization}} |
|
{{AppSubUrl}} |
|
{{svg "octicon-organization"}}{{ctx.Locale.Tr "new_org"}} |
|
|
|
{{end}} |
|
{{if not .DisableMigrations}} |
|
{{AppSubUrl}} |
|
{{svg "octicon-repo-push"}}{{ctx.Locale.Tr "new_migrate"}} |
|
|
|
{{end}} |
|
|
|
|
|
|
|
<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}"> |
|
<span class="text gt-df gt-ac"> |
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}} |
|
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span> |
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
|
</span> |
|
<div class="menu user-menu"> |
|
<div class="ui header"> |
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> |
|
</div> |
|
|
|
|
|
<a class="item" href="{{.SignedUser.HomeLink}}"> |
|
{{svg "octicon-person"}} |
|
{{ctx.Locale.Tr "your_profile"}} |
|
</a> |
|
{{if not .DisableStars}} |
|
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars"> |
|
{{svg "octicon-star"}} |
|
{{ctx.Locale.Tr "your_starred"}} |
|
</a> |
|
{{end}} |
|
|
|
<div class="divider"></div> |
|
<a class="item" href="{{AppSubUrl}}/repo/create"> |
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}} |
|
</a> |
|
|
|
<a class="item" href="{{AppSubUrl}}/repo/create/dataset"> |
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_dataset"}} |
|
{{svg "octicon-plus"}}{{ctx.Locale.Tr "new_repo"}} |
|
</a> |
|
<a class="item" href="{{AppSubUrl}}/repo/create/space"> |
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_space"}} |
|
{{svg "octicon-plus"}}{{ctx.Locale.Tr "new_repo"}} |
|
</a> |
|
<a class="item" href="{{AppSubUrl}}/repo/create/collection"> |
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_collection"}} |
|
{{svg "octicon-plus"}}{{ctx.Locale.Tr "new_repo"}} |
|
</a> |
|
|
|
{{if .SignedUser.CanCreateOrganization}} |
|
<a class="item" href="{{AppSubUrl}}/org/create"> |
|
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}} |
|
</a> |
|
{{end}} |
|
<a class="item" href="{{.SignedUser.HomeLink}}"> |
|
{{svg "octicon-person"}} |
|
{{ctx.Locale.Tr "your_profile"}} |
|
</a> |
|
{{if not .DisableStars}} |
|
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars"> |
|
{{svg "octicon-star"}} |
|
{{ctx.Locale.Tr "your_starred"}} |
|
</a> |
|
{{end}} |
|
|
|
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions"> |
|
{{svg "octicon-bell"}} |
|
{{ctx.Locale.Tr "notification.subscriptions"}} |
|
</a> |
|
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings"> |
|
{{svg "octicon-tools"}} |
|
{{ctx.Locale.Tr "your_settings"}} |
|
</a> |
|
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com"> |
|
{{svg "octicon-question"}} |
|
{{ctx.Locale.Tr "help"}} |
|
</a> |
|
{{if .IsAdmin}} |
|
<div class="divider"></div> |
|
|
|
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/admin"> |
|
{{svg "octicon-server"}} |
|
{{ctx.Locale.Tr "admin_panel"}} |
|
</a> |
|
{{end}} |
|
|
|
<div class="divider"></div> |
|
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout"> |
|
{{svg "octicon-sign-out"}} |
|
{{ctx.Locale.Tr "sign_out"}} |
|
</a> |
|
</div> |
|
</div> |
|
{{else}} |
|
{{if .ShowRegistrationButton}} |
|
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up"> |
|
{{svg "octicon-person"}} {{ctx.Locale.Tr "register"}} |
|
</a> |
|
{{end}} |
|
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}"> |
|
{{svg "octicon-sign-in"}} {{ctx.Locale.Tr "sign_in"}} |
|
</a> |
|
{{end}} |
|
</div> |
|
|
|
</nav> |
|
|