mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
* Remove unused `"root"` data attributes from templates * Use our "confirmModal" as much as possible (partially for #39643) * Use "data-global-init" to refactor a lot of legacy code * Refactor and clearify initRepoIssueCommentDelete's behavior to help #36862 * Remove dead code `common-organization.ts`
48 lines
3.2 KiB
Handlebars
48 lines
3.2 KiB
Handlebars
{{$type := $.ConvContentType -}}
|
|
{{$item := $.ConvContentItem -}}
|
|
{{$page := $.ConvContentPage -}}
|
|
|
|
{{$supportDelete := eq $type "issue_comment" -}}
|
|
{{$isPagePrFiles := eq $page "pr-files" -}}
|
|
{{$issueHTMLURL := ctx.RootData.Issue.HTMLURL ctx -}}
|
|
{{$referenceHTMLURL := printf "%s%s#%s" $issueHTMLURL (Iif $isPagePrFiles "/files" "") $item.HashTag -}}
|
|
|
|
{{$isCommentPoster := and ctx.RootData.IsSigned (eq ctx.RootData.SignedUserID $item.PosterID) -}}
|
|
{{$canEditContent := or ctx.RootData.Permission.IsAdmin ctx.RootData.HasIssuesOrPullsWritePermission $isCommentPoster -}}
|
|
|
|
<div class="item action ui dropdown jump pointing top right">
|
|
{{svg "octicon-kebab-horizontal"}}
|
|
<div class="menu">
|
|
<div class="item js-aria-clickable" data-clipboard-text="{{$referenceHTMLURL}}">{{ctx.Locale.Tr "copy_link"}}</div>
|
|
<div class="item js-aria-clickable" data-clipboard-target="#{{$item.HashTag}}-raw">{{ctx.Locale.Tr "repo.issues.context.copy_source"}}</div>
|
|
|
|
{{if ctx.RootData.IsSigned}}
|
|
{{if not ctx.RootData.Repository.IsArchived}}
|
|
<div class="item js-aria-clickable" data-global-click="onConvContentQuoteReply" data-shortcut-keys="r" data-shortcut-handler="quoteSelectedReply" data-target="{{$item.HashTag}}-raw">{{ctx.Locale.Tr "repo.issues.context.quote_reply"}}</div>
|
|
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
|
|
<div class="item js-aria-clickable reference-issue" data-target="{{$item.HashTag}}-raw" data-modal="#reference-issue-modal" data-poster="{{$item.Poster.GetDisplayName}}" data-poster-username="{{$item.Poster.Name}}" data-reference="{{$referenceHTMLURL}}">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</div>
|
|
{{end}}
|
|
{{if $canEditContent}}
|
|
<div class="divider"></div>
|
|
<div class="item js-aria-clickable" data-global-click="onConvContentEdit">{{ctx.Locale.Tr "repo.issues.context.edit"}}</div>
|
|
{{if $supportDelete}}
|
|
<div class="item js-aria-clickable" data-global-click="onConvContentDelete" data-comment-hash-tag={{$item.HashTag}} data-url="{{ctx.RootData.RepoLink}}/comments/{{$item.ID}}/delete" data-locale="{{ctx.Locale.Tr "repo.issues.delete_comment_confirm"}}">{{ctx.Locale.Tr "repo.issues.context.delete"}}</div>
|
|
{{end}}
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{$canUserBlock := call ctx.RootData.CanBlockUser ctx.RootData.SignedUser $item.Poster -}}
|
|
{{$canOrgBlock := and ctx.RootData.Repository.Owner.IsOrganization (call ctx.RootData.CanBlockUser ctx.RootData.Repository.Owner $item.Poster) -}}
|
|
{{if or $canOrgBlock $canUserBlock}}
|
|
<div class="divider"></div>
|
|
{{if $canUserBlock}}
|
|
<div class="item js-aria-clickable show-modal" data-modal="#block-user-modal" data-modal-modal-blockee="{{$item.Poster.Name}}" data-modal-modal-blockee-name="{{$item.Poster.GetDisplayName}}" data-modal-modal-form.url="{{AppSubUrl}}/user/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.user"}}</div>
|
|
{{end}}
|
|
{{if $canOrgBlock}}
|
|
<div class="item js-aria-clickable show-modal" data-modal="#block-user-modal" data-modal-modal-blockee="{{$item.Poster.Name}}" data-modal-modal-blockee-name="{{$item.Poster.GetDisplayName}}" data-modal-modal-form.url="{{ctx.RootData.Repository.Owner.OrganisationLink}}/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.org"}}</div>
|
|
{{end}}
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|