From 8db0372a45082c8827bdee1b449f618b393c026d Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Mon, 4 Jan 2021 17:51:00 +0100 Subject: [PATCH] Handle NotifyCreateRef as create branch in feeds (#14245) Co-authored-by: Lauris BH --- options/locale/locale_en-US.ini | 1 + templates/user/dashboard/feeds.tmpl | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index ae72dff3ad..06471fd6c4 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2495,6 +2495,7 @@ mirror_sync_delete = synced and deleted reference %[2]s at %s#%[2]s` reject_pull_request = `suggested changes for %s#%[2]s` publish_release = `released "%[4]s" at %[3]s` +create_branch = created branch %[3]s in %[4]s [tool] ago = %s ago diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index ead8e76f31..744e028bc2 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -18,7 +18,11 @@ {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}} {{else if eq .GetOpType 5}} {{ $branchLink := .GetBranch | EscapePound | Escape}} - {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink (Escape .GetBranch) .ShortRepoPath | Str2html}} + {{if .Content}} + {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink (Escape .GetBranch) .ShortRepoPath | Str2html}} + {{else}} + {{$.i18n.Tr "action.create_branch" .GetRepoLink $branchLink (Escape .GetBranch) .ShortRepoPath | Str2html}} + {{end}} {{else if eq .GetOpType 6}} {{ $index := index .GetIssueInfos 0}} {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}