add merger info and news feed

This commit is contained in:
Unknwon 2015-09-02 11:24:55 -04:00
parent 5da306c0e5
commit 842770d7fb
4 changed files with 10 additions and 2 deletions

View File

@ -921,6 +921,7 @@ create_repo = created repository <a href="%s">%s</a>
rename_repo = renamed repository from <code>%[1]s</code> to <a href="%[2]s">%[3]s</a>
commit_repo = pushed to <a href="%s/src/%s">%[2]s</a> at <a href="%[1]s">%[3]s</a>
create_issue = `opened issue <a href="%s/issues/%s">%s#%[2]s</a>`
create_pull_request = `created pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
comment_issue = `commented on issue <a href="%s/issues/%s">%s#%[2]s</a>`
transfer_repo = transfered repository <code>%s</code> to <a href="%s">%s</a>
push_tag = pushed tag <a href="%s/src/%s">%[2]s</a> to <a href="%[1]s">%[3]s</a>

View File

@ -925,6 +925,8 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
}
pr.HasMerged = true
pr.Merged = time.Now()
pr.MergerID = doer.Id
if _, err = sess.Id(pr.ID).AllCols().Update(pr); err != nil {
return fmt.Errorf("update pull request: %v", err)
}

File diff suppressed because one or more lines are too long

View File

@ -15,6 +15,9 @@
{{else if eq .GetOpType 6}}
{{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
{{else if eq .GetOpType 7}}
{{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}}
{{else if eq .GetOpType 8}}
{{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}}
{{else if eq .GetOpType 9}}
@ -39,6 +42,8 @@
</div>
{{else if eq .GetOpType 6}}
<p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
{{else if eq .GetOpType 7}}
<p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
{{else if eq .GetOpType 10}}
<p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
{{end}}