1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor repo-issue.ts (#33784)

And remove jQuery
This commit is contained in:
wxiaoguang
2025-03-05 01:58:17 +08:00
committed by GitHub
parent ca0ce003ab
commit 75e85c25c1
10 changed files with 194 additions and 236 deletions

View File

@@ -31,7 +31,9 @@
</div>
<div class="item-right tw-flex tw-items-center tw-m-1">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
{{end}}
@@ -63,7 +65,9 @@
</div>
<div class="item-right tw-flex tw-items-center tw-m-1">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blockedBy"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
{{end}}
@@ -86,7 +90,9 @@
</div>
<div class="item-right tw-flex tw-items-center tw-m-1">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
{{end}}
@@ -106,7 +112,7 @@
<form method="post" action="{{.Issue.Link}}/dependency/add" id="addDependencyForm">
{{$.CsrfTokenHtml}}
<div class="ui fluid action input">
<div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}">
<div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}" data-issue-cross-repo-search="{{.AllowCrossRepositoryDependencies}}">
<input name="newDependency" type="hidden">
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<input type="text" class="search">
@@ -122,28 +128,19 @@
</div>
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
<input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}">
<div class="ui g-modal-confirm modal remove-dependency">
<div class="header">
{{svg "octicon-trash"}}
{{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}
</div>
<form id="issue-remove-dependency-confirm" class="ui g-modal-confirm modal" method="post" action="{{.Issue.Link}}/dependency/delete">
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}</div>
<div class="content">
<form method="post" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm">
{{$.CsrfTokenHtml}}
<input type="hidden" value="" name="removeDependencyID" id="removeDependencyID">
<input type="hidden" value="" name="dependencyType" id="dependencyType">
</form>
<p>{{if .Issue.IsPull}}
{{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}}
{{else}}
{{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}}
{{end}}</p>
{{$.CsrfTokenHtml}}
<input type="hidden" value="" name="removeDependencyID" class="remove-dependency-id">
<input type="hidden" value="" name="dependencyType" class="dependency-type">
<p>
{{ctx.Locale.Tr (Iif .Issue.IsPull "repo.issues.dependency.pr_remove_text" "repo.issues.dependency.issue_remove_text")}}
</p>
{{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
{{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
{{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
</div>
{{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
{{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
{{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
</div>
</form>
{{end}}
{{end}}

View File

@@ -1,7 +1,5 @@
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
<div class="toggle-wip tw-mt-2" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
<a class="muted">
{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
</a>
</div>
<a class="toggle-wip tw-block tw-mt-2" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
</a>
{{end}}