|
| 1 | +{{if .Repository.IsDependenciesEnabled ctx}} |
| 2 | + <div class="divider"></div> |
| 3 | + |
| 4 | + <div class="ui depending"> |
| 5 | + {{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}} |
| 6 | + <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.dependency.title"}}</strong></span> |
| 7 | + <br> |
| 8 | + <p> |
| 9 | + {{if .Issue.IsPull}} |
| 10 | + {{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}} |
| 11 | + {{else}} |
| 12 | + {{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}} |
| 13 | + {{end}} |
| 14 | + </p> |
| 15 | + {{end}} |
| 16 | + |
| 17 | + {{if or .BlockingDependencies .BlockingDependenciesNotPermitted}} |
| 18 | + <span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_close_blocks"}}{{else}}{{ctx.Locale.Tr "repo.issues.dependency.issue_close_blocks"}}{{end}}"> |
| 19 | + <strong>{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}</strong> |
| 20 | + </span> |
| 21 | + <div class="ui relaxed divided list"> |
| 22 | + {{range .BlockingDependencies}} |
| 23 | + <div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between"> |
| 24 | + <div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis"> |
| 25 | + <a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}"> |
| 26 | + #{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}} |
| 27 | + </a> |
| 28 | + <div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}"> |
| 29 | + {{.Repository.OwnerName}}/{{.Repository.Name}} |
| 30 | + </div> |
| 31 | + </div> |
| 32 | + <div class="item-right tw-flex tw-items-center tw-m-1"> |
| 33 | + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} |
| 34 | + <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"}}"> |
| 35 | + {{svg "octicon-trash" 16}} |
| 36 | + </a> |
| 37 | + {{end}} |
| 38 | + </div> |
| 39 | + </div> |
| 40 | + {{end}} |
| 41 | + {{if .BlockingDependenciesNotPermitted}} |
| 42 | + <div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis"> |
| 43 | + <span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span> |
| 44 | + </div> |
| 45 | + {{end}} |
| 46 | + </div> |
| 47 | + {{end}} |
| 48 | + |
| 49 | + {{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}} |
| 50 | + <span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_closing_blockedby"}}{{else}}{{ctx.Locale.Tr "repo.issues.dependency.issue_closing_blockedby"}}{{end}}"> |
| 51 | + <strong>{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong> |
| 52 | + </span> |
| 53 | + <div class="ui relaxed divided list"> |
| 54 | + {{range .BlockedByDependencies}} |
| 55 | + <div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between"> |
| 56 | + <div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis"> |
| 57 | + <a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}"> |
| 58 | + #{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}} |
| 59 | + </a> |
| 60 | + <div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}"> |
| 61 | + {{.Repository.OwnerName}}/{{.Repository.Name}} |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + <div class="item-right tw-flex tw-items-center tw-m-1"> |
| 65 | + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} |
| 66 | + <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"}}"> |
| 67 | + {{svg "octicon-trash" 16}} |
| 68 | + </a> |
| 69 | + {{end}} |
| 70 | + </div> |
| 71 | + </div> |
| 72 | + {{end}} |
| 73 | + {{if $.CanCreateIssueDependencies}} |
| 74 | + {{range .BlockedByDependenciesNotPermitted}} |
| 75 | + <div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between"> |
| 76 | + <div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis"> |
| 77 | + <div class="gt-ellipsis"> |
| 78 | + <span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span> |
| 79 | + <span class="title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}"> |
| 80 | + #{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}} |
| 81 | + </span> |
| 82 | + </div> |
| 83 | + <div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}"> |
| 84 | + {{.Repository.OwnerName}}/{{.Repository.Name}} |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + <div class="item-right tw-flex tw-items-center tw-m-1"> |
| 88 | + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} |
| 89 | + <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"}}"> |
| 90 | + {{svg "octicon-trash" 16}} |
| 91 | + </a> |
| 92 | + {{end}} |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + {{end}} |
| 96 | + {{else if .BlockedByDependenciesNotPermitted}} |
| 97 | + <div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis"> |
| 98 | + <span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span> |
| 99 | + </div> |
| 100 | + {{end}} |
| 101 | + </div> |
| 102 | + {{end}} |
| 103 | + |
| 104 | + {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}} |
| 105 | + <div> |
| 106 | + <form method="post" action="{{.Issue.Link}}/dependency/add" id="addDependencyForm"> |
| 107 | + {{$.CsrfTokenHtml}} |
| 108 | + <div class="ui fluid action input"> |
| 109 | + <div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}"> |
| 110 | + <input name="newDependency" type="hidden"> |
| 111 | + {{svg "octicon-triangle-down" 14 "dropdown icon"}} |
| 112 | + <input type="text" class="search"> |
| 113 | + <div class="default text">{{ctx.Locale.Tr "repo.issues.dependency.add"}}</div> |
| 114 | + </div> |
| 115 | + <button class="ui icon button"> |
| 116 | + {{svg "octicon-plus"}} |
| 117 | + </button> |
| 118 | + </div> |
| 119 | + </form> |
| 120 | + </div> |
| 121 | + {{end}} |
| 122 | + </div> |
| 123 | + |
| 124 | + {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}} |
| 125 | + <input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}"> |
| 126 | + |
| 127 | + <div class="ui g-modal-confirm modal remove-dependency"> |
| 128 | + <div class="header"> |
| 129 | + {{svg "octicon-trash"}} |
| 130 | + {{ctx.Locale.Tr "repo.issues.dependency.remove_header"}} |
| 131 | + </div> |
| 132 | + <div class="content"> |
| 133 | + <form method="post" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm"> |
| 134 | + {{$.CsrfTokenHtml}} |
| 135 | + <input type="hidden" value="" name="removeDependencyID" id="removeDependencyID"> |
| 136 | + <input type="hidden" value="" name="dependencyType" id="dependencyType"> |
| 137 | + </form> |
| 138 | + <p>{{if .Issue.IsPull}} |
| 139 | + {{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}} |
| 140 | + {{else}} |
| 141 | + {{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}} |
| 142 | + {{end}}</p> |
| 143 | + </div> |
| 144 | + {{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}} |
| 145 | + {{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}} |
| 146 | + {{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}} |
| 147 | + </div> |
| 148 | + {{end}} |
| 149 | +{{end}} |
0 commit comments