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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{{$notificationUnreadCount := 0}}
|
2 |
+
{{if and .IsSigned .NotificationUnreadCount}}
|
3 |
+
{{$notificationUnreadCount = call .NotificationUnreadCount}}
|
4 |
+
{{end}}
|
5 |
+
|
6 |
+
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
|
7 |
+
<div class="navbar-left ui secondary menu">
|
8 |
+
<!-- the logo -->
|
9 |
+
<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}}">
|
10 |
+
<img width="183" height="31" src="{{AssetUrlPrefix}}/img/logo3.png" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
|
11 |
+
</a>
|
12 |
+
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
|
13 |
+
<div class="ui secondary menu item navbar-mobile-right" style="min-width:40px;width:40px;">
|
14 |
+
<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>
|
15 |
+
</div>
|
16 |
+
|
17 |
+
<!-- navbar links non-mobile -->
|
18 |
+
<div class = "nav-countent">
|
19 |
+
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">
|
20 |
+
{{ctx.Locale.Tr "explore"}}
|
21 |
+
<span class="img">
|
22 |
+
<img src="{{AssetUrlPrefix}}/img/icon/models.png" width="24" height="24">
|
23 |
+
</span>
|
24 |
+
</a>
|
25 |
+
{{template "custom/extra_links" .}}
|
26 |
+
<a class="item{{if .PageIsDataset}} active{{end}}" rel="noopener noreferrer" href="{{AppSubUrl}}/explore/datasets">
|
27 |
+
{{ctx.Locale.Tr "datasets"}}
|
28 |
+
<span class="img">
|
29 |
+
<img src="{{AssetUrlPrefix}}/img/icon/database.png" width="24" height="24">
|
30 |
+
</span>
|
31 |
+
</a>
|
32 |
+
|
33 |
+
<a class="item{{if .PageIsSpace}} active{{end}}" rel="noopener noreferrer" href="{{AppSubUrl}}/explore/spaces">
|
34 |
+
{{ctx.Locale.Tr "spaces"}}
|
35 |
+
<span class="img">
|
36 |
+
<img src="{{AssetUrlPrefix}}/img/icon/spaces.png" width="24" height="24">
|
37 |
+
</span>
|
38 |
+
</a>
|
39 |
+
|
40 |
+
<a class="item{{if .PageIsBlockchain}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "blcokchain"}}
|
41 |
+
<span class="img">
|
42 |
+
<img src="{{AssetUrlPrefix}}/img/icon/blockchain.png" width="24" height="24"/>
|
43 |
+
</span>
|
44 |
+
</a>
|
45 |
+
|
46 |
+
<a class="item{{if .PageIsDocs}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "docs"}}
|
47 |
+
<span class="img">
|
48 |
+
<img src="{{AssetUrlPrefix}}/img/icon/docs.png" width="24" height="24"/>
|
49 |
+
</span>
|
50 |
+
</a>
|
51 |
+
|
52 |
+
<a class="item{{if .PageIsPricing}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "pricing"}}
|
53 |
+
<span class="img">
|
54 |
+
<img src="{{AssetUrlPrefix}}/img/icon/pricing.png" width="24" height="24"/>
|
55 |
+
</span>
|
56 |
+
</a>
|
57 |
+
|
58 |
+
<a class="item{{if .PageIsOther}} active{{end}}" rel="noopener noreferrer" href="/">{{ctx.Locale.Tr "other"}}
|
59 |
+
<span class="img">
|
60 |
+
<img src="{{AssetUrlPrefix}}/img/icon/other.png" width="24" height="24"/>
|
61 |
+
</span>
|
62 |
+
</a>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
<!-- 20231207 update 添加了全球化 item和导航栏的冲突 所以提出来了-->
|
66 |
+
<!-- the full dropdown menus -->
|
67 |
+
<div class="navbar-right ui secondary menu">
|
68 |
+
<!-- 搜索图片-->
|
69 |
+
<span class="img-container"></span>
|
70 |
+
<a class="item search_img {{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="/" >
|
71 |
+
<img class="links" width="100%" height="100%" src="{{AssetUrlPrefix}}/img/suod.png" alt="{{ctx.Locale.Tr "sousuo"}}" aria-hidden="true">
|
72 |
+
</a>
|
73 |
+
<!-- 全球化 begin-->
|
74 |
+
<div class="item right-links" role="group" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}">
|
75 |
+
<div class="ui dropdown upward language">
|
76 |
+
<!--{{if eq ctx.Locale.Lang "en-US"}}
|
77 |
+
<span class="img" style="display:none;"><img src="{{AssetUrlPrefix}}/img/flags/ENG.png"></span>
|
78 |
+
{{else if eq ctx.Locale.Lang "zh-CN"}}
|
79 |
+
<span class="img" style="display:none;"><img src="{{AssetUrlPrefix}}/img/flags/CN.png"></span>
|
80 |
+
{{end}}-->
|
81 |
+
<span class="flex-text-inline">{{ctx.Locale.LangName}}</span>
|
82 |
+
<div class="menu language-menu">
|
83 |
+
{{range .AllLangs}}
|
84 |
+
<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;">
|
85 |
+
{{if eq .Lang "en-US"}}
|
86 |
+
<span><img src="{{AssetUrlPrefix}}/img/flags/ENG.png"></span>
|
87 |
+
{{else if eq .Lang "zh-CN"}}
|
88 |
+
<span><img src="{{AssetUrlPrefix}}/img/flags/CN.png"></span>
|
89 |
+
{{end}}
|
90 |
+
{{.Name}}
|
91 |
+
{{if eq ctx.Locale.Lang .Lang}}
|
92 |
+
<!--<span><img src="{{AssetUrlPrefix}}/img/flags/active.png"></span>-->
|
93 |
+
{{end}}
|
94 |
+
</a>
|
95 |
+
{{end}}
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<!-- 全球化 end -->
|
100 |
+
{{if and .IsSigned .MustChangePassword}}
|
101 |
+
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
102 |
+
<span class="text gt-df gt-ac">
|
103 |
+
{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
|
104 |
+
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
|
105 |
+
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
106 |
+
</span>
|
107 |
+
<div class="menu user-menu">
|
108 |
+
<div class="ui header">
|
109 |
+
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
110 |
+
</div>
|
111 |
+
|
112 |
+
<div class="divider"></div>
|
113 |
+
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
114 |
+
{{svg "octicon-sign-out"}}
|
115 |
+
{{ctx.Locale.Tr "sign_out"}}
|
116 |
+
</a>
|
117 |
+
</div><!-- end content avatar menu -->
|
118 |
+
</div><!-- end dropdown avatar menu -->
|
119 |
+
{{else if .IsSigned}}
|
120 |
+
{{if EnableTimetracking}}
|
121 |
+
<div class="active-stopwatch-popup item tippy-target gt-p-3">
|
122 |
+
<div class="gt-df gt-ac">
|
123 |
+
<a class="stopwatch-link gt-df gt-ac" href="{{.ActiveStopwatch.IssueLink}}">
|
124 |
+
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
|
125 |
+
<span class="stopwatch-issue">{{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}</span>
|
126 |
+
<span class="ui primary label stopwatch-time gt-my-0 gt-mx-4" data-seconds="{{.ActiveStopwatch.Seconds}}">
|
127 |
+
{{if .ActiveStopwatch}}{{Sec2Time .ActiveStopwatch.Seconds}}{{end}}
|
128 |
+
</span>
|
129 |
+
</a>
|
130 |
+
<form class="stopwatch-commit" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/toggle">
|
131 |
+
{{.CsrfTokenHtml}}
|
132 |
+
<button
|
133 |
+
type="submit"
|
134 |
+
class="ui button mini compact basic icon"
|
135 |
+
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
|
136 |
+
>{{svg "octicon-square-fill"}}</button>
|
137 |
+
</form>
|
138 |
+
<form class="stopwatch-cancel" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
|
139 |
+
{{.CsrfTokenHtml}}
|
140 |
+
<button
|
141 |
+
type="submit"
|
142 |
+
class="ui button mini compact basic icon"
|
143 |
+
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
|
144 |
+
>{{svg "octicon-trash"}}</button>
|
145 |
+
</form>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
{{end}}
|
149 |
+
|
150 |
+
|
151 |
+
<!-- <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">-->
|
152 |
+
<!-- <span class="text">-->
|
153 |
+
<!-- {{svg "octicon-plus"}}-->
|
154 |
+
<!-- <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>-->
|
155 |
+
<!-- <span class="mobile-only">{{ctx.Locale.Tr "create_new"}}</span>-->
|
156 |
+
<!-- </span>-->
|
157 |
+
<!-- <div class="menu">-->
|
158 |
+
<!-- <a class="item" href="{{AppSubUrl}}/repo/create">-->
|
159 |
+
<!-- {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}-->
|
160 |
+
<!-- </a>-->
|
161 |
+
<!-- -->
|
162 |
+
<!-- <a class="item" href="{{AppSubUrl}}/create/dataset">-->
|
163 |
+
<!-- {{svg "octicon-plus"}} creat/dataset-->
|
164 |
+
<!-- <!– {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}} –>-->
|
165 |
+
<!-- </a>-->
|
166 |
+
<!-- <a class="item" href="{{AppSubUrl}}/create/space">-->
|
167 |
+
<!-- {{svg "octicon-plus"}} creat/space-->
|
168 |
+
<!-- <!– {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}} –>-->
|
169 |
+
<!-- </a>-->
|
170 |
+
<!-- <a class="item" href="{{AppSubUrl}}/create/collection">-->
|
171 |
+
<!-- {{svg "octicon-plus"}} create/collection-->
|
172 |
+
<!-- <!– {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}} –>-->
|
173 |
+
<!-- </a>-->
|
174 |
+
<!-- -->
|
175 |
+
<!-- {{if .SignedUser.CanCreateOrganization}}-->
|
176 |
+
<!-- <a class="item" href="{{AppSubUrl}}/org/create">-->
|
177 |
+
<!-- {{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}-->
|
178 |
+
<!-- </a>-->
|
179 |
+
<!-- {{end}}-->
|
180 |
+
<!-- <!– {{if not .DisableMigrations}}-->
|
181 |
+
<!-- <a class="item" href="{{AppSubUrl}}/repo/migrate">-->
|
182 |
+
<!-- {{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}-->
|
183 |
+
<!-- </a>-->
|
184 |
+
<!-- {{end}} –>-->
|
185 |
+
<!-- </div><!– end content create new menu –>-->
|
186 |
+
<!-- </div><!– end dropdown menu create new –>-->
|
187 |
+
|
188 |
+
<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
189 |
+
<span class="text gt-df gt-ac">
|
190 |
+
{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
|
191 |
+
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
|
192 |
+
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
193 |
+
</span>
|
194 |
+
<div class="menu user-menu">
|
195 |
+
<div class="ui header">
|
196 |
+
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
197 |
+
</div>
|
198 |
+
|
199 |
+
<!-- <div class="divider"></div> -->
|
200 |
+
<a class="item" href="{{.SignedUser.HomeLink}}">
|
201 |
+
{{svg "octicon-person"}}
|
202 |
+
{{ctx.Locale.Tr "your_profile"}}
|
203 |
+
</a>
|
204 |
+
{{if not .DisableStars}}
|
205 |
+
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
206 |
+
{{svg "octicon-star"}}
|
207 |
+
{{ctx.Locale.Tr "your_starred"}}
|
208 |
+
</a>
|
209 |
+
{{end}}
|
210 |
+
|
211 |
+
<div class="divider"></div>
|
212 |
+
<a class="item" href="{{AppSubUrl}}/repo/create">
|
213 |
+
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
|
214 |
+
</a>
|
215 |
+
|
216 |
+
<a class="item" href="{{AppSubUrl}}/repo/create/dataset">
|
217 |
+
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_dataset"}}
|
218 |
+
<!-- {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}} -->
|
219 |
+
</a>
|
220 |
+
<a class="item" href="{{AppSubUrl}}/repo/create/space">
|
221 |
+
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_space"}}
|
222 |
+
<!-- {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}} -->
|
223 |
+
</a>
|
224 |
+
<a class="item" href="{{AppSubUrl}}/repo/create/collection">
|
225 |
+
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_collection"}}
|
226 |
+
<!-- {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}} -->
|
227 |
+
</a>
|
228 |
+
|
229 |
+
{{if .SignedUser.CanCreateOrganization}}
|
230 |
+
<a class="item" href="{{AppSubUrl}}/org/create">
|
231 |
+
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
|
232 |
+
</a>
|
233 |
+
{{end}}
|
234 |
+
<a class="item" href="{{.SignedUser.HomeLink}}">
|
235 |
+
{{svg "octicon-person"}}
|
236 |
+
{{ctx.Locale.Tr "your_profile"}}
|
237 |
+
</a>
|
238 |
+
{{if not .DisableStars}}
|
239 |
+
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
240 |
+
{{svg "octicon-star"}}
|
241 |
+
{{ctx.Locale.Tr "your_starred"}}
|
242 |
+
</a>
|
243 |
+
{{end}}
|
244 |
+
|
245 |
+
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
|
246 |
+
{{svg "octicon-bell"}}
|
247 |
+
{{ctx.Locale.Tr "notification.subscriptions"}}
|
248 |
+
</a>
|
249 |
+
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
250 |
+
{{svg "octicon-tools"}}
|
251 |
+
{{ctx.Locale.Tr "your_settings"}}
|
252 |
+
</a>
|
253 |
+
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">
|
254 |
+
{{svg "octicon-question"}}
|
255 |
+
{{ctx.Locale.Tr "help"}}
|
256 |
+
</a>
|
257 |
+
{{if .IsAdmin}}
|
258 |
+
<div class="divider"></div>
|
259 |
+
|
260 |
+
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/admin">
|
261 |
+
{{svg "octicon-server"}}
|
262 |
+
{{ctx.Locale.Tr "admin_panel"}}
|
263 |
+
</a>
|
264 |
+
{{end}}
|
265 |
+
|
266 |
+
<div class="divider"></div>
|
267 |
+
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
268 |
+
{{svg "octicon-sign-out"}}
|
269 |
+
{{ctx.Locale.Tr "sign_out"}}
|
270 |
+
</a>
|
271 |
+
</div><!-- end content avatar menu -->
|
272 |
+
</div><!-- end dropdown avatar menu -->
|
273 |
+
{{else}}
|
274 |
+
{{if .ShowRegistrationButton}}
|
275 |
+
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
|
276 |
+
{{svg "octicon-person"}} {{ctx.Locale.Tr "register"}}
|
277 |
+
</a>
|
278 |
+
{{end}}
|
279 |
+
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
|
280 |
+
{{svg "octicon-sign-in"}} {{ctx.Locale.Tr "sign_in"}}
|
281 |
+
</a>
|
282 |
+
{{end}}
|
283 |
+
</div><!-- end full right menu -->
|
284 |
+
|
285 |
+
</nav>
|