-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Hide/disable unusable UI elements when a repository is archived #33459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,59 @@ | ||
<div id="review-box"> | ||
<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}}> | ||
<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 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"}} | ||
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span> | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</button> | ||
{{if $.IsShowingAllCommits}} | ||
<div class="review-box-panel tippy-target"> | ||
<div class="ui segment"> | ||
<form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> | ||
{{.CsrfTokenHtml}} | ||
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> | ||
<div class="field tw-flex tw-items-center"> | ||
<div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> | ||
<a class="muted close">{{svg "octicon-x" 16}}</a> | ||
</div> | ||
</div> | ||
{{if $.IsShowingAllCommits}} | ||
<div class="review-box-panel tippy-target"> | ||
<div class="ui segment"> | ||
<form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> | ||
{{.CsrfTokenHtml}} | ||
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> | ||
<div class="field tw-flex tw-items-center"> | ||
<div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</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"> | ||
{{template "shared/combomarkdowneditor" (dict | ||
"MarkdownPreviewInRepo" $.Repository | ||
"MarkdownPreviewMode" "comment" | ||
"TextareaName" "content" | ||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") | ||
"DropzoneParentContainer" "form" | ||
)}} | ||
{{template "repo/upload" .}} | ||
</div> | ||
{{if .IsAttachmentEnabled}} | ||
<div class="field"> | ||
{{template "repo/upload" .}} | ||
</div> | ||
{{end}} | ||
<div class="divider"></div> | ||
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} | ||
{{if not $.Issue.IsClosed}} | ||
{{if $showSelfTooltip}} | ||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> | ||
<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}} | ||
<div class="divider"></div> | ||
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} | ||
{{if not $.Issue.IsClosed}} | ||
{{if $showSelfTooltip}} | ||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> | ||
<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}} | ||
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> | ||
{{if not $.Issue.IsClosed}} | ||
{{if $showSelfTooltip}} | ||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> | ||
<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> | ||
{{else}} | ||
<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}} | ||
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> | ||
{{if not $.Issue.IsClosed}} | ||
{{if $showSelfTooltip}} | ||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> | ||
<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> | ||
{{else}} | ||
<button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> | ||
{{end}} | ||
</form> | ||
</div> | ||
{{end}} | ||
</form> | ||
</div> | ||
{{end}} | ||
</div> | ||
{{end}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.