]> source.dussan.org Git - gitea.git/commitdiff
Switch migration icon to svg (#15954)
authorsilverwind <me@silverwind.io>
Sat, 18 Sep 2021 16:22:51 +0000 (18:22 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Sep 2021 16:22:51 +0000 (17:22 +0100)
Followup on https://github.com/go-gitea/gitea/pull/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">

modules/templates/helper.go
public/img/svg/gitea-git.svg
templates/repo/diff/comments.tmpl
templates/repo/issue/view_content.tmpl
templates/repo/issue/view_content/comments.tmpl
templates/repo/issue/view_content/pull.tmpl
templates/repo/issue/view_content/sidebar.tmpl
web_src/less/_base.less
web_src/svg/gitea-git.svg

index f8a93228ddc415cf2d24792aa5e5d842e800af93..27d81ec9d9b9449e4bad5a2b67180bab5e686e7b 100644 (file)
@@ -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"
        }
 }
 
index ed592a6bb5f782e8d5308b09dace832e366b41fd..f0d692251dc9e404dedf0f8a0a7fbb8cff4bb599 100644 (file)
@@ -1 +1 @@
-<svg viewBox="0 0 48 48" class="svg gitea-git" width="16" height="16" aria-hidden="true"><path fill="#F4511E" d="M42.2 22.1 25.9 5.8c-.5-.5-1.2-.8-1.9-.8s-1.4.3-1.9.8l-3.5 3.5 4.1 4.1c.4-.2.8-.3 1.3-.3 1.7 0 3 1.3 3 3 0 .5-.1.9-.3 1.3l4 4c.4-.2.8-.3 1.3-.3 1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3c0-.5.1-.9.3-1.3l-4-4c-.1 0-.2.1-.3.1v10.4c1.2.4 2 1.5 2 2.8 0 1.7-1.3 3-3 3s-3-1.3-3-3c0-1.3.8-2.4 2-2.8V18.8c-1.2-.4-2-1.5-2-2.8 0-.5.1-.9.3-1.3l-4.1-4.1L5.8 22.1c-.5.5-.8 1.2-.8 1.9s.3 1.4.8 1.9l16.3 16.3c.5.5 1.2.8 1.9.8s1.4-.3 1.9-.8l16.3-16.3c.5-.5.8-1.2.8-1.9s-.3-1.4-.8-1.9z"/></svg>
\ No newline at end of file
+<svg viewBox="0 0 48 48" class="svg gitea-git" width="16" height="16" aria-hidden="true"><path d="M42.2 22.1 25.9 5.8c-.5-.5-1.2-.8-1.9-.8s-1.4.3-1.9.8l-3.5 3.5 4.1 4.1c.4-.2.8-.3 1.3-.3 1.7 0 3 1.3 3 3 0 .5-.1.9-.3 1.3l4 4c.4-.2.8-.3 1.3-.3 1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3c0-.5.1-.9.3-1.3l-4-4c-.1 0-.2.1-.3.1v10.4c1.2.4 2 1.5 2 2.8 0 1.7-1.3 3-3 3s-3-1.3-3-3c0-1.3.8-2.4 2-2.8V18.8c-1.2-.4-2-1.5-2-2.8 0-.5.1-.9.3-1.3l-4.1-4.1L5.8 22.1c-.5.5-.8 1.2-.8 1.9s.3 1.4.8 1.9l16.3 16.3c.5.5 1.2.8 1.9.8s1.4-.3 1.9-.8l16.3-16.3c.5-.5.8-1.2.8-1.9s-.3-1.4-.8-1.9z"/></svg>
\ No newline at end of file
index 86e314dc50756c0c2b9db368654e3b0bf2249afc..ce99ccd9e92536429a4701fdb4ed2e848b1f4050 100644 (file)
@@ -14,7 +14,7 @@
                        <div class="comment-header-left df ac">
                                {{if .OriginalAuthor }}
                                        <span class="text black mr-2">
-                                               <i class="fa {{MigrationIcon $.root.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
+                                               {{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
                                                {{ .OriginalAuthor }}
                                        </span>
                                        <span class="text grey">
index d2928df3425706b1516c9fea8c9ab09bf56b9817..872c3b620b135a7f505489ef7be45d142066deda 100644 (file)
@@ -24,7 +24,7 @@
                                                <div class="comment-header-left df ac">
                                                        {{if .Issue.OriginalAuthor }}
                                                                <span class="text black">
-                                                                       <i class="fa {{MigrationIcon .Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
+                                                                       {{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
                                                                        {{ .Issue.OriginalAuthor }}
                                                                </span>
                                                                <span class="text grey">
index 7bc90b0434b70494b236ea7756151d8ad95650a8..dabba7bc7480e7ce1255eca97d4ce5b1a86f61e1 100644 (file)
@@ -24,7 +24,7 @@
                                        <div class="comment-header-left df ac">
                                                {{if .OriginalAuthor }}
                                                        <span class="text black mr-2">
-                                                               <i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
+                                                               {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
                                                                {{ .OriginalAuthor }}
                                                        </span>
                                                        <span class="text grey">
                                <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>
                                <span class="text grey">
                                        {{if .OriginalAuthor }}
-                                               <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>
+                                               <span class="text black">
+                                                       {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
+                                                       {{ .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>
                                        {{else}}
                                                <a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
                                        {{end}}
                                        <div class="ui top attached header comment-header df ac sb">
                                                <span class="text grey">
                                                        {{if .OriginalAuthor }}
-                                                               <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>
+                                                               <span class="text black">
+                                                                       {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
+                                                                       {{ .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>
                                                        {{else}}
                                                                <a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
                                                        {{end}}
                                                                                                                        {{end}}
                                                                                                                        <span class="text grey">
                                                                                                                                {{if .OriginalAuthor }}
-                                                                                                                                       <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>
+                                                                                                                                       <span class="text black">
+                                                                                                                                               {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
+                                                                                                                                               {{ .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>
                                                                                                                                {{else}}
                                                                                                                                        <a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
                                                                                                                                {{end}}
index 2e624a9fbfb43efb49cc736a7a41581cec9e698d..aa0f3dc91aa6a8b0db9e02a604b33caa0feacb0e 100644 (file)
                                        <div class="ui divider"></div>
                                        <div class="review-item">
                                                <div class="review-item-left">
-                                                       <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>
+                                                       <a href="{{$.Repository.OriginalURL}}" class="ui poping up" data-content="{{$.i18n.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname | Safe }}">
+                                                               <span class="text black ">
+                                                                       {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
+                                                                       {{ .OriginalAuthor }}
+                                                               </span>
+                                                       </a>
                                                </div>
                                                <div class="review-item-right">
                                                        <span class="type-icon text {{if eq .Type 1}}green
index dc5f246d270c4deadbf62fd024ba156c13be9d46..2ebb02d8a9771a61658c36603b1d659f9b17fdda 100644 (file)
                                        {{end}}
                                        {{range .OriginalReviews}}
                                                <div class="item" style="margin-bottom: 10px;">
-                                                       <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>
+                                                       <a href="{{$.Repository.OriginalURL}}" class="ui poping up" data-content="{{$.i18n.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname | Safe }}">
+                                                               <span class="text black">
+                                                                       {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
+                                                                       {{ .OriginalAuthor }}
+                                                               </span>
+                                                       </a>
                                                        <span class="ui right type-icon text {{if eq .Type 1}}green
                                                                {{- else if eq .Type 2}}grey
                                                                {{- else if eq .Type 3}}red
index 8b951b2548d75d99fa10a129268e44fc64a7e717..55632687d4d7444224244d19c7b8484b8c0b02d0 100644 (file)
@@ -1041,7 +1041,7 @@ a.ui.card:hover,
 
   .migrate {
     color: var(--color-text-light-2) !important;
-    opacity: .5;
+
     a {
       color: var(--color-text-light) !important;
 
@@ -1770,6 +1770,10 @@ a.ui.basic.label:hover {
   }
 }
 
+.migrate .svg.gitea-git {
+  color: #f05133; /* from https://upload.wikimedia.org/wikipedia/commons/e/e0/Git-logo.svg */
+}
+
 .ui.popup {
   background-color: var(--color-body);
   color: var(--color-secondary-dark-6);
index fee8870daff029b1327ba0e47b30928df37b0878..8b8a7b5fedce9caf131b5fdc74556759460998ad 100644 (file)
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="64px" height="64px"><path fill="#F4511E" d="M42.2,22.1L25.9,5.8C25.4,5.3,24.7,5,24,5c0,0,0,0,0,0c-0.7,0-1.4,0.3-1.9,0.8l-3.5,3.5l4.1,4.1c0.4-0.2,0.8-0.3,1.3-0.3c1.7,0,3,1.3,3,3c0,0.5-0.1,0.9-0.3,1.3l4,4c0.4-0.2,0.8-0.3,1.3-0.3c1.7,0,3,1.3,3,3s-1.3,3-3,3c-1.7,0-3-1.3-3-3c0-0.5,0.1-0.9,0.3-1.3l-4-4c-0.1,0-0.2,0.1-0.3,0.1v10.4c1.2,0.4,2,1.5,2,2.8c0,1.7-1.3,3-3,3s-3-1.3-3-3c0-1.3,0.8-2.4,2-2.8V18.8c-1.2-0.4-2-1.5-2-2.8c0-0.5,0.1-0.9,0.3-1.3l-4.1-4.1L5.8,22.1C5.3,22.6,5,23.3,5,24c0,0.7,0.3,1.4,0.8,1.9l16.3,16.3c0,0,0,0,0,0c0.5,0.5,1.2,0.8,1.9,0.8s1.4-0.3,1.9-0.8l16.3-16.3c0.5-0.5,0.8-1.2,0.8-1.9C43,23.3,42.7,22.6,42.2,22.1z"/></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="64px" height="64px"><path d="M42.2,22.1L25.9,5.8C25.4,5.3,24.7,5,24,5c0,0,0,0,0,0c-0.7,0-1.4,0.3-1.9,0.8l-3.5,3.5l4.1,4.1c0.4-0.2,0.8-0.3,1.3-0.3c1.7,0,3,1.3,3,3c0,0.5-0.1,0.9-0.3,1.3l4,4c0.4-0.2,0.8-0.3,1.3-0.3c1.7,0,3,1.3,3,3s-1.3,3-3,3c-1.7,0-3-1.3-3-3c0-0.5,0.1-0.9,0.3-1.3l-4-4c-0.1,0-0.2,0.1-0.3,0.1v10.4c1.2,0.4,2,1.5,2,2.8c0,1.7-1.3,3-3,3s-3-1.3-3-3c0-1.3,0.8-2.4,2-2.8V18.8c-1.2-0.4-2-1.5-2-2.8c0-0.5,0.1-0.9,0.3-1.3l-4.1-4.1L5.8,22.1C5.3,22.6,5,23.3,5,24c0,0.7,0.3,1.4,0.8,1.9l16.3,16.3c0,0,0,0,0,0c0.5,0.5,1.2,0.8,1.9,0.8s1.4-0.3,1.9-0.8l16.3-16.3c0.5-0.5,0.8-1.2,0.8-1.9C43,23.3,42.7,22.6,42.2,22.1z"/></svg>
\ No newline at end of file