summaryrefslogtreecommitdiffstats
path: root/templates/repo/diff
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/repo/diff
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/repo/diff')
-rw-r--r--templates/repo/diff/comments.tmpl18
1 files changed, 14 insertions, 4 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}}