diff --git a/modules/templates/helper.go b/modules/templates/helper.go index f8a93228ddc41..27d81ec9d9b94 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -911,13 +911,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 +// MigrationIcon returns a SVG name matching the service an issue/comment was migrated from func MigrationIcon(hostname string) string { switch hostname { case "github.com": - return "fa-github" + return "octicon-mark-github" default: - return "fa-git-alt" + return "gitea-git" } } diff --git a/public/img/svg/gitea-git.svg b/public/img/svg/gitea-git.svg index ed592a6bb5f78..f0d692251dc9e 100644 --- a/public/img/svg/gitea-git.svg +++ b/public/img/svg/gitea-git.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 86e314dc50756..ce99ccd9e9253 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -14,7 +14,7 @@
{{if .OriginalAuthor }} - + {{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}} {{ .OriginalAuthor }} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index d2928df342570..872c3b620b135 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -24,7 +24,7 @@
{{if .Issue.OriginalAuthor }} - + {{svg (MigrationIcon .Repository.GetOriginalURLHostname)}} {{ .Issue.OriginalAuthor }} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 7bc90b0434b70..dabba7bc7480e 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -24,7 +24,7 @@
{{if .OriginalAuthor }} - + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{ .OriginalAuthor }} @@ -408,7 +408,12 @@ {{svg (printf "octicon-%s" .Review.Type.Icon)}} {{if .OriginalAuthor }} - {{ .OriginalAuthor }} {{if $.Repository.OriginalURL}}({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{ .OriginalAuthor }} + + {{if $.Repository.OriginalURL}} + ({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}} {{else}} {{.Poster.GetDisplayName}} {{end}} @@ -433,7 +438,12 @@
{{if .OriginalAuthor }} - {{ .OriginalAuthor }} {{if $.Repository.OriginalURL}}({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{ .OriginalAuthor }} + + {{if $.Repository.OriginalURL}} + ({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}} {{else}} {{.Poster.GetDisplayName}} {{end}} @@ -526,7 +536,12 @@ {{end}} {{if .OriginalAuthor }} - {{ .OriginalAuthor }} {{if $.Repository.OriginalURL}}({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{ .OriginalAuthor }} + + {{if $.Repository.OriginalURL}} + ({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}} {{else}} {{.Poster.GetDisplayName}} {{end}} diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 2e624a9fbfb43..aa0f3dc91aa6a 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -86,7 +86,12 @@