Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance closed PR and Issue status in the list #6000

Merged
merged 6 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ issues.action_milestone_no_select = No milestone
issues.action_assignee = Assignee
issues.action_assignee_no_select = No assignee
issues.opened_by = opened %[1]s by <a href="%[2]s">%[3]s</a>
pulls.merged_by = merged %[1]s by <a href="%[2]s">%[3]s</a>
issues.closed_by = closed %[1]s by <a href="%[2]s">%[3]s</a>
issues.opened_by_fake = opened %[1]s by %[2]s
issues.previous = Previous
issues.next = Next
Expand Down
18 changes: 17 additions & 1 deletion templates/repo/issue/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,23 @@
{{end}}

<p class="desc">
{{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
{{ $textToTranslate := "repo.issues.opened_by" }}
{{ if not .IsClosed }}
{{ $timeStr = TimeSinceUnix .CreatedUnix $.Lang }}
adelowo marked this conversation as resolved.
Show resolved Hide resolved
{{ else if and .IsClosed .IsPull }}
{{ $timeStr = TimeSinceUnix .ClosedUnix $.Lang }}
{{ if .PullRequest.HasMerged }}
{{ $textToTranslate = "repo.pulls.merged_by"}}
{{ else }}
{{ $textToTranslate = "repo.issues.closed_by"}}
{{ end }}
{{ else }}
{{ $timeStr = TimeSinceUnix .ClosedUnix $.Lang }}
{{ $textToTranslate = "repo.issues.closed_by"}}
{{ end }}

{{$.i18n.Tr $textToTranslate $timeStr .Poster.HomeLink .Poster.Name | Safe}}

{{$tasks := .GetTasks}}
{{if gt $tasks 0}}
{{$tasksDone := .GetTasksDone}}
Expand Down