2024-11-11 04:07:54 +08:00
|
|
|
{{$pageMeta := .}}
|
|
|
|
{{$data := .LabelsData}}
|
|
|
|
<div class="issue-sidebar-combo" data-selection-mode="multiple" data-update-algo="diff"
|
|
|
|
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/labels?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
|
|
|
>
|
2024-11-10 16:26:42 +08:00
|
|
|
<input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}">
|
2024-11-11 04:07:54 +08:00
|
|
|
<div class="ui dropdown {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
2024-11-10 16:26:42 +08:00
|
|
|
<a class="text muted">
|
2024-11-11 04:07:54 +08:00
|
|
|
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
2024-11-10 16:26:42 +08:00
|
|
|
</a>
|
|
|
|
<div class="menu">
|
|
|
|
{{if not $data.AllLabels}}
|
|
|
|
<div class="item disabled">{{ctx.Locale.Tr "repo.issues.new.no_items"}}</div>
|
|
|
|
{{else}}
|
|
|
|
<div class="ui icon search input">
|
|
|
|
<i class="icon">{{svg "octicon-search" 16}}</i>
|
|
|
|
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
|
|
|
|
</div>
|
|
|
|
<a class="item clear-selection" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
|
2024-11-21 09:23:50 +08:00
|
|
|
<div class="scrolling menu">
|
|
|
|
{{$previousExclusiveScope := "_no_scope"}}
|
|
|
|
{{range $data.RepoLabels}}
|
|
|
|
{{$exclusiveScope := .ExclusiveScope}}
|
|
|
|
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
|
|
|
|
<div class="divider"></div>
|
|
|
|
{{end}}
|
|
|
|
{{$previousExclusiveScope = $exclusiveScope}}
|
|
|
|
{{template "repo/issue/sidebar/label_list_item" dict "Label" .}}
|
2024-11-10 16:26:42 +08:00
|
|
|
{{end}}
|
2024-11-21 11:31:54 +08:00
|
|
|
{{if and $data.RepoLabels $data.OrgLabels}}<div class="divider"></div>{{end}}
|
2024-11-21 09:23:50 +08:00
|
|
|
{{$previousExclusiveScope = "_no_scope"}}
|
|
|
|
{{range $data.OrgLabels}}
|
|
|
|
{{$exclusiveScope := .ExclusiveScope}}
|
|
|
|
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
|
|
|
|
<div class="divider"></div>
|
|
|
|
{{end}}
|
|
|
|
{{$previousExclusiveScope = $exclusiveScope}}
|
|
|
|
{{template "repo/issue/sidebar/label_list_item" dict "Label" .}}
|
2024-11-10 16:26:42 +08:00
|
|
|
{{end}}
|
2024-11-21 09:23:50 +08:00
|
|
|
</div>
|
2024-11-10 16:26:42 +08:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ui list labels-list tw-my-2 tw-flex tw-gap-2">
|
|
|
|
<span class="item empty-list {{if $data.SelectedLabelIDs}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span>
|
|
|
|
{{range $data.AllLabels}}
|
|
|
|
{{if .IsChecked}}
|
2024-11-11 04:07:54 +08:00
|
|
|
<a class="item" href="{{$pageMeta.RepoLink}}/{{if $pageMeta.IsPullRequest}}pulls{{else}}issues{{end}}?labels={{.ID}}">
|
2024-11-10 16:26:42 +08:00
|
|
|
{{- ctx.RenderUtils.RenderLabel . -}}
|
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|