mirror of https://github.com/go-gitea/gitea
Hide/disable unusable UI elements when a repository is archived (#33459)
And by the way, remove some jQuery codepull/33303/head
parent
0e8738b4b6
commit
1ab5938e82
@ -1,56 +1,59 @@ |
|||||||
<div id="review-box"> |
<div id="review-box" {{if $.Repository.IsArchived}}data-tooltip-content="{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}"{{end}}> |
||||||
<button class="ui tiny primary button tw-pr-1 tw-flex js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}> |
<button class="ui tiny primary button tw-pr-1 js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" |
||||||
|
{{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}} |
||||||
|
{{if $.Repository.IsArchived}}disabled{{end}} |
||||||
|
> |
||||||
{{ctx.Locale.Tr "repo.diff.review"}} |
{{ctx.Locale.Tr "repo.diff.review"}} |
||||||
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span> |
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span> |
||||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} |
{{svg "octicon-triangle-down" 14 "dropdown icon"}} |
||||||
</button> |
</button> |
||||||
{{if $.IsShowingAllCommits}} |
</div> |
||||||
<div class="review-box-panel tippy-target"> |
{{if $.IsShowingAllCommits}} |
||||||
<div class="ui segment"> |
<div class="review-box-panel tippy-target"> |
||||||
<form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> |
<div class="ui segment"> |
||||||
{{.CsrfTokenHtml}} |
<form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> |
||||||
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> |
{{.CsrfTokenHtml}} |
||||||
<div class="field tw-flex tw-items-center"> |
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> |
||||||
<div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> |
<div class="field tw-flex tw-items-center"> |
||||||
<a class="muted close">{{svg "octicon-x" 16}}</a> |
<div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> |
||||||
</div> |
<a class="muted close">{{svg "octicon-x" 16}}</a> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
{{template "shared/combomarkdowneditor" (dict |
||||||
|
"MarkdownPreviewInRepo" $.Repository |
||||||
|
"MarkdownPreviewMode" "comment" |
||||||
|
"TextareaName" "content" |
||||||
|
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") |
||||||
|
"DropzoneParentContainer" "form" |
||||||
|
)}} |
||||||
|
</div> |
||||||
|
{{if .IsAttachmentEnabled}} |
||||||
<div class="field"> |
<div class="field"> |
||||||
{{template "shared/combomarkdowneditor" (dict |
{{template "repo/upload" .}} |
||||||
"MarkdownPreviewInRepo" $.Repository |
|
||||||
"MarkdownPreviewMode" "comment" |
|
||||||
"TextareaName" "content" |
|
||||||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") |
|
||||||
"DropzoneParentContainer" "form" |
|
||||||
)}} |
|
||||||
</div> |
</div> |
||||||
{{if .IsAttachmentEnabled}} |
{{end}} |
||||||
<div class="field"> |
<div class="divider"></div> |
||||||
{{template "repo/upload" .}} |
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} |
||||||
</div> |
{{if not $.Issue.IsClosed}} |
||||||
{{end}} |
{{if $showSelfTooltip}} |
||||||
<div class="divider"></div> |
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> |
||||||
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} |
<button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
||||||
{{if not $.Issue.IsClosed}} |
</span> |
||||||
{{if $showSelfTooltip}} |
{{else}} |
||||||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> |
<button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
||||||
<button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
|
||||||
</span> |
|
||||||
{{else}} |
|
||||||
<button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
|
||||||
{{end}} |
|
||||||
{{end}} |
{{end}} |
||||||
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> |
{{end}} |
||||||
{{if not $.Issue.IsClosed}} |
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> |
||||||
{{if $showSelfTooltip}} |
{{if not $.Issue.IsClosed}} |
||||||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> |
{{if $showSelfTooltip}} |
||||||
<button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> |
||||||
</span> |
<button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
||||||
{{else}} |
</span> |
||||||
<button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
{{else}} |
||||||
{{end}} |
<button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
||||||
{{end}} |
{{end}} |
||||||
</form> |
{{end}} |
||||||
</div> |
</form> |
||||||
</div> |
</div> |
||||||
{{end}} |
|
||||||
</div> |
</div> |
||||||
|
{{end}} |
||||||
|
Loading…
Reference in new issue