[REFACTOR] webhook shared code to prevent import cycles
This commit is contained in:
parent
c4adb08d6d
commit
04a398a1af
17 changed files with 232 additions and 211 deletions
15
services/webhook/shared/img.go
Normal file
15
services/webhook/shared/img.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package shared
|
||||
|
||||
import (
|
||||
"html"
|
||||
"html/template"
|
||||
"strconv"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
)
|
||||
|
||||
func ImgIcon(name string, size int) template.HTML {
|
||||
s := strconv.Itoa(size)
|
||||
src := html.EscapeString(setting.StaticURLPrefix + "/assets/img/" + name)
|
||||
return template.HTML(`<img width="` + s + `" height="` + s + `" src="` + src + `">`)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue