forked from forgejo/forgejo
[REFACTOR] add Icon to webhook.Interface
This commit is contained in:
parent
7f03fdf9f9
commit
84eeab59af
15 changed files with 54 additions and 2 deletions
|
@ -6,7 +6,9 @@ package webhook
|
|||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"html/template"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
webhook_model "code.gitea.io/gitea/models/webhook"
|
||||
|
@ -352,3 +354,9 @@ func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {
|
|||
Created: w.CreatedUnix.AsTime(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
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