first-commit
This commit is contained in:
18
templates/repo/code/recently_pushed_new_branches.tmpl
Normal file
18
templates/repo/code/recently_pushed_new_branches.tmpl
Normal file
@@ -0,0 +1,18 @@
|
||||
{{/* Template Attributes:
|
||||
* RecentBranchesPromptData
|
||||
*/}}
|
||||
{{$data := .RecentBranchesPromptData}}
|
||||
{{if $data}}
|
||||
{{range $recentBranch := $data.RecentlyPushedNewBranches}}
|
||||
<div class="ui positive message flex-text-block">
|
||||
<div class="tw-flex-1">
|
||||
{{$timeSince := DateUtils.TimeSince $recentBranch.CommitTime}}
|
||||
{{$branchLink := HTMLFormat `<a href="%s">%s</a>` $recentBranch.BranchLink .BranchDisplayName}}
|
||||
{{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" $branchLink $timeSince}}
|
||||
</div>
|
||||
<a role="button" class="ui compact green button" href="{{QueryBuild $recentBranch.BranchCompareURL "expand" 1}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
23
templates/repo/code/upstream_diverging_info.tmpl
Normal file
23
templates/repo/code/upstream_diverging_info.tmpl
Normal file
@@ -0,0 +1,23 @@
|
||||
{{if and .UpstreamDivergingInfo .UpstreamDivergingInfo.BaseBranchHasNewCommits}}
|
||||
<div class="ui message flex-text-block">
|
||||
<div class="tw-flex-1">
|
||||
{{$upstreamLink := printf "%s/src/branch/%s" .Repository.BaseRepo.Link (.UpstreamDivergingInfo.BaseBranchName|PathEscapeSegments)}}
|
||||
{{$upstreamRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.BaseRepo.FullName .UpstreamDivergingInfo.BaseBranchName}}
|
||||
{{$thisRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.FullName .BranchName}}
|
||||
{{$upstreamHtml := HTMLFormat `<a href="%s">%s</a>` $upstreamLink $upstreamRepoBranchDisplay}}
|
||||
{{if .UpstreamDivergingInfo.HeadBranchCommitsBehind}}
|
||||
{{ctx.Locale.TrN .UpstreamDivergingInfo.HeadBranchCommitsBehind "repo.pulls.upstream_diverging_prompt_behind_1" "repo.pulls.upstream_diverging_prompt_behind_n" .UpstreamDivergingInfo.HeadBranchCommitsBehind $upstreamHtml}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.pulls.upstream_diverging_prompt_base_newer" $upstreamHtml}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .CanWriteCode}}
|
||||
<button class="ui compact primary button tw-m-0 link-action"
|
||||
data-modal-confirm-header="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}"
|
||||
data-modal-confirm-content="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge_confirm" $upstreamRepoBranchDisplay $thisRepoBranchDisplay}}"
|
||||
data-url="{{.Repository.Link}}/branches/merge-upstream?branch={{.BranchName}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
Reference in New Issue
Block a user