[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
|
@ -6,9 +6,7 @@ package webhook
|
|||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"html/template"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
webhook_model "code.gitea.io/gitea/models/webhook"
|
||||
|
@ -354,9 +352,3 @@ 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