Validate hex colors when creating/editing labels (#34623) (#34630)

Backport #34623

---------

Co-authored-by: Kemal Zebari <kemalzebra@gmail.com>
This commit is contained in:
wxiaoguang 2025-06-07 16:24:28 +08:00 committed by GitHub
parent d35161ceb8
commit b1cc4bf77f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@
<div class="field"> <div class="field">
<label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label> <label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label>
<div class="column js-color-picker-input"> <div class="column js-color-picker-input">
<input name="color" value="#70c24a" placeholder="#c320f6" required maxlength="7"> <input name="color" value="#70c24a" placeholder="#c320f6" required pattern="^#?([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$" maxlength="7">
{{template "repo/issue/label_precolors"}} {{template "repo/issue/label_precolors"}}
</div> </div>
</div> </div>