From 588a0db21869828c4ba1006855ed6454ca878068 Mon Sep 17 00:00:00 2001 From: Alexey Makhov Date: Thu, 12 Nov 2015 23:09:48 +0300 Subject: [PATCH] #1854 issue title at dashboard --- models/action.go | 7 +++++++ templates/user/dashboard/feeds.tmpl | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/models/action.go b/models/action.go index e94bb9441..11a2de033 100644 --- a/models/action.go +++ b/models/action.go @@ -10,6 +10,7 @@ import ( "fmt" "path" "regexp" + "strconv" "strings" "time" "unicode" @@ -136,6 +137,12 @@ func (a Action) GetIssueInfos() []string { return strings.SplitN(a.Content, "|", 2) } +func (a Action) GetIssueTitle() string { + issueID, _ := strconv.Atoi(strings.SplitN(a.Content, "|", 2)[0]) + issue, _ := GetIssueByID(int64(issueID)) + return issue.Name +} + func newRepoAction(e Engine, u *User, repo *Repository) (err error) { if err = notifyWatchers(e, &Action{ ActUserID: u.Id, diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index a79ff5531..dcd856f6d 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -24,7 +24,7 @@ {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} {{else if eq .GetOpType 10}} {{ $index := index .GetIssueInfos 0}} - {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}} + {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}} – {{.GetIssueTitle}} {{else if eq .GetOpType 11}} {{ $index := index .GetIssueInfos 0}} {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}} @@ -48,6 +48,7 @@ {{else if eq .GetOpType 7}}

{{index .GetIssueInfos 1}}

{{else if eq .GetOpType 10}} +

{{.GetIssueTitle}}

{{index .GetIssueInfos 1}}

{{else if eq .GetOpType 11}}

{{index .GetIssueInfos 1}}