diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/diff/box.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 23 |
2 files changed, 28 insertions, 1 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index d7abd96da1..8301dbb05d 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -68,6 +68,9 @@ </div> <span class="file">{{$file.Name}}</span> <div>{{$.i18n.Tr "repo.diff.file_suppressed"}}</div> + {{if $file.IsProtected}} + <span class="ui right basic label">{{$.i18n.Tr "repo.diff.protected"}}</span> + {{end}} {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} <a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a> @@ -104,6 +107,9 @@ {{end}} </div> <span class="file">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{end}}</span> + {{if $file.IsProtected}} + <span class="ui right basic label">{{$.i18n.Tr "repo.diff.protected"}}</span> + {{end}} {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} <a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a> diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index b21d53419f..d043c269ee 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -67,6 +67,7 @@ {{- else if .IsBlockedByApprovals}}red {{- else if .IsBlockedByRejection}}red {{- else if .IsBlockedByOutdatedBranch}}red + {{- else if .IsBlockedByChangedProtectedFiles}}red {{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red {{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow {{- else if and .AllowMerge .RequireSigned (not .WillSign)}}red @@ -145,6 +146,16 @@ <i class="icon icon-octicon">{{svg "octicon-x"}}</i> {{$.i18n.Tr "repo.pulls.blocked_by_outdated_branch"}} </div> + {{else if .IsBlockedByChangedProtectedFiles}} + <div class="item text red"> + <i class="icon icon-octicon">{{svg "octicon-x" 16}}</i> + {{$.i18n.Tr (TrN $.i18n.Lang $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n") | Safe }} + <div class="ui ordered list"> + {{range .ChangedProtectedFiles}} + <div data-value="-" class="item">{{.}}</div> + {{end}} + </div> + </div> {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}} <div class="item text red"> <i class="icon icon-octicon">{{svg "octicon-x"}}</i> @@ -165,7 +176,7 @@ {{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }} </div> {{end}} - {{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOutdatedBranch (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}} + {{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}} {{if and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}} {{if $notAllOverridableChecksOk}} <div class="item text yellow"> @@ -360,6 +371,16 @@ <i class="icon icon-octicon">{{svg "octicon-x"}}</i> {{$.i18n.Tr "repo.pulls.blocked_by_outdated_branch"}} </div> + {{else if .IsBlockedByChangedProtectedFiles}} + <div class="item text red"> + <i class="icon icon-octicon">{{svg "octicon-x" 16}}</i> + {{$.i18n.Tr (TrN $.i18n.Lang $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n") | Safe }} + <div class="ui ordered list"> + {{range .ChangedProtectedFiles}} + <div data-value="-" class="item">{{.}}</div> + {{end}} + </div> + </div> {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} <div class="item text red"> {{svg "octicon-x"}} |