diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index e7ba7dd8c9..9df6bf658e 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1685,7 +1685,9 @@ issues.dependency.issue_close_blocked = You need to close all issues blocking th
issues.dependency.issue_batch_close_blocked = "Cannot batch close issues that you choose, because issue #%d still has open dependencies"
issues.dependency.pr_close_blocked = You need to close all issues blocking this pull request before you can merge it.
issues.dependency.blocks_short = Blocks
+issues.dependency.blocks_following = Blocks:
issues.dependency.blocked_by_short = Depends on
+issues.dependency.blocked_by_following = Depends on:
issues.dependency.remove_header = Remove Dependency
issues.dependency.issue_remove_text = This will remove the dependency from this issue. Continue?
issues.dependency.pr_remove_text = This will remove the dependency from this pull request. Continue?
diff --git a/templates/shared/issue_dependency.tmpl b/templates/shared/issue_dependency.tmpl
new file mode 100644
index 0000000000..2c301d67b9
--- /dev/null
+++ b/templates/shared/issue_dependency.tmpl
@@ -0,0 +1,13 @@
+{{if and .DependenciesMap (index .DependenciesMap .ID)}}
+
+
{{.Title}}
+ {{$first := true}}
+ {{range (index .DependenciesMap .ID)}}
+ {{if not $first}}
,{{end}}
+ {{$first = false}}
+
+ #{{.Issue.Index}}
+
+ {{end}}
+
+{{end}}
\ No newline at end of file
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index 332f7cbe0b..2a9418dfa3 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -118,32 +118,14 @@
{{end}}
- {{if and $.BlockingDependenciesMap (index $.BlockingDependenciesMap .ID)}}
-
-
{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}:
- {{ $first := true }}
- {{range (index $.BlockingDependenciesMap .ID)}}
- {{if not $first}}
, {{end}}
- {{ $first = false }}
-
- #{{.Issue.Index}}
-
- {{end}}
-
- {{end}}
- {{if and $.BlockedByDependenciesMap (index $.BlockedByDependenciesMap .ID)}}
-
-
{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}:
- {{ $first := true }}
- {{range (index $.BlockedByDependenciesMap .ID)}}
- {{if not $first}}
, {{end}}
- {{ $first = false }}
-
- #{{.Issue.Index}}
-
- {{end}}
-
- {{end}}
+ {{template "shared/issue_dependency" (dict
+ "ID" .ID
+ "DependenciesMap" $.BlockingDependenciesMap
+ "Title" (ctx.Locale.Tr "repo.issues.dependency.blocks_following"))}}
+ {{template "shared/issue_dependency" (dict
+ "ID" .ID
+ "DependenciesMap" $.BlockedByDependenciesMap
+ "Title" (ctx.Locale.Tr "repo.issues.dependency.blocked_by_following"))}}
{{if .IsPull}}
{{$approveOfficial := call $approvalCounts .ID "approve"}}
{{$rejectOfficial := call $approvalCounts .ID "reject"}}