diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/list.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/issue/view_title.tmpl | 22 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 22 | ||||
-rw-r--r-- | templates/user/dashboard/issues.tmpl | 4 |
6 files changed, 61 insertions, 8 deletions
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 3007c99106..45b2cc67e3 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -234,8 +234,9 @@ <p class="desc"> {{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }} - - {{if gt .Poster.ID 0}} + {{if .OriginalAuthor }} + {{$.i18n.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor | Safe}} + {{else if gt .Poster.ID 0}} {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName | Escape) | Safe}} {{else}} {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 16700a8dc1..b3f88c662d 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -12,12 +12,20 @@ <div class="twelve wide column comment-list prevent-before-timeline"> <ui class="ui comments timeline-line"> <div class="comment"> + {{if .Issue.OriginalAuthor }} + <span class="avatar"><img src="/img/avatar_default.png"></span> + {{else}} <a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> <img src="{{.Issue.Poster.RelAvatarLink}}"> </a> + {{end}} <div class="content"> <div class="ui top attached header"> + {{if .Issue.OriginalAuthor }} + <span class="text black"><i class="fa {{MigrationIcon .Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .Issue.OriginalAuthor }}</span><span class="text grey"> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}<span> <span class="text migrate">{{if .Repository.OriginalURL}} ({{$.i18n.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname | Safe }}){{end}}</span> + {{else}} <span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span> + {{end}} {{if not $.Repository.IsArchived}} <div class="ui right actions"> {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 20474f6302..68303cf1ca 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -9,12 +9,20 @@ 22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED --> {{if eq .Type 0}} <div class="comment" id="{{.HashTag}}"> + {{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"> + {{if .OriginalAuthor }} + <span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{$.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span> + {{else}} <span class="text grey"><a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span> + {{end}} {{if not $.Repository.IsArchived}} <div class="ui right actions"> {{if gt .ShowTag 0}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 78c892fa4d..4b254d2c4b 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -27,16 +27,28 @@ {{if .Issue.IsPull}} {{if .Issue.PullRequest.HasMerged}} {{ $mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.Lang }} - <a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.GetDisplayName}}</a> - <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span> + {{if .Issue.OriginalAuthor }} + {{.Issue.OriginalAuthor}} + <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span> + {{else}} + <a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.GetDisplayName}}</a> + <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span> + {{end}} {{else}} - <a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> - <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span> + {{if .Issue.OriginalAuthor }} + {{.Issue.OriginalAuthor}} + <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span> + {{else}} + <a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> + <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span> + {{end}} {{end}} {{else}} {{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }} <span class="time-desc"> - {{if gt .Issue.Poster.ID 0}} + {{if .Issue.OriginalAuthor }} + {{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr .Issue.OriginalAuthor | Safe}} + {{else if gt .Issue.Poster.ID 0}} {{$.i18n.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink (.Issue.Poster.GetDisplayName|Escape) | Safe}} {{else}} {{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}} diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index d6d501ed22..11f4161172 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -6971,6 +6971,15 @@ "type": "string", "x-go-name": "IssueURL" }, + "original_author": { + "type": "string", + "x-go-name": "OriginalAuthor" + }, + "original_author_id": { + "type": "integer", + "format": "int64", + "x-go-name": "OriginalAuthorID" + }, "pull_request_url": { "type": "string", "x-go-name": "PRURL" @@ -8669,6 +8678,15 @@ "format": "int64", "x-go-name": "Index" }, + "original_author": { + "type": "string", + "x-go-name": "OriginalAuthor" + }, + "original_author_id": { + "type": "integer", + "format": "int64", + "x-go-name": "OriginalAuthorID" + }, "pull_request": { "$ref": "#/definitions/PullRequestMeta" }, @@ -9489,6 +9507,10 @@ "format": "int64", "x-go-name": "OpenIssues" }, + "original_url": { + "type": "string", + "x-go-name": "OriginalURL" + }, "owner": { "$ref": "#/definitions/User" }, diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index b69509d799..7083569164 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -93,7 +93,9 @@ {{end}} <p class="desc"> - {{if gt .Poster.ID 0}} + {{if .OriginalAuthor}} + {{$.i18n.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor | Safe}} + {{else if gt .Poster.ID 0}} {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}} {{else}} {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}} |