diff options
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r-- | modules/templates/helper.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index c4551bb4be..5a3969c098 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -82,6 +82,7 @@ func NewFuncMap() []template.FuncMap { "FileSize": base.FileSize, "Subtract": base.Subtract, "EntryIcon": base.EntryIcon, + "MigrationIcon": MigrationIcon, "Add": func(a, b int) int { return a + b }, @@ -540,3 +541,13 @@ func TrN(lang string, cnt interface{}, key1, keyN string) string { } return keyN } + +// MigrationIcon returns a Font Awesome name matching the service an issue/comment was migrated from +func MigrationIcon(hostname string) string { + switch hostname { + case "github.com": + return "fa-github" + default: + return "fa-git-alt" + } +} |