summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-13 10:00:38 -0500
committerUnknwon <u@gogs.io>2015-11-13 10:00:38 -0500
commit1c3754bcec37fe448bc46dfd5abd944e86f951b7 (patch)
treeb836e24274b401ebb5cc665492302b5f1f2fa3f8
parent2268d28189aa04deb1625205477bc4a404ca85b6 (diff)
parentee645af10766496b164bd87d1bd748e340ff100b (diff)
downloadgitea-1c3754bcec37fe448bc46dfd5abd944e86f951b7.tar.gz
gitea-1c3754bcec37fe448bc46dfd5abd944e86f951b7.zip
Merge pull request #1935 from makhov/issue-title-at-dashboard
Show issue title at dashboard
-rw-r--r--models/action.go11
-rw-r--r--templates/user/dashboard/feeds.tmpl2
2 files changed, 12 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go
index e94bb9441b..19fd9102fb 100644
--- a/models/action.go
+++ b/models/action.go
@@ -15,6 +15,7 @@ import (
"unicode"
"github.com/go-xorm/xorm"
+ "github.com/Unknwon/com"
api "github.com/gogits/go-gogs-client"
@@ -136,6 +137,16 @@ func (a Action) GetIssueInfos() []string {
return strings.SplitN(a.Content, "|", 2)
}
+func (a Action) GetIssueTitle() string {
+ issueIndex := com.StrTo(a.GetIssueInfos()[0]).MustInt64()
+ issue, err := GetIssueByIndex(a.RepoID, issueIndex)
+ if err != nil {
+ log.Error(4, "GetIssueByID: %v", err)
+ return "500 when get title"
+ }
+ 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 a79ff5531b..bff44f06bb 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}}