summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-24 01:28:15 +0800
committerLauris BH <lauris@nix.lv>2020-01-23 19:28:15 +0200
commitf6067a8465e7762aea1561106cfee291409a0fd6 (patch)
tree35c97d4117acfe52dce32c9242e4c9a656c4bc6c /templates
parentbfdfa9a8b32ae331f98137169693ba1d71c25b09 (diff)
downloadgitea-f6067a8465e7762aea1561106cfee291409a0fd6.tar.gz
gitea-f6067a8465e7762aea1561106cfee291409a0fd6.zip
Migrate reviews when migrating repository from github (#9463)
* fix typo * Migrate reviews when migrating repository from github * fix lint * Added test and migration when external user login * fix test * fix commented state * Some improvements * fix bug when get pull request and ref original author on code comments * Fix migrated line; Added comment for review * Don't load all pull requests attributes * Fix typo * wrong change copy head * fix tests * fix reactions * Fix test * fix fmt * fix review comment reactions
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/diff/comments.tmpl18
-rw-r--r--templates/repo/issue/view_content/comments.tmpl17
2 files changed, 27 insertions, 8 deletions
diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl
index 64080f990f..f5b8d8042d 100644
--- a/templates/repo/diff/comments.tmpl
+++ b/templates/repo/diff/comments.tmpl
@@ -2,12 +2,22 @@
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.root.Lang }}
<div class="comment" id="{{.HashTag}}">
- <a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
- <img src="{{.Poster.RelAvatarLink}}">
- </a>
+ {{if .OriginalAuthor }}
+ <span class="avatar"><img src="/img/avatar_default.png"></span>
+ {{else}}
+ <a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ {{end}}
<div class="content">
<div class="ui top attached header">
- <span class="text grey"><a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{$.root.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
+ <span class="text grey">
+ {{if .OriginalAuthor }}
+ <span class="text black"><i class="fa {{MigrationIcon $.root.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{$.root.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span> <span class="text migrate">{{if $.root.Repository.OriginalURL}} ({{$.root.i18n.Tr "repo.migrated_from" $.root.Repository.OriginalURL $.root.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
+ {{else}}
+ <a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{$.root.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}
+ {{end}}
+ </span>
<div class="ui right actions">
{{if and .Review}}
{{if eq .Review.Type 0}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 40db434dec..be423e9d4c 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -319,10 +319,19 @@
{{else if eq .Type 22}}
<div class="event" id="{{.HashTag}}">
<span class="octicon octicon-{{.Review.Type.Icon}} issue-symbol"></span>
- <a class="ui avatar image" href="{{.Poster.HomeLink}}">
- <img src="{{.Poster.RelAvatarLink}}">
- </a>
- <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
+ {{if .OriginalAuthor }}
+ {{else}}
+ <a class="avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ {{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>
+ {{else}}
+ <a{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
+ {{end}}
+
{{if eq .Review.Type 1}}
{{$.i18n.Tr "repo.issues.review.approve" $createdStr | Safe}}
{{else if eq .Review.Type 2}}