{{if .IssuePriorityDefs}}
<div class="divider"></div>
<div class="tw-flex tw-items-center tw-justify-between tw-gap-2">
	<span class="text grey tw-text-sm">{{ctx.Locale.Tr "repo.issues.priority"}}</span>
	{{$canModify := .HasIssuesOrPullsWritePermission}}
	{{if $canModify}}
		<form method="post" action="{{.RepoLink}}/issues/{{.Issue.ID}}/custom-priority" class="tw-inline">
			{{$.CsrfTokenHtml}}
			<select name="priority_id" class="ui compact mini dropdown tw-max-w-48" onchange="this.form.submit()">
				<option value="0">-</option>
				{{range .IssuePriorityDefs}}
					<option value="{{.ID}}" {{if eq .ID $.Issue.PriorityID}}selected{{end}}
						{{if .Color}}style="border-left: 3px solid {{.Color}}"{{end}}>
						{{.Name}}
					</option>
				{{end}}
			</select>
		</form>
	{{else}}
		{{$found := false}}
		{{range .IssuePriorityDefs}}
			{{if eq .ID $.Issue.PriorityID}}
				{{if .Color}}<span class="tw-inline-block tw-w-3 tw-h-3 tw-rounded" style="background-color: {{.Color}}"></span>{{end}}
				<span class="tw-text-sm">{{.Name}}</span>
				{{$found = true}}
			{{end}}
		{{end}}
		{{if not $found}}
			<span class="tw-text-sm text grey">-</span>
		{{end}}
	{{end}}
</div>
{{end}}
