diff options
author | Unknwon <u@gogs.io> | 2015-11-13 12:11:45 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-13 12:11:45 -0500 |
commit | 6a664e88c77f1ddd9c5bff4898e21a8271a5da9a (patch) | |
tree | fbdb9e24ea39be10fe59ec6bfeddda90be45b1b1 /models/action.go | |
parent | 0f438ef0b3fe641df102212becb32cdfb4dd3305 (diff) | |
download | gitea-6a664e88c77f1ddd9c5bff4898e21a8271a5da9a.tar.gz gitea-6a664e88c77f1ddd9c5bff4898e21a8271a5da9a.zip |
#1854 show issue content
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go index c514a4c47d..536476d7e1 100644 --- a/models/action.go +++ b/models/action.go @@ -142,11 +142,21 @@ func (a Action) GetIssueTitle() string { issue, err := GetIssueByIndex(a.RepoID, index) if err != nil { log.Error(4, "GetIssueByIndex: %v", err) - return "500 when get title" + return "500 when get issue" } return issue.Name } +func (a Action) GetIssueContent() string { + index := com.StrTo(a.GetIssueInfos()[0]).MustInt64() + issue, err := GetIssueByIndex(a.RepoID, index) + if err != nil { + log.Error(4, "GetIssueByIndex: %v", err) + return "500 when get issue" + } + return issue.Content +} + func newRepoAction(e Engine, u *User, repo *Repository) (err error) { if err = notifyWatchers(e, &Action{ ActUserID: u.Id, |