From 7241e9a8f2169c9b79ac9d524bf43fba1cc3fe19 Mon Sep 17 00:00:00 2001 From: Alexey Makhov Date: Sat, 14 Feb 2015 15:40:18 +0300 Subject: [PATCH] add commit comments to actions feed --- conf/locale/locale_de-DE.ini | 1 + conf/locale/locale_en-US.ini | 1 + conf/locale/locale_es-ES.ini | 1 + conf/locale/locale_fr-CA.ini | 1 + conf/locale/locale_ja-JP.ini | 1 + conf/locale/locale_lv-LV.ini | 1 + conf/locale/locale_nl-NL.ini | 1 + conf/locale/locale_ru-RU.ini | 1 + conf/locale/locale_zh-CN.ini | 1 + conf/locale/locale_zh-HK.ini | 1 + modules/base/template.go | 2 +- templates/repo/diff.tmpl | 8 ++++++-- templates/user/dashboard/feeds.tmpl | 5 ++++- 13 files changed, 21 insertions(+), 4 deletions(-) diff --git a/conf/locale/locale_de-DE.ini b/conf/locale/locale_de-DE.ini index 433f58c3b..f2029f755 100755 --- a/conf/locale/locale_de-DE.ini +++ b/conf/locale/locale_de-DE.ini @@ -699,6 +699,7 @@ create_repo=hat Repository %s erstellt commit_repo=hat nach %s in %s gepusht create_issue=`hat Issue %[1]s#%[2]s eröffnet` comment_issue=`hat Issue %[1]s#%[2]s kommentiert` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=hat Repository %s transferiert an %s push_tag=hat nach %s in %s gepusht compare_2_commits=Zeige Vergleich dieser 2 Commits diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index c36962192..4598f7515 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -700,6 +700,7 @@ create_repo = created repository %s commit_repo = pushed to %s at %s create_issue = `opened issue %[1]s#%[2]s` comment_issue = `commented on issue %[1]s#%[2]s` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo = transfered repository %s to %s push_tag = pushed tag %s to %s compare_2_commits = View comparison for these 2 commits diff --git a/conf/locale/locale_es-ES.ini b/conf/locale/locale_es-ES.ini index d7fab5f96..cdc315e45 100755 --- a/conf/locale/locale_es-ES.ini +++ b/conf/locale/locale_es-ES.ini @@ -696,6 +696,7 @@ create_repo=created repository %s commit_repo=pushed to %s at %s create_issue=`opened issue %[1]s#%[2]s` comment_issue=`commented on issue %[1]s#%[2]s` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=transfered repository %s to %s push_tag=pushed tag %s to %s compare_2_commits=View comparison for these 2 commits diff --git a/conf/locale/locale_fr-CA.ini b/conf/locale/locale_fr-CA.ini index 3937c3015..cd5392bb4 100755 --- a/conf/locale/locale_fr-CA.ini +++ b/conf/locale/locale_fr-CA.ini @@ -699,6 +699,7 @@ create_repo=a crée le Référentiel %s commit_repo=a soumis à %s chez %s create_issue=`a ouvert un problème %[1]s#%[2]s` comment_issue=`a commenté le problème %[1]s#%[2]s` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=a transféré le Référentiel %s à %s push_tag=a tagé %s à %s compare_2_commits=Comparer ces 2 commissions diff --git a/conf/locale/locale_ja-JP.ini b/conf/locale/locale_ja-JP.ini index 4ce4184f5..6a7e146bd 100755 --- a/conf/locale/locale_ja-JP.ini +++ b/conf/locale/locale_ja-JP.ini @@ -699,6 +699,7 @@ create_repo=リポジトリ %sを作成しました commit_repo=%s%sにプッシュしました create_issue=`問題 %[1]s#%[2]s を開きました` comment_issue=`問題 %[1]s#%[2]s のコメント` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=リポジトリ %s%s へ転送しました push_tag=%s に タグ %s をプッシュしました compare_2_commits=これら 2 のコミットの比較を閲覧する diff --git a/conf/locale/locale_lv-LV.ini b/conf/locale/locale_lv-LV.ini index 092f52dc2..a4e045231 100755 --- a/conf/locale/locale_lv-LV.ini +++ b/conf/locale/locale_lv-LV.ini @@ -699,6 +699,7 @@ create_repo=izveidoja repozitoriju %s commit_repo=veica izmaiņu nosūtīšanu atzaram %s repozitorijā %s create_issue=`reģistrēja problēmu %[1]s#%[2]s` comment_issue=`pievienoja komentāru problēmai %[1]s#%[2]s` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=mainīja repozitorija %s īpašnieku uz %s push_tag=pievienoja tagu %s repozitorijam %s compare_2_commits=Veikt salīdzināšanu starp šīm 2 revīzijām diff --git a/conf/locale/locale_nl-NL.ini b/conf/locale/locale_nl-NL.ini index c448acd38..176596122 100755 --- a/conf/locale/locale_nl-NL.ini +++ b/conf/locale/locale_nl-NL.ini @@ -699,6 +699,7 @@ create_repo=repositorie aangemaakt in %s commit_repo=push update naar %s in %s%[1]s#%[2]s` comment_issue=`reactie op issue %[1]s#%[2]s` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=repositorie verplaatst naar %s naar %s push_tag=geduwd label %s naar %s compare_2_commits=Weergave vergelijking voor deze 2 commits diff --git a/conf/locale/locale_ru-RU.ini b/conf/locale/locale_ru-RU.ini index 238f4b8d0..914940a01 100755 --- a/conf/locale/locale_ru-RU.ini +++ b/conf/locale/locale_ru-RU.ini @@ -699,6 +699,7 @@ create_repo=создан репозиторий %s commit_repo=pushed to %s at %s create_issue=`opened issue %[1]s#%[2]s` comment_issue=`commented on issue %[1]s#%[2]s` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=transfered repository %s to %s push_tag=pushed tag %s to %s compare_2_commits=View comparison for these 2 commits diff --git a/conf/locale/locale_zh-CN.ini b/conf/locale/locale_zh-CN.ini index 6cac79f54..2ae19bef3 100755 --- a/conf/locale/locale_zh-CN.ini +++ b/conf/locale/locale_zh-CN.ini @@ -699,6 +699,7 @@ create_repo=创建了仓库 %s commit_repo=推送了 %s 分支的代码到 %s create_issue=`创建了工单 %[1]s#%[2]s` comment_issue=`评论了工单 %[1]s#%[2]s` +comment_commit = `commented on commit %[1]s/%[2]s` transfer_repo=将仓库 %s 转移至 %s push_tag=推送了标签 %s%s compare_2_commits=查看 2 次提交的内容对比 diff --git a/conf/locale/locale_zh-HK.ini b/conf/locale/locale_zh-HK.ini index 0c9ba1909..60a755a84 100755 --- a/conf/locale/locale_zh-HK.ini +++ b/conf/locale/locale_zh-HK.ini @@ -696,6 +696,7 @@ create_repo=創建了倉庫 %s commit_repo=推送了 %s 分支的代碼到 %s create_issue=`創建了問題 %[1]s#%[2]s` comment_issue=`評論了問題 %[1]s#%[2]s` +comment_commit = `добавил комментарий к коммиту %[1]s/%[2]s` transfer_repo=將倉庫 %s 轉移至 %s push_tag=推送了標籤 %s%s compare_2_commits=查看 2 次提交的內容對比 diff --git a/modules/base/template.go b/modules/base/template.go index a08578528..5a87a0028 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -188,7 +188,7 @@ func ActionIcon(opType int) string { return "git-commit" case 6: // Create issue. return "issue-opened" - case 10: // Comment issue. + case 10, 11: // Comment issue. return "comment" default: return "invalid type" diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index ab4de6714..740c4f285 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -138,8 +138,12 @@ {{if eq $.Repository.Owner.Id .Poster.Id}} {{$.i18n.Tr "repo.owner"}} {{end}} - - + {{if $.SignedUser}} + {{if eq $.SignedUser.Id .Poster.Id}} + + + {{end}} + {{end}}

diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 8acf22896..d72d09c4a 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -20,6 +20,9 @@ {{else if eq .GetOpType 10}} {{ $index := index .GetIssueInfos 0}} {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index | Str2html}} + {{else if eq .GetOpType 11}} + {{ $index := index .GetIssueInfos 0}} + {{$.i18n.Tr "action.comment_commit" .GetRepoLink $index | Str2html}} {{end}}

{{if eq .GetOpType 5}} @@ -35,7 +38,7 @@ {{else if eq .GetOpType 6}}

{{index .GetIssueInfos 1}}

- {{else if eq .GetOpType 10}} + {{else if or (eq .GetOpType 10) (eq .GetOpType 11)}}

{{index .GetIssueInfos 1}}

{{end}}

{{TimeSince .GetCreate $.i18n.Lang}}