Skip to content

Commit 2e85e70

Browse files
adelowozeripath
authored andcommitted
Enhance closed PR and Issue status in the list (#6000)
* working version * Update options/locale/locale_en-US.ini Co-Authored-By: adelowo <adelowomailbox@gmail.com> * update templates
1 parent f60b1d8 commit 2e85e70

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

options/locale/locale_en-US.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,8 @@ issues.action_milestone_no_select = No milestone
733733
issues.action_assignee = Assignee
734734
issues.action_assignee_no_select = No assignee
735735
issues.opened_by = opened %[1]s by <a href="%[2]s">%[3]s</a>
736+
pulls.merged_by = merged %[1]s by <a href="%[2]s">%[3]s</a>
737+
issues.closed_by = closed %[1]s by <a href="%[2]s">%[3]s</a>
736738
issues.opened_by_fake = opened %[1]s by %[2]s
737739
issues.previous = Previous
738740
issues.next = Next

templates/repo/issue/list.tmpl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,23 @@
205205
{{end}}
206206

207207
<p class="desc">
208-
{{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
208+
{{ $textToTranslate := "repo.issues.opened_by" }}
209+
{{ if not .IsClosed }}
210+
{{ $timeStr = TimeSinceUnix .CreatedUnix $.Lang }}
211+
{{ else if and .IsClosed .IsPull }}
212+
{{ $timeStr = TimeSinceUnix .ClosedUnix $.Lang }}
213+
{{ if .PullRequest.HasMerged }}
214+
{{ $textToTranslate = "repo.pulls.merged_by"}}
215+
{{ else }}
216+
{{ $textToTranslate = "repo.issues.closed_by"}}
217+
{{ end }}
218+
{{ else }}
219+
{{ $timeStr = TimeSinceUnix .ClosedUnix $.Lang }}
220+
{{ $textToTranslate = "repo.issues.closed_by"}}
221+
{{ end }}
222+
223+
{{$.i18n.Tr $textToTranslate $timeStr .Poster.HomeLink .Poster.Name | Safe}}
224+
209225
{{$tasks := .GetTasks}}
210226
{{if gt $tasks 0}}
211227
{{$tasksDone := .GetTasksDone}}

0 commit comments

Comments
 (0)