diff options
author | Zsombor <gzsombor@users.noreply.github.com> | 2019-02-13 09:14:17 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-02-13 10:14:17 +0200 |
commit | 23414ac2a1d83f91ff47c5d8bbedebe709b1f408 (patch) | |
tree | 984c4aaad92281ae0b938f4149feb4cdaaea2f9c /models | |
parent | 7f38e2d0dedfc3e04994272196cda53e4ad20354 (diff) | |
download | gitea-23414ac2a1d83f91ff47c5d8bbedebe709b1f408.tar.gz gitea-23414ac2a1d83f91ff47c5d8bbedebe709b1f408.zip |
Fix panic: template: repo/issue/list:210: unexpected "=" in operand (#6041)
Diffstat (limited to 'models')
-rw-r--r-- | models/issue.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go index 850346674b..1421b28da2 100644 --- a/models/issue.go +++ b/models/issue.go @@ -953,6 +953,25 @@ func (issue *Issue) GetTasksDone() int { return len(issueTasksDonePat.FindAllStringIndex(issue.Content, -1)) } +// GetLastEventTimestamp returns the last user visible event timestamp, either the creation of this issue or the close. +func (issue *Issue) GetLastEventTimestamp() util.TimeStamp { + if issue.IsClosed { + return issue.ClosedUnix + } + return issue.CreatedUnix +} + +// GetLastEventLabel returns the localization label for the current issue. +func (issue *Issue) GetLastEventLabel() string { + if issue.IsClosed { + if issue.IsPull && issue.PullRequest.HasMerged { + return "repo.pulls.merged_by" + } + return "repo.issues.closed_by" + } + return "repo.issues.opened_by" +} + // NewIssueOptions represents the options of a new issue. type NewIssueOptions struct { Repo *Repository |