mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-24 04:23:47 +08:00
refactor: extract to subtemplate
This commit is contained in:
parent
aa061b409f
commit
925ac870dc
|
@ -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.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.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_short = Blocks
|
||||||
|
issues.dependency.blocks_following = Blocks:
|
||||||
issues.dependency.blocked_by_short = Depends on
|
issues.dependency.blocked_by_short = Depends on
|
||||||
|
issues.dependency.blocked_by_following = Depends on:
|
||||||
issues.dependency.remove_header = Remove Dependency
|
issues.dependency.remove_header = Remove Dependency
|
||||||
issues.dependency.issue_remove_text = This will remove the dependency from this issue. Continue?
|
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?
|
issues.dependency.pr_remove_text = This will remove the dependency from this pull request. Continue?
|
||||||
|
|
13
templates/shared/issue_dependency.tmpl
Normal file
13
templates/shared/issue_dependency.tmpl
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{{if and .DependenciesMap (index .DependenciesMap .ID)}}
|
||||||
|
<div class="flex-text-inline gt-gap-0">
|
||||||
|
<strong class="gt-mr-2">{{.Title}}</strong>
|
||||||
|
{{$first := true}}
|
||||||
|
{{range (index .DependenciesMap .ID)}}
|
||||||
|
{{if not $first}}<span class="gt-mr-2">,</span>{{end}}
|
||||||
|
{{$first = false}}
|
||||||
|
<a href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||||
|
#{{.Issue.Index}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -118,32 +118,14 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if and $.BlockingDependenciesMap (index $.BlockingDependenciesMap .ID)}}
|
{{template "shared/issue_dependency" (dict
|
||||||
<div class="flex-text-inline gt-gap-0">
|
"ID" .ID
|
||||||
<strong class="gt-mr-2">{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}:</strong>
|
"DependenciesMap" $.BlockingDependenciesMap
|
||||||
{{ $first := true }}
|
"Title" (ctx.Locale.Tr "repo.issues.dependency.blocks_following"))}}
|
||||||
{{range (index $.BlockingDependenciesMap .ID)}}
|
{{template "shared/issue_dependency" (dict
|
||||||
{{if not $first}}<span class="gt-mr-2">, </span>{{end}}
|
"ID" .ID
|
||||||
{{ $first = false }}
|
"DependenciesMap" $.BlockedByDependenciesMap
|
||||||
<a href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
"Title" (ctx.Locale.Tr "repo.issues.dependency.blocked_by_following"))}}
|
||||||
#{{.Issue.Index}}
|
|
||||||
</a>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
{{if and $.BlockedByDependenciesMap (index $.BlockedByDependenciesMap .ID)}}
|
|
||||||
<div class="flex-text-inline gt-gap-0">
|
|
||||||
<strong class="gt-mr-2">{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}:</strong>
|
|
||||||
{{ $first := true }}
|
|
||||||
{{range (index $.BlockedByDependenciesMap .ID)}}
|
|
||||||
{{if not $first}}<span class="gt-mr-2">, </span>{{end}}
|
|
||||||
{{ $first = false }}
|
|
||||||
<a href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
|
||||||
#{{.Issue.Index}}
|
|
||||||
</a>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
{{if .IsPull}}
|
{{if .IsPull}}
|
||||||
{{$approveOfficial := call $approvalCounts .ID "approve"}}
|
{{$approveOfficial := call $approvalCounts .ID "approve"}}
|
||||||
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
|
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user