Skip to content

Commit df33d98

Browse files
committed
Introduce .secondary-nav and handle margin universally
Fixes: #29981
1 parent f8ab9da commit df33d98

File tree

18 files changed

+38
-46
lines changed

18 files changed

+38
-46
lines changed

templates/admin/layout_head.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{template "base/head" .ctxData}}
22
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
3-
<div class="ui container gt-mb-4">
3+
<div class="ui container">
44
{{template "base/alert" .ctxData}}
55
</div>
66
<div class="ui container fluid padded flex-container">

templates/explore/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<overflow-menu class="ui secondary pointing tabular top attached borderless menu navbar">
1+
<overflow-menu class="ui secondary pointing tabular top attached borderless menu secondary-nav">
22
<div class="overflow-menu-items tw-justify-center">
33
<a class="{{if .PageIsExploreRepositories}}active {{end}}item" href="{{AppSubUrl}}/explore/repos">
44
{{svg "octicon-repo"}} {{ctx.Locale.Tr "explore.repos"}}

templates/repo/header.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="header-wrapper">
1+
<div class="secondary-nav">
22
{{with .Repository}}
33
<div class="ui container">
44
<div class="repo-header">
@@ -128,7 +128,7 @@
128128
{{if .IsGenerated}}<div class="fork-flag">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{(.TemplateRepo ctx).Link}}">{{(.TemplateRepo ctx).FullName}}</a></div>{{end}}
129129
</div>
130130
{{end}}
131-
<overflow-menu class="ui container secondary pointing tabular top attached borderless menu navbar tw-pt-0 tw-my-0">
131+
<overflow-menu class="ui container secondary pointing tabular top attached borderless menu tw-pt-0 tw-my-0">
132132
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
133133
<div class="overflow-menu-items">
134134
{{if .Permission.CanRead $.UnitTypeCode}}

templates/user/auth/link_account.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{template "base/head" .}}
22
<div role="main" aria-label="{{.Title}}" class="page-content user link-account">
3-
<overflow-menu class="ui secondary pointing tabular top attached borderless menu navbar tw-bg-header-wrapper">
3+
<overflow-menu class="ui secondary pointing tabular top attached borderless menu secondary-nav">
44
<div class="overflow-menu-items tw-justify-center">
55
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
66
{{if not .AllowOnlyInternalRegistration}}

templates/user/auth/signin_navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{if or .EnableOpenIDSignIn .EnableSSPI}}
2-
<overflow-menu class="ui secondary pointing tabular top attached borderless menu navbar tw-bg-header-wrapper">
2+
<overflow-menu class="ui secondary pointing tabular top attached borderless menu navbar secondary-nav">
33
<div class="overflow-menu-items tw-justify-center">
44
<a class="{{if .PageIsLogin}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login">
55
{{ctx.Locale.Tr "auth.login_userpass"}}

templates/user/auth/signup_openid_navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<overflow-menu class="ui secondary pointing tabular top attached borderless menu navbar tw-bg-header-wrapper">
1+
<overflow-menu class="ui secondary pointing tabular top attached borderless menu secondary-nav">
22
<div class="overflow-menu-items tw-justify-center">
33
<a class="{{if .PageIsOpenIDConnect}}active {{end}}item" href="{{AppSubUrl}}/user/openid/connect">
44
{{ctx.Locale.Tr "auth.openid_connect_title"}}

templates/user/dashboard/navbar.tmpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="dashboard-navbar">
1+
<div class="secondary-nav tw-border-b tw-border-b-secondary">
22
<div class="ui secondary stackable menu">
33
<div class="item">
44
<div class="ui floating dropdown jump">
@@ -105,4 +105,3 @@
105105
{{end}}
106106
</div>
107107
</div>
108-
<div class="divider tw-mt-0"></div>

tests/e2e/example.test.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('Test Register Form', async ({page}, workerInfo) => {
2323
await page.click('form button.ui.primary.button:visible');
2424
// Make sure we routed to the home page. Else login failed.
2525
await expect(page.url()).toBe(`${workerInfo.project.use.baseURL}/`);
26-
await expect(page.locator('.dashboard-navbar span>img.ui.avatar')).toBeVisible();
26+
await expect(page.locator('.secondary-nav span>img.ui.avatar')).toBeVisible();
2727
await expect(page.locator('.ui.positive.message.flash-success')).toHaveText('Account was successfully created. Welcome!');
2828

2929
save_visual(page);

tests/e2e/utils_e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function save_visual(page) {
5252
fullPage: true,
5353
timeout: 20000,
5454
mask: [
55-
page.locator('.dashboard-navbar span>img.ui.avatar'),
55+
page.locator('.secondary-nav span>img.ui.avatar'),
5656
page.locator('.ui.dropdown.jump.item span>img.ui.avatar'),
5757
],
5858
});

web_src/css/base.css

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,14 @@ img.ui.avatar,
738738
padding-bottom: 80px;
739739
}
740740

741-
.page-content.new:is(.repo,.migrate,.org),
742-
.page-content.profile:is(.user,.organization),
743-
.page-content.user:is(.settings,.notification) {
744-
padding-top: 15px;
741+
/* add margin below .secondary nav when it is the first child */
742+
.page-content > :first-child.secondary-nav {
743+
margin-bottom: 14px;
744+
}
745+
746+
/* this uses padding instead of margin because of negative margin on .ui.grid */
747+
.page-content > :first-child:not(.secondary-nav) {
748+
padding-top: 14px;
745749
}
746750

747751
/* overwrite semantic width of containers inside the main page content div (div with class "page-content") */
@@ -1323,7 +1327,6 @@ strong.attention-caution, svg.attention-caution {
13231327
}
13241328

13251329
overflow-menu {
1326-
margin-bottom: 15px !important;
13271330
border-bottom: 1px solid var(--color-secondary) !important;
13281331
display: flex;
13291332
}
@@ -1337,6 +1340,10 @@ overflow-menu .overflow-menu-items .item {
13371340
margin-bottom: 0 !important; /* reset fomantic's margin, because the active menu has special bottom border */
13381341
}
13391342

1343+
overflow-menu .ui.label {
1344+
margin-left: 7px !important;
1345+
}
1346+
13401347
.activity-bar-graph {
13411348
background-color: var(--color-primary);
13421349
color: var(--color-primary-contrast);

0 commit comments

Comments
 (0)