diff --git a/pyproject.toml b/pyproject.toml index 1d692aa57ca..531124bf819 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,4 +12,5 @@ dev = [ [tool.djlint] profile="golang" -ignore="H005,H013,H016,H020,H021,H030,H045,H046,H054" +ignore="H005,H013,H016,H020,H021,H030,H045" +include="H018" diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl index 8d08e7ad460..183e4180113 100644 --- a/templates/repo/diff/options_dropdown.tmpl +++ b/templates/repo/diff/options_dropdown.tmpl @@ -15,17 +15,9 @@ {{ctx.Locale.Tr "repo.pulls.collapse_files"}} {{if .Issue.Index}} {{if .ShowOutdatedComments}} - - - + {{ctx.Locale.Tr "repo.issues.review.option.hide_outdated_comments"}} {{else}} - - - + {{ctx.Locale.Tr "repo.issues.review.option.show_outdated_comments"}} {{end}} {{end}} diff --git a/templates/repo/diff/whitespace_dropdown.tmpl b/templates/repo/diff/whitespace_dropdown.tmpl index cf695791cad..d157f7228dc 100644 --- a/templates/repo/diff/whitespace_dropdown.tmpl +++ b/templates/repo/diff/whitespace_dropdown.tmpl @@ -1,29 +1,21 @@ diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl index e549ba50f37..5a467924efe 100644 --- a/templates/repo/issue/card.tmpl +++ b/templates/repo/issue/card.tmpl @@ -4,7 +4,7 @@ {{if $attachments}}
{{range $att := $attachments}} - {{$att.Name}} + {{$att.Name}} {{end}}
{{end}} diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl index 60290e90842..e3ded9ac50f 100644 --- a/templates/repo/issue/choose.tmpl +++ b/templates/repo/issue/choose.tmpl @@ -38,7 +38,7 @@
{{ctx.Locale.Tr "repo.issues.choose.blank"}} -
{{ctx.Locale.Tr "repo.issues.choose.blank_about"}} +
{{ctx.Locale.Tr "repo.issues.choose.blank_about"}}
{{ctx.Locale.Tr "repo.issues.choose.get_started"}} diff --git a/templates/repo/view_content.tmpl b/templates/repo/view_content.tmpl index ac9be6b21c8..de58019fe53 100644 --- a/templates/repo/view_content.tmpl +++ b/templates/repo/view_content.tmpl @@ -70,7 +70,7 @@ {{$addFilePath = ""}} {{end}} {{end}} - +
{{if and (not .IsViewFile) (not $isTreePathRoot)}} - +
{{end}} {{end}} diff --git a/templates/shared/user/block_user_dialog.tmpl b/templates/shared/user/block_user_dialog.tmpl index 41b5dbdcdfc..3c5d5450705 100644 --- a/templates/shared/user/block_user_dialog.tmpl +++ b/templates/shared/user/block_user_dialog.tmpl @@ -3,8 +3,8 @@
{{ctx.Locale.Tr "user.block.info"}} {{ctx.Locale.Tr "user.block.info.docs"}}
{{end}}{{/*end if .EnablePasswordSignInForm*/}} {{$showExternalAuthMethods := or .OAuth2Providers .EnableOpenIDSignIn .EnableSSPI}} @@ -59,14 +61,18 @@ {{if or .EnablePasskeyAuth .ShowRegistrationButton}}
-
+
{{if .EnablePasskeyAuth}} - {{template "user/auth/webauthn_error" .}} - + {{end}} {{if .ShowRegistrationButton}} -
+
{{ctx.Locale.Tr "auth.need_account"}} {{ctx.Locale.Tr "auth.sign_up_now"}}
diff --git a/tests/e2e/login.test.ts b/tests/e2e/login.test.ts index 7f4b97f2ecc..56047fce7c6 100644 --- a/tests/e2e/login.test.ts +++ b/tests/e2e/login.test.ts @@ -7,11 +7,21 @@ test('homepage', async ({page}) => { await expect(page.getByRole('img', {name: 'Logo'})).toHaveAttribute('src', '/assets/img/logo.svg'); }); -test('login form and logout', async ({page}) => { +test('login form in tab order and logout', async ({page}) => { await page.goto('/user/login'); await page.getByLabel('Username or Email Address').fill(env.GITEA_TEST_E2E_USER); - await page.getByLabel('Password').fill(env.GITEA_TEST_E2E_PASSWORD); - await page.getByRole('button', {name: 'Sign In'}).click(); + await page.keyboard.press('Tab'); + const password = page.getByLabel('Password'); + await expect(password).toBeFocused(); + await password.fill(env.GITEA_TEST_E2E_PASSWORD); + await page.keyboard.press('Tab'); + await expect(page.getByLabel('Remember This Device')).toBeFocused(); + await page.keyboard.press('Tab'); + const signIn = page.getByRole('button', {name: 'Sign In', exact: true}); + await expect(signIn).toBeFocused(); + await page.keyboard.press('Tab'); + await expect(page.getByRole('link', {name: 'Forgot password?'})).toBeFocused(); + await signIn.click(); await expect(page.getByRole('link', {name: 'Sign In'})).toBeHidden(); await logout(page); }); diff --git a/tests/e2e/webauthn.test.ts b/tests/e2e/webauthn.test.ts index 9816a4a0048..3c04f824ce1 100644 --- a/tests/e2e/webauthn.test.ts +++ b/tests/e2e/webauthn.test.ts @@ -15,7 +15,7 @@ async function signInWithPassword(page: Page, username: string) { await page.goto('/user/login'); await page.getByLabel('Username or Email Address').fill(username); await page.getByLabel('Password').fill(testUserPassword); - await page.getByRole('button', {name: 'Sign In'}).click(); + await page.getByRole('button', {name: 'Sign In', exact: true}).click(); } // regression: credProtect level 3 hid the credential from the second-factor login diff --git a/web_src/css/base.css b/web_src/css/base.css index ed8e1250ddb..b13b918083a 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -331,11 +331,21 @@ a.suppressed:hover { a:focus-visible, button:focus-visible, .ui.button:focus-visible, +.ui.dropdown:not(.selection):focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--color-primary); +} + +button:focus-visible, +.ui.button:focus-visible { outline-offset: -2px; } +.ui:is(.primary, .red, .green).button:focus-visible, +.ui:is(.primary, .red, .green).buttons .button:focus-visible { + outline-color: var(--color-text-dark); +} + a.silenced:hover { text-decoration-line: none; } diff --git a/web_src/css/helpers.css b/web_src/css/helpers.css index b3f728e5570..95608cb4bbb 100644 --- a/web_src/css/helpers.css +++ b/web_src/css/helpers.css @@ -30,6 +30,10 @@ Gitea's private styles use `g-` prefix. .interact-bg:hover { background: var(--color-hover) !important; } .interact-bg:active { background: var(--color-active) !important; } +/* sometimes, we'd like to make "