From 41354392d12ce31a1aee81f70214d3a1cabae9cc Mon Sep 17 00:00:00 2001 From: baronbunny Date: Sun, 23 Oct 2022 19:01:07 +0800 Subject: [PATCH 1/2] UI: bug fix, replace html tags with
in button: delete branch reason: - unified code style - Edge Browser Warning: `Links must have discernible text: Element has no title attribute` - Using an empty anchor as an HTML tag will point to the current page, which cause the page jump before the execution of JavaScript Signed-off-by: baronbunny --- templates/repo/branch/list.tmpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 09799fbece577..2da3a27317c49 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -123,11 +123,15 @@ {{end}} {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} {{if .IsDeleted}} - {{svg "octicon-reply"}} +
+ + {{svg "octicon-reply"}} + +
{{else}} - + {{end}} {{end}} From 16e9f4edd004150d9eece61c9e05ce119370c0f3 Mon Sep 17 00:00:00 2001 From: baronbunny Date: Mon, 24 Oct 2022 08:59:20 +0800 Subject: [PATCH 2/2] UI: use `button` tags as buttons in branch view Instead of divs these should be buttons so Screen readers know they are buttons Signed-off-by: baronbunny --- templates/repo/branch/list.tmpl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 2da3a27317c49..3702410df504d 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -22,18 +22,18 @@ {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} -
+
+ {{end}} {{if not $.DisableDownloadSourceArchives}} - + {{end}} @@ -108,30 +108,30 @@ {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} -
+
+ {{end}} {{if and (not .IsDeleted) (not $.DisableDownloadSourceArchives)}} - + {{end}} {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} {{if .IsDeleted}} -
+
+ {{else}} -
+
+ {{end}} {{end}}