summaryrefslogtreecommitdiffstats
path: root/services/webhook/general.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/webhook/general.go')
-rw-r--r--services/webhook/general.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/webhook/general.go b/services/webhook/general.go
index c41f58fe8d..454efc6495 100644
--- a/services/webhook/general.go
+++ b/services/webhook/general.go
@@ -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 + `">`)
+}