zz001 commited on
Commit
569e829
1 Parent(s): 22c1534

Upload head_navbar new.tmpl

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