Skip to content

Commit c9b72d5

Browse files
Antonin Del Fabbromahlzahn
authored andcommitted
Added alt's to <img>
1 parent b159006 commit c9b72d5

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

modules/templates/util_avatar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func AvatarHTML(src string, size int, class, name string) template.HTML {
3434
name = "avatar"
3535
}
3636

37-
return template.HTML(`<img loading="lazy" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
37+
return template.HTML(`<img loading="lazy" alt="" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
3838
}
3939

4040
// Avatar renders user avatars. args: user, size (int), class (string)

routers/api/v1/misc/markup_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Here are some links to the most important topics. You can find the full list of
112112
<h2 id="user-content-quick-links">Quick Links</h2>
113113
<p>Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
114114
<p><a href="` + FullURL + `wiki/Configuration" rel="nofollow">Configuration</a>
115-
<a href="` + FullURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + FullURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt="images/icon-bug.png"/></a></p>
115+
<a href="` + FullURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + FullURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt=""/></a></p>
116116
`,
117117
}
118118

templates/install.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,5 +363,5 @@
363363
</div>
364364
</div>
365365
</div>
366-
<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" width="256" height="256">
366+
<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" alt="{{ctx.Locale.Tr "loading"}}" width="256" height="256">
367367
{{template "base/footer" .}}

templates/repo/diff/image_diff.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{{if .blobBase}}
2323
<span class="side">
2424
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_before"}}</p>
25-
<span class="before-container"><img class="image-before"></span>
25+
<span class="before-container"><img class="image-before" alt=""></span>
2626
<p>
2727
<span class="bounds-info-before">
2828
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
@@ -37,7 +37,7 @@
3737
{{if .blobHead}}
3838
<span class="side">
3939
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_after"}}</p>
40-
<span class="after-container"><img class="image-after"></span>
40+
<span class="after-container"><img class="image-after" alt=""></span>
4141
<p>
4242
<span class="bounds-info-after">
4343
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
@@ -55,9 +55,9 @@
5555
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.Index}}">
5656
<div class="diff-swipe">
5757
<div class="swipe-frame">
58-
<span class="before-container"><img class="image-before"></span>
58+
<span class="before-container"><img class="image-before" alt="{{ctx.Locale.Tr "repo.diff.file_before"}}"></span>
5959
<span class="swipe-container">
60-
<span class="after-container"><img class="image-after"></span>
60+
<span class="after-container"><img class="image-after" alt="{{ctx.Locale.Tr "repo.diff.file_after"}}"></span>
6161
</span>
6262
<span class="swipe-bar">
6363
<span class="handle top-handle"></span>
@@ -70,8 +70,8 @@
7070
<div class="diff-overlay">
7171
<input type="range" min="0" max="100" value="50">
7272
<div class="overlay-frame">
73-
<span class="before-container"><img class="image-before"></span>
74-
<span class="after-container"><img class="image-after"></span>
73+
<span class="before-container"><img class="image-before" alt="{{ctx.Locale.Tr "repo.diff.file_before"}}"></span>
74+
<span class="after-container"><img class="image-after" alt="{{ctx.Locale.Tr "repo.diff.file_after"}}"></span>
7575
</div>
7676
</div>
7777
</div>

templates/repo/issue/view_content/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@
602602
<div class="timeline-item-group">
603603
<div class="timeline-item event" id="{{.HashTag}}">
604604
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
605-
<img src="{{.Poster.AvatarLink $.Context}}" width="40" height="40">
605+
<img src="{{.Poster.AvatarLink $.Context}}" alt="" width="40" height="40">
606606
</a>
607607
<span class="badge grey">{{svg "octicon-x" 16}}</span>
608608
<span class="text grey muted-links">

templates/repo/migrate/migrating.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="ui stackable middle very relaxed page grid">
1010
<div id="repo_migrating" class="sixteen wide center aligned centered column" data-migrating-task-id="{{.MigrateTask.ID}}">
1111
<div>
12-
<img src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" width="256" height="256">
12+
<img src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" alt="{{ctx.Locale.Tr "loading"}}" width="256" height="256">
1313
</div>
1414
</div>
1515
<div id="repo_migrating_failed_image" class="sixteen wide center aligned centered column tw-hidden">

templates/repo/settings/lfs_file.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{{else if not .IsTextFile}}
2222
<div class="view-raw">
2323
{{if .IsImageFile}}
24-
<img src="{{$.RawFileLink}}">
24+
<img src="{{$.RawFileLink}}" alt="">
2525
{{else if .IsVideoFile}}
2626
<video controls src="{{$.RawFileLink}}">
2727
<strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>

templates/shared/webhook/icon.tmpl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
{{$size = .Size}}
44
{{end}}
55
{{if eq .HookType "forgejo"}}
6-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/forgejo.svg">
6+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/forgejo.svg" alt="">
77
{{else if eq .HookType "gitea"}}
88
{{svg "gitea-gitea" $size "img"}}
99
{{else if eq .HookType "gogs"}}
10-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico">
10+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico" alt="">
1111
{{else if eq .HookType "slack"}}
12-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png">
12+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png" alt="">
1313
{{else if eq .HookType "discord"}}
14-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png">
14+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png" alt="">
1515
{{else if eq .HookType "dingtalk"}}
16-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
16+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico" alt="">
1717
{{else if eq .HookType "telegram"}}
18-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png">
18+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png" alt="">
1919
{{else if eq .HookType "msteams"}}
20-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png">
20+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png" alt="">
2121
{{else if eq .HookType "feishu"}}
22-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/feishu.png">
22+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/feishu.png" alt="">
2323
{{else if eq .HookType "matrix"}}
2424
{{svg "gitea-matrix" $size "img"}}
2525
{{else if eq .HookType "wechatwork"}}
26-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png">
26+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png" alt="">
2727
{{else if eq .HookType "packagist"}}
28-
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png">
28+
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png" alt="">
2929
{{end}}

templates/user/auth/captcha.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{if .EnableCaptcha}}{{if eq .CaptchaType "image"}}
22
<div class="inline field tw-text-center">
33
<input type="hidden" name="img-captcha-id" value="{{.Captcha}}">
4-
<img style="transform: scaleX(-1)" onclick="this.src=`{{AppSubUrl}}/captcha/{{.Captcha}}.png?reload=${Date.now()}`" class="captcha-img" src="{{AppSubUrl}}/captcha/{{.Captcha}}.png">
4+
<img style="transform: scaleX(-1)" onclick="this.src=`{{AppSubUrl}}/captcha/{{.Captcha}}.png?reload=${Date.now()}`" class="captcha-img" src="{{AppSubUrl}}/captcha/{{.Captcha}}.png" alt="{{ctx.Locale.Tr "captcha"}}">
55
</div>
66
<div class="required field {{if .Err_Captcha}}error{{end}}">
77
<label for="captcha">{{ctx.Locale.Tr "captcha"}}</label>

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
{{range $push.Commits}}
9292
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
9393
<div class="flex-text-block">
94-
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
94+
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" alt="" title="{{.AuthorName}}" width="16" height="16">
9595
<a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
9696
<span class="text truncate">
9797
{{RenderCommitMessage $.Context .Message ($repo.ComposeMetas ctx)}}

0 commit comments

Comments
 (0)