Skip to content

Commit b2de034

Browse files
authored
CSS navbar and color tweaks (#13609)
* CSS and color tweaks - Unify navbar-style menus - Fix admin bar overlapping menu bar - Fixes file edit comment box - Fix double border on review box - Fix review timeline icons * Many fixes to new-menu and navbar layout enhancements * misc settings fixes * navbar tweak * fix pr tabs * branch tag and arc color tweaks
1 parent 03fa2ec commit b2de034

18 files changed

+267
-291
lines changed

templates/admin/navbar.tmpl

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu navbar">
2-
<a class="{{if .PageIsAdminDashboard}}active{{end}} item" href="{{AppSubUrl}}/admin">
3-
{{.i18n.Tr "admin.dashboard"}}
4-
</a>
5-
<a class="{{if .PageIsAdminUsers}}active{{end}} item" href="{{AppSubUrl}}/admin/users">
6-
{{.i18n.Tr "admin.users"}}
7-
</a>
8-
<a class="{{if .PageIsAdminOrganizations}}active{{end}} item" href="{{AppSubUrl}}/admin/orgs">
9-
{{.i18n.Tr "admin.organizations"}}
10-
</a>
11-
<a class="{{if .PageIsAdminRepositories}}active{{end}} item" href="{{AppSubUrl}}/admin/repos">
12-
{{.i18n.Tr "admin.repositories"}}
13-
</a>
14-
<a class="{{if .PageIsAdminHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
15-
{{.i18n.Tr "admin.hooks"}}
16-
</a>
17-
<a class="{{if .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/system-hooks">
18-
{{.i18n.Tr "admin.systemhooks"}}
19-
</a>
20-
<a class="{{if .PageIsAdminAuthentications}}active{{end}} item" href="{{AppSubUrl}}/admin/auths">
21-
{{.i18n.Tr "admin.authentication"}}
22-
</a>
23-
<a class="{{if .PageIsAdminEmails}}active{{end}} item" href="{{AppSubUrl}}/admin/emails">
24-
{{.i18n.Tr "admin.emails"}}
25-
</a>
26-
<a class="{{if .PageIsAdminConfig}}active{{end}} item" href="{{AppSubUrl}}/admin/config">
27-
{{.i18n.Tr "admin.config"}}
28-
</a>
29-
<a class="{{if .PageIsAdminNotices}}active{{end}} item" href="{{AppSubUrl}}/admin/notices">
30-
{{.i18n.Tr "admin.notices"}}
31-
</a>
32-
<a class="{{if .PageIsAdminMonitor}}active{{end}} item" href="{{AppSubUrl}}/admin/monitor">
33-
{{.i18n.Tr "admin.monitor"}}
34-
</a>
2+
<div class="new-menu-inner">
3+
<a class="{{if .PageIsAdminDashboard}}active{{end}} item" href="{{AppSubUrl}}/admin">
4+
{{.i18n.Tr "admin.dashboard"}}
5+
</a>
6+
<a class="{{if .PageIsAdminUsers}}active{{end}} item" href="{{AppSubUrl}}/admin/users">
7+
{{.i18n.Tr "admin.users"}}
8+
</a>
9+
<a class="{{if .PageIsAdminOrganizations}}active{{end}} item" href="{{AppSubUrl}}/admin/orgs">
10+
{{.i18n.Tr "admin.organizations"}}
11+
</a>
12+
<a class="{{if .PageIsAdminRepositories}}active{{end}} item" href="{{AppSubUrl}}/admin/repos">
13+
{{.i18n.Tr "admin.repositories"}}
14+
</a>
15+
<a class="{{if .PageIsAdminHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
16+
{{.i18n.Tr "admin.hooks"}}
17+
</a>
18+
<a class="{{if .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/system-hooks">
19+
{{.i18n.Tr "admin.systemhooks"}}
20+
</a>
21+
<a class="{{if .PageIsAdminAuthentications}}active{{end}} item" href="{{AppSubUrl}}/admin/auths">
22+
{{.i18n.Tr "admin.authentication"}}
23+
</a>
24+
<a class="{{if .PageIsAdminEmails}}active{{end}} item" href="{{AppSubUrl}}/admin/emails">
25+
{{.i18n.Tr "admin.emails"}}
26+
</a>
27+
<a class="{{if .PageIsAdminConfig}}active{{end}} item" href="{{AppSubUrl}}/admin/config">
28+
{{.i18n.Tr "admin.config"}}
29+
</a>
30+
<a class="{{if .PageIsAdminNotices}}active{{end}} item" href="{{AppSubUrl}}/admin/notices">
31+
{{.i18n.Tr "admin.notices"}}
32+
</a>
33+
<a class="{{if .PageIsAdminMonitor}}active{{end}} item" href="{{AppSubUrl}}/admin/monitor">
34+
{{.i18n.Tr "admin.monitor"}}
35+
</a>
36+
</div>
3537
</div>

templates/repo/editor/commit_form.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
<img width="48" height="48" class="ui image commit-avatar" src="{{.SignedUser.RelAvatarLink}}">
33
<div class="commit-form">
44
<h3>{{- if .CanCommitToBranch.WillSign}}
5-
<i title="{{.i18n.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}" class="lock green icon"></i>{{.i18n.Tr "repo.editor.commit_signed_changes"}}
5+
<span title="{{.i18n.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>
6+
{{.i18n.Tr "repo.editor.commit_signed_changes"}}
67
{{- else}}
7-
<i title="{{.i18n.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}" class="unlock grey icon"></i>{{.i18n.Tr "repo.editor.commit_changes"}}
8+
<span title="{{.i18n.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
9+
{{.i18n.Tr "repo.editor.commit_changes"}}
810
{{- end}}</h3>
911
<div class="field">
1012
<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.i18n.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.i18n.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.i18n.Tr "repo.editor.add_tmpl"}}{{else}}{{.i18n.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>

templates/repo/issue/view_content/comments.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,10 @@
403403
<img src="{{.Poster.RelAvatarLink}}">
404404
</a>
405405
{{end}}
406-
<span class="badge {{if eq .Review.Type 1}}green
407-
{{- else if eq .Review.Type 2}}grey
408-
{{- else if eq .Review.Type 3}}red
409-
{{- else}}grey{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon)}}</span>
406+
<span class="badge {{if eq .Review.Type 1}}bg-green
407+
{{- else if eq .Review.Type 2}}bg-grey
408+
{{- else if eq .Review.Type 3}}bg-red
409+
{{- else}}bg-grey{{end}} text-white">{{svg (printf "octicon-%s" .Review.Type.Icon)}}</span>
410410
<span class="text grey">
411411
{{if .OriginalAuthor }}
412412
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>

templates/repo/settings/navbar.tmpl

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu navbar">
2-
<a class="{{if .PageIsSettingsOptions}}active{{end}} item" href="{{.RepoLink}}/settings">
3-
{{.i18n.Tr "repo.settings.options"}}
4-
</a>
5-
<a class="{{if .PageIsSettingsCollaboration}}active{{end}} item" href="{{.RepoLink}}/settings/collaboration">
6-
{{.i18n.Tr "repo.settings.collaboration"}}
7-
</a>
8-
{{if not .Repository.IsEmpty}}
9-
<a class="{{if .PageIsSettingsBranches}}active{{end}} item" href="{{.RepoLink}}/settings/branches">
10-
{{.i18n.Tr "repo.settings.branches"}}
2+
<div class="new-menu-inner">
3+
<a class="{{if .PageIsSettingsOptions}}active{{end}} item" href="{{.RepoLink}}/settings">
4+
{{.i18n.Tr "repo.settings.options"}}
115
</a>
12-
{{end}}
13-
<a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks">
14-
{{.i18n.Tr "repo.settings.hooks"}}
15-
</a>
16-
{{if .SignedUser.CanEditGitHook}}
17-
<a class="{{if .PageIsSettingsGitHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks/git">
18-
{{.i18n.Tr "repo.settings.githooks"}}
6+
<a class="{{if .PageIsSettingsCollaboration}}active{{end}} item" href="{{.RepoLink}}/settings/collaboration">
7+
{{.i18n.Tr "repo.settings.collaboration"}}
198
</a>
20-
{{end}}
21-
<a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{.RepoLink}}/settings/keys">
22-
{{.i18n.Tr "repo.settings.deploy_keys"}}
23-
</a>
24-
{{if .LFSStartServer}}
25-
<a class="{{if .PageIsSettingsLFS}}active{{end}} item" href="{{.RepoLink}}/settings/lfs">
26-
{{.i18n.Tr "repo.settings.lfs"}}
9+
{{if not .Repository.IsEmpty}}
10+
<a class="{{if .PageIsSettingsBranches}}active{{end}} item" href="{{.RepoLink}}/settings/branches">
11+
{{.i18n.Tr "repo.settings.branches"}}
12+
</a>
13+
{{end}}
14+
<a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks">
15+
{{.i18n.Tr "repo.settings.hooks"}}
2716
</a>
28-
{{end}}
17+
{{if .SignedUser.CanEditGitHook}}
18+
<a class="{{if .PageIsSettingsGitHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks/git">
19+
{{.i18n.Tr "repo.settings.githooks"}}
20+
</a>
21+
{{end}}
22+
<a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{.RepoLink}}/settings/keys">
23+
{{.i18n.Tr "repo.settings.deploy_keys"}}
24+
</a>
25+
{{if .LFSStartServer}}
26+
<a class="{{if .PageIsSettingsLFS}}active{{end}} item" href="{{.RepoLink}}/settings/lfs">
27+
{{.i18n.Tr "repo.settings.lfs"}}
28+
</a>
29+
{{end}}
30+
</div>
2931
</div>

templates/user/auth/link_account.tmpl

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@
22

33
<div class="user link-account">
44
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
5-
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
6-
<a class="item {{if not .user_exists}}active{{end}}"
7-
data-tab="auth-link-signup-tab">
8-
{{.i18n.Tr "auth.oauth_signup_tab"}}
9-
</a>
10-
<a class="item {{if .user_exists}}active{{end}}"
11-
data-tab="auth-link-signin-tab">
12-
{{.i18n.Tr "auth.oauth_signin_tab"}}
13-
</a>
14-
</div>
15-
16-
<div class="ui middle very relaxed page grid">
17-
<div class="column">
18-
<div class="ui tab {{if not .user_exists}}active{{end}}"
5+
<div class="new-menu-inner">
6+
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
7+
<a class="item {{if not .user_exists}}active{{end}}"
198
data-tab="auth-link-signup-tab">
20-
{{template "user/auth/signup_inner" .}}
21-
</div>
22-
<div class="ui tab {{if .user_exists}}active{{end}}"
9+
{{.i18n.Tr "auth.oauth_signup_tab"}}
10+
</a>
11+
<a class="item {{if .user_exists}}active{{end}}"
2312
data-tab="auth-link-signin-tab">
24-
<div class="ui user signin container icon">
25-
{{template "user/auth/signin_inner" .}}
13+
{{.i18n.Tr "auth.oauth_signin_tab"}}
14+
</a>
15+
</div>
16+
17+
<div class="ui middle very relaxed page grid">
18+
<div class="column">
19+
<div class="ui tab {{if not .user_exists}}active{{end}}"
20+
data-tab="auth-link-signup-tab">
21+
{{template "user/auth/signup_inner" .}}
22+
</div>
23+
<div class="ui tab {{if .user_exists}}active{{end}}"
24+
data-tab="auth-link-signin-tab">
25+
<div class="ui user signin container icon">
26+
{{template "user/auth/signin_inner" .}}
27+
</div>
2628
</div>
2729
</div>
2830
</div>
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{{if or .EnableOpenIDSignIn .EnableSSPI}}
22
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
3-
<a class="{{if .PageIsLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login">
4-
{{.i18n.Tr "auth.login_userpass"}}
5-
</a>
6-
{{if .EnableOpenIDSignIn}}
7-
<a class="{{if .PageIsLoginOpenID}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/openid">
8-
<i class="fa fa-openid"></i>
9-
&nbsp;OpenID
10-
</a>
11-
{{end}}
12-
{{if .EnableSSPI}}
13-
<a class="item" rel="nofollow" href="{{AppSubUrl}}/user/login?auth_with_sspi=1">
14-
<i class="fa fa-windows"></i>
15-
&nbsp;SSPI
16-
</a>
17-
{{end}}
3+
<div class="new-menu-inner">
4+
<a class="{{if .PageIsLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login">
5+
{{.i18n.Tr "auth.login_userpass"}}
6+
</a>
7+
{{if .EnableOpenIDSignIn}}
8+
<a class="{{if .PageIsLoginOpenID}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/openid">
9+
<i class="fa fa-openid"></i>
10+
&nbsp;OpenID
11+
</a>
12+
{{end}}
13+
{{if .EnableSSPI}}
14+
<a class="item" rel="nofollow" href="{{AppSubUrl}}/user/login?auth_with_sspi=1">
15+
<i class="fa fa-windows"></i>
16+
&nbsp;SSPI
17+
</a>
18+
{{end}}
19+
</div>
1820
</div>
1921
{{end}}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu navbar">
2-
<a class="{{if .PageIsOpenIDConnect}}active{{end}} item" href="{{AppSubUrl}}/user/openid/connect">
3-
{{.i18n.Tr "auth.openid_connect_title"}}
4-
</a>
5-
{{if .EnableOpenIDSignUp}}
6-
<a class="{{if .PageIsOpenIDRegister}}active{{end}} item" href="{{AppSubUrl}}/user/openid/register">
7-
{{.i18n.Tr "auth.openid_register_title"}}
2+
<div class="new-menu-inner">
3+
<a class="{{if .PageIsOpenIDConnect}}active{{end}} item" href="{{AppSubUrl}}/user/openid/connect">
4+
{{.i18n.Tr "auth.openid_connect_title"}}
85
</a>
9-
{{end}}
6+
{{if .EnableOpenIDSignUp}}
7+
<a class="{{if .PageIsOpenIDRegister}}active{{end}} item" href="{{AppSubUrl}}/user/openid/register">
8+
{{.i18n.Tr "auth.openid_register_title"}}
9+
</a>
10+
{{end}}
11+
</div>
1012
</div>
1113

templates/user/profile.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{template "base/head" .}}
2-
<div class="user profile">
2+
<div class="user profile mt-5">
33
<div class="ui container">
44
<div class="ui stackable grid">
55
<div class="ui five wide column">

templates/user/settings/navbar.tmpl

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu navbar">
2-
<a class="{{if .PageIsSettingsProfile}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
3-
{{.i18n.Tr "settings.profile"}}
4-
</a>
5-
<a class="{{if .PageIsSettingsAccount}}active{{end}} item" href="{{AppSubUrl}}/user/settings/account">
6-
{{.i18n.Tr "settings.account"}}
7-
</a>
8-
<a class="{{if .PageIsSettingsSecurity}}active{{end}} item" href="{{AppSubUrl}}/user/settings/security">
9-
{{.i18n.Tr "settings.security"}}
10-
</a>
11-
<a class="{{if .PageIsSettingsApplications}}active{{end}} item" href="{{AppSubUrl}}/user/settings/applications">
12-
{{.i18n.Tr "settings.applications"}}
13-
</a>
14-
<a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{AppSubUrl}}/user/settings/keys">
15-
{{.i18n.Tr "settings.ssh_gpg_keys"}}
16-
</a>
17-
<a class="{{if .PageIsSettingsOrganization}}active{{end}} item" href="{{AppSubUrl}}/user/settings/organization">
18-
{{.i18n.Tr "settings.organization"}}
19-
</a>
20-
<a class="{{if .PageIsSettingsRepos}}active{{end}} item" href="{{AppSubUrl}}/user/settings/repos">
21-
{{.i18n.Tr "settings.repos"}}
22-
</a>
2+
<div class="new-menu-inner">
3+
<a class="{{if .PageIsSettingsProfile}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
4+
{{.i18n.Tr "settings.profile"}}
5+
</a>
6+
<a class="{{if .PageIsSettingsAccount}}active{{end}} item" href="{{AppSubUrl}}/user/settings/account">
7+
{{.i18n.Tr "settings.account"}}
8+
</a>
9+
<a class="{{if .PageIsSettingsSecurity}}active{{end}} item" href="{{AppSubUrl}}/user/settings/security">
10+
{{.i18n.Tr "settings.security"}}
11+
</a>
12+
<a class="{{if .PageIsSettingsApplications}}active{{end}} item" href="{{AppSubUrl}}/user/settings/applications">
13+
{{.i18n.Tr "settings.applications"}}
14+
</a>
15+
<a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{AppSubUrl}}/user/settings/keys">
16+
{{.i18n.Tr "settings.ssh_gpg_keys"}}
17+
</a>
18+
<a class="{{if .PageIsSettingsOrganization}}active{{end}} item" href="{{AppSubUrl}}/user/settings/organization">
19+
{{.i18n.Tr "settings.organization"}}
20+
</a>
21+
<a class="{{if .PageIsSettingsRepos}}active{{end}} item" href="{{AppSubUrl}}/user/settings/repos">
22+
{{.i18n.Tr "settings.repos"}}
23+
</a>
24+
</div>
2325
</div>

web_src/less/_admin.less

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
}
4545
}
4646

47-
.ui.header,
48-
.ui.segment {
49-
box-shadow: 0 1px 2px 0 var(--color-secondary);
50-
}
51-
5247
&.user {
5348
.email {
5449
max-width: 200px;

0 commit comments

Comments
 (0)