0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-14 10:08:30 -05:00

Added alt's to <img>

This commit is contained in:
Antonin Del Fabbro 2025-01-08 19:26:42 +01:00 committed by Robert Wolff
parent b1590068a7
commit c9b72d5b27
10 changed files with 24 additions and 24 deletions

View file

@ -34,7 +34,7 @@ func AvatarHTML(src string, size int, class, name string) template.HTML {
name = "avatar"
}
return template.HTML(`<img loading="lazy" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
return template.HTML(`<img loading="lazy" alt="" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
}
// Avatar renders user avatars. args: user, size (int), class (string)

View file

@ -112,7 +112,7 @@ Here are some links to the most important topics. You can find the full list of
<h2 id="user-content-quick-links">Quick Links</h2>
<p>Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
<p><a href="` + FullURL + `wiki/Configuration" rel="nofollow">Configuration</a>
<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>
<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>
`,
}

View file

@ -363,5 +363,5 @@
</div>
</div>
</div>
<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" width="256" height="256">
<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" alt="{{ctx.Locale.Tr "loading"}}" width="256" height="256">
{{template "base/footer" .}}

View file

@ -22,7 +22,7 @@
{{if .blobBase}}
<span class="side">
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_before"}}</p>
<span class="before-container"><img class="image-before"></span>
<span class="before-container"><img class="image-before" alt=""></span>
<p>
<span class="bounds-info-before">
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
@ -37,7 +37,7 @@
{{if .blobHead}}
<span class="side">
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_after"}}</p>
<span class="after-container"><img class="image-after"></span>
<span class="after-container"><img class="image-after" alt=""></span>
<p>
<span class="bounds-info-after">
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
@ -55,9 +55,9 @@
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.Index}}">
<div class="diff-swipe">
<div class="swipe-frame">
<span class="before-container"><img class="image-before"></span>
<span class="before-container"><img class="image-before" alt="{{ctx.Locale.Tr "repo.diff.file_before"}}"></span>
<span class="swipe-container">
<span class="after-container"><img class="image-after"></span>
<span class="after-container"><img class="image-after" alt="{{ctx.Locale.Tr "repo.diff.file_after"}}"></span>
</span>
<span class="swipe-bar">
<span class="handle top-handle"></span>
@ -70,8 +70,8 @@
<div class="diff-overlay">
<input type="range" min="0" max="100" value="50">
<div class="overlay-frame">
<span class="before-container"><img class="image-before"></span>
<span class="after-container"><img class="image-after"></span>
<span class="before-container"><img class="image-before" alt="{{ctx.Locale.Tr "repo.diff.file_before"}}"></span>
<span class="after-container"><img class="image-after" alt="{{ctx.Locale.Tr "repo.diff.file_after"}}"></span>
</div>
</div>
</div>

View file

@ -602,7 +602,7 @@
<div class="timeline-item-group">
<div class="timeline-item event" id="{{.HashTag}}">
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
<img src="{{.Poster.AvatarLink $.Context}}" width="40" height="40">
<img src="{{.Poster.AvatarLink $.Context}}" alt="" width="40" height="40">
</a>
<span class="badge grey">{{svg "octicon-x" 16}}</span>
<span class="text grey muted-links">

View file

@ -9,7 +9,7 @@
<div class="ui stackable middle very relaxed page grid">
<div id="repo_migrating" class="sixteen wide center aligned centered column" data-migrating-task-id="{{.MigrateTask.ID}}">
<div>
<img src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" width="256" height="256">
<img src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" alt="{{ctx.Locale.Tr "loading"}}" width="256" height="256">
</div>
</div>
<div id="repo_migrating_failed_image" class="sixteen wide center aligned centered column tw-hidden">

View file

@ -21,7 +21,7 @@
{{else if not .IsTextFile}}
<div class="view-raw">
{{if .IsImageFile}}
<img src="{{$.RawFileLink}}">
<img src="{{$.RawFileLink}}" alt="">
{{else if .IsVideoFile}}
<video controls src="{{$.RawFileLink}}">
<strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>

View file

@ -3,27 +3,27 @@
{{$size = .Size}}
{{end}}
{{if eq .HookType "forgejo"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/forgejo.svg">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/forgejo.svg" alt="">
{{else if eq .HookType "gitea"}}
{{svg "gitea-gitea" $size "img"}}
{{else if eq .HookType "gogs"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico" alt="">
{{else if eq .HookType "slack"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png" alt="">
{{else if eq .HookType "discord"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png" alt="">
{{else if eq .HookType "dingtalk"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico" alt="">
{{else if eq .HookType "telegram"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png" alt="">
{{else if eq .HookType "msteams"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png" alt="">
{{else if eq .HookType "feishu"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/feishu.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/feishu.png" alt="">
{{else if eq .HookType "matrix"}}
{{svg "gitea-matrix" $size "img"}}
{{else if eq .HookType "wechatwork"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png" alt="">
{{else if eq .HookType "packagist"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png" alt="">
{{end}}

View file

@ -1,7 +1,7 @@
{{if .EnableCaptcha}}{{if eq .CaptchaType "image"}}
<div class="inline field tw-text-center">
<input type="hidden" name="img-captcha-id" value="{{.Captcha}}">
<img style="transform: scaleX(-1)" onclick="this.src=`{{AppSubUrl}}/captcha/{{.Captcha}}.png?reload=${Date.now()}`" class="captcha-img" src="{{AppSubUrl}}/captcha/{{.Captcha}}.png">
<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"}}">
</div>
<div class="required field {{if .Err_Captcha}}error{{end}}">
<label for="captcha">{{ctx.Locale.Tr "captcha"}}</label>

View file

@ -91,7 +91,7 @@
{{range $push.Commits}}
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
<div class="flex-text-block">
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" alt="" title="{{.AuthorName}}" width="16" height="16">
<a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
<span class="text truncate">
{{RenderCommitMessage $.Context .Message ($repo.ComposeMetas ctx)}}