Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d04e581

Browse files
authoredSep 18, 2021
Switch migration icon to svg (#15954)
Followup on #15952, use SVG for migration icon. <img width="541" alt="Screen Shot 2021-05-23 at 00 26 12" src="https://user-images.githubusercontent.com/115237/119242417-c1a37600-bb5d-11eb-9f97-a80aa89741ee.png"> <img width="540" alt="Screen Shot 2021-05-23 at 00 25 39" src="https://user-images.githubusercontent.com/115237/119242419-c2d4a300-bb5d-11eb-9792-1e6e4092c9f9.png">
1 parent b74a0f9 commit d04e581

File tree

9 files changed

+43
-14
lines changed

9 files changed

+43
-14
lines changed
 

‎modules/templates/helper.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -911,13 +911,13 @@ func TrN(lang string, cnt interface{}, key1, keyN string) string {
911911
return keyN
912912
}
913913

914-
// MigrationIcon returns a Font Awesome name matching the service an issue/comment was migrated from
914+
// MigrationIcon returns a SVG name matching the service an issue/comment was migrated from
915915
func MigrationIcon(hostname string) string {
916916
switch hostname {
917917
case "github.com":
918-
return "fa-github"
918+
return "octicon-mark-github"
919919
default:
920-
return "fa-git-alt"
920+
return "gitea-git"
921921
}
922922
}
923923

‎public/img/svg/gitea-git.svg

+1-1
Loading

‎templates/repo/diff/comments.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="comment-header-left df ac">
1515
{{if .OriginalAuthor }}
1616
<span class="text black mr-2">
17-
<i class="fa {{MigrationIcon $.root.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
17+
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
1818
{{ .OriginalAuthor }}
1919
</span>
2020
<span class="text grey">

‎templates/repo/issue/view_content.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="comment-header-left df ac">
2525
{{if .Issue.OriginalAuthor }}
2626
<span class="text black">
27-
<i class="fa {{MigrationIcon .Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
27+
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
2828
{{ .Issue.OriginalAuthor }}
2929
</span>
3030
<span class="text grey">

‎templates/repo/issue/view_content/comments.tmpl

+19-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="comment-header-left df ac">
2525
{{if .OriginalAuthor }}
2626
<span class="text black mr-2">
27-
<i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
27+
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
2828
{{ .OriginalAuthor }}
2929
</span>
3030
<span class="text grey">
@@ -408,7 +408,12 @@
408408
<span class="badge{{if eq .Review.Type 1}} bg-green text-white{{else if eq .Review.Type 3}} bg-red text-white{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon)}}</span>
409409
<span class="text grey">
410410
{{if .OriginalAuthor }}
411-
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
411+
<span class="text black">
412+
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
413+
{{ .OriginalAuthor }}
414+
</span>
415+
<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
416+
<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
412417
{{else}}
413418
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
414419
{{end}}
@@ -433,7 +438,12 @@
433438
<div class="ui top attached header comment-header df ac sb">
434439
<span class="text grey">
435440
{{if .OriginalAuthor }}
436-
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
441+
<span class="text black">
442+
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
443+
{{ .OriginalAuthor }}
444+
</span>
445+
<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
446+
<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
437447
{{else}}
438448
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
439449
{{end}}
@@ -526,7 +536,12 @@
526536
{{end}}
527537
<span class="text grey">
528538
{{if .OriginalAuthor }}
529-
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
539+
<span class="text black">
540+
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
541+
{{ .OriginalAuthor }}
542+
</span>
543+
<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
544+
<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
530545
{{else}}
531546
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
532547
{{end}}

‎templates/repo/issue/view_content/pull.tmpl

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@
8686
<div class="ui divider"></div>
8787
<div class="review-item">
8888
<div class="review-item-left">
89-
<a href="{{$.Repository.OriginalURL}}" class="ui poping up" data-content="{{$.i18n.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname | Safe }}"><span class="text black "><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span></a>
89+
<a href="{{$.Repository.OriginalURL}}" class="ui poping up" data-content="{{$.i18n.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname | Safe }}">
90+
<span class="text black ">
91+
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
92+
{{ .OriginalAuthor }}
93+
</span>
94+
</a>
9095
</div>
9196
<div class="review-item-right">
9297
<span class="type-icon text {{if eq .Type 1}}green

‎templates/repo/issue/view_content/sidebar.tmpl

+6-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@
7979
{{end}}
8080
{{range .OriginalReviews}}
8181
<div class="item" style="margin-bottom: 10px;">
82-
<a href="{{$.Repository.OriginalURL}}" class="ui poping up" data-content="{{$.i18n.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname | Safe }}"><span class="text black "><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span></a>
82+
<a href="{{$.Repository.OriginalURL}}" class="ui poping up" data-content="{{$.i18n.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname | Safe }}">
83+
<span class="text black">
84+
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
85+
{{ .OriginalAuthor }}
86+
</span>
87+
</a>
8388
<span class="ui right type-icon text {{if eq .Type 1}}green
8489
{{- else if eq .Type 2}}grey
8590
{{- else if eq .Type 3}}red

‎web_src/less/_base.less

+5-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ a.ui.card:hover,
10411041

10421042
.migrate {
10431043
color: var(--color-text-light-2) !important;
1044-
opacity: .5;
1044+
10451045
a {
10461046
color: var(--color-text-light) !important;
10471047

@@ -1770,6 +1770,10 @@ a.ui.basic.label:hover {
17701770
}
17711771
}
17721772

1773+
.migrate .svg.gitea-git {
1774+
color: #f05133; /* from https://upload.wikimedia.org/wikipedia/commons/e/e0/Git-logo.svg */
1775+
}
1776+
17731777
.ui.popup {
17741778
background-color: var(--color-body);
17751779
color: var(--color-secondary-dark-6);

‎web_src/svg/gitea-git.svg

+1-1
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.