]> source.dussan.org Git - gitea.git/log
gitea.git
6 months agoAdd commit status summary table to reduce query from commit status table (#30223)
Lunny Xiao [Fri, 12 Apr 2024 01:41:50 +0000 (09:41 +0800)]
Add commit status summary table to reduce query from commit status table (#30223)

This PR adds a new table named commit status summary to reduce queries
from the commit status table. After this change, commit status summary
table will be used for the final result, commit status table will be for
details.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
6 months agoSplit `issue edit` code from `repo-legacy.js` into its own file (#30419)
wxiaoguang [Thu, 11 Apr 2024 18:22:59 +0000 (02:22 +0800)]
Split `issue edit` code from `repo-legacy.js` into its own file (#30419)

Follow Split `index.js` to separate files (#17315)

It's time to move some code away from the messy "legacy" file.

6 months agoCheck the token's owner and repository when registering a runner (#30406)
Zettat123 [Thu, 11 Apr 2024 08:01:44 +0000 (16:01 +0800)]
Check the token's owner and repository when registering a runner (#30406)

Fix #30378

6 months agoAvoid user does not exist error when detecting schedule actions when the commit autho...
yp05327 [Thu, 11 Apr 2024 07:11:32 +0000 (16:11 +0900)]
Avoid user does not exist error when detecting schedule actions when the commit author is an external user (#30357)

![image](https://github.com/go-gitea/gitea/assets/18380374/ddf6ee84-2242-49b9-b066-bd8429ba4d76)

When repo is a mirror, and commit author is an external user, then
`GetUserByEmail` will return error.

reproduce/test:
- mirror Gitea to your instance
- disable action and enable it again, this will trigger
`DetectAndHandleSchedules`

ps: also follow #24706, it only fixed normal runs, not scheduled runs.

6 months agoUpdate actions variables documents (#30394)
Lunny Xiao [Thu, 11 Apr 2024 03:57:03 +0000 (11:57 +0800)]
Update actions variables documents (#30394)

Fix #30393

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Zettat123 <zettat123@gmail.com>
6 months agoFix author name alignment in commits table (#30396)
silverwind [Thu, 11 Apr 2024 03:16:44 +0000 (05:16 +0200)]
Fix author name alignment in commits table (#30396)

Fixes https://github.com/go-gitea/gitea/issues/30129 by introducing a
wrapper div with flexbox that collapses any inter-tag whitespace within.
View diff with whitespace hidden.

Author names aligned:
<img width="172" alt="Screenshot 2024-04-10 at 19 41 27"
src="https://github.com/go-gitea/gitea/assets/115237/d761e8f2-0e67-4f84-8d37-9ed73850470a">

Vertically centered on expand:
<img width="466" alt="Screenshot 2024-04-10 at 19 43 02"
src="https://github.com/go-gitea/gitea/assets/115237/decd68b3-19b5-4cfa-a505-b358e4a0715b">

Ellipsis works:

<img width="344" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/6f8624a2-f8b6-4f3e-ac98-c44dd0cdfca5">

6 months agoUpgrade golangci-lint to v1.57.2 (#30401)
silverwind [Thu, 11 Apr 2024 02:40:03 +0000 (04:40 +0200)]
Upgrade golangci-lint to v1.57.2 (#30401)

Update and adapt to one setting
[deprecation](https://github.com/golangci/golangci-lint/pull/4509).

6 months agoReplace MSSQL driver with a better maintained version (#30390)
Lunny Xiao [Thu, 11 Apr 2024 01:12:40 +0000 (09:12 +0800)]
Replace MSSQL driver with a better maintained version (#30390)

As the latest tag of `github.com/denisenkom/go-mssqldb` is in 2022, but
as a fork of it, `github.com/microsoft/go-mssqldb` has more activities
than the original repository. We can convert the driver to the fork.

Since the interface of Go database driver are the same, it should have
no any affect for the end users.

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 11 Apr 2024 00:24:56 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoMinor color tweaks (#30397)
silverwind [Wed, 10 Apr 2024 20:29:05 +0000 (22:29 +0200)]
Minor color tweaks (#30397)

New approach to color shades: Stem all colors off the body color
`#1b1f23` using [this](https://pinetools.com/darken-color) and
[this](https://pinetools.com/lighten-color) tool. The differences are
very subtle, but it will give a more consistent color scheme until
https://github.com/go-gitea/gitea/issues/30160.

<img width="1342" alt="Screenshot 2024-04-10 at 20 44 16"
src="https://github.com/go-gitea/gitea/assets/115237/75b65797-2521-46ea-91d8-d76f77b591b1">

6 months agoUse raw Wiki links for non-renderable Wiki files (#30273)
Rafael [Wed, 10 Apr 2024 17:49:57 +0000 (18:49 +0100)]
Use raw Wiki links for non-renderable Wiki files (#30273)

In Wiki pages, short-links created to local Wiki files were always
expanded as regular Wiki Links. In particular, if a link wanted to point
to a file that Gitea doesn't know how to render (e.g, a .zip file), a
user following the link would be silently redirected to the Wiki's home
page.

This change makes short-links* in Wiki pages be expanded to raw wiki
links, so these local wiki files may be accessed without manually
accessing their URL.

* only short-links ending in a file extension that isn't renderable are
affected.

Closes #27121.

Signed-off-by: Rafael Girão <rafael.s.girao@tecnico.ulisboa.pt>
Co-authored-by: silverwind <me@silverwind.io>
6 months agoVarious improvements for long file and commit names (#30374)
silverwind [Wed, 10 Apr 2024 06:13:22 +0000 (08:13 +0200)]
Various improvements for long file and commit names (#30374)

Fixes: https://github.com/go-gitea/gitea/issues/29438
This contains numerous enhancements for how large commit messages and
large filenames render. Another notable change is that the file path is
no longer cut off by backend at 30 chars, but rendered in full with
wrapping.

<img width="1329" alt="Screenshot 2024-04-09 at 21 53 57"
src="https://github.com/go-gitea/gitea/assets/115237/5ccbb3d6-643a-4f60-ba79-3572b36d5182">
<hr>
<img width="711" alt="Screenshot 2024-04-09 at 21 44 24"
src="https://github.com/go-gitea/gitea/assets/115237/6ffe8fbb-407c-4aa7-b591-3d80daea7d57">
<hr>
<img width="439" alt="Screenshot 2024-04-09 at 21 19 03"
src="https://github.com/go-gitea/gitea/assets/115237/1ec7f6e9-2fd8-4841-87eb-6ca02ab9cd61">
<hr>
<img width="444" alt="Screenshot 2024-04-09 at 21 18 52"
src="https://github.com/go-gitea/gitea/assets/115237/70931b9e-5841-477e-b3bc-98f8d2662964">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix line height on inline code preview (#30372)
silverwind [Wed, 10 Apr 2024 05:44:48 +0000 (07:44 +0200)]
Fix line height on inline code preview (#30372)

Fixes https://github.com/go-gitea/gitea/issues/30353.

I don't know what causes `code-inner` to not inherit `line-height` from
its direct parent `.lines-code` but instead from grandparent `.markup`
even thought MDN tells me it's
[inherited](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#formal_definition).
This causes no negative impact on other code views, so I think it's the
best solution.

6 months agoRefactor more filterslice (#30370)
Lunny Xiao [Wed, 10 Apr 2024 04:18:41 +0000 (12:18 +0800)]
Refactor more filterslice (#30370)

6 months agoFix ambiguous id when fetch Actions tasks (#30382)
Jason Song [Wed, 10 Apr 2024 02:57:43 +0000 (10:57 +0800)]
Fix ambiguous id when fetch Actions tasks (#30382)

Fix regression of #30331.

```txt
time="2024-04-10T02:23:49Z" level=error msg="failed to fetch task" func="[fetchTask]" file="[poller.go:91]" error="unknown: rpc error: code = Internal desc = pick task: CreateTaskForRunner: Error 1052 (23000): Column 'id' in field list is ambiguous"
```

6 months agoFix floated list items (#30377)
silverwind [Wed, 10 Apr 2024 02:16:55 +0000 (04:16 +0200)]
Fix floated list items (#30377)

Fixes https://github.com/go-gitea/gitea/issues/30365, regression from
https://github.com/go-gitea/gitea/pull/30281

6 months agoFix actions design about default actions download url (#30360)
Lunny Xiao [Tue, 9 Apr 2024 16:39:38 +0000 (00:39 +0800)]
Fix actions design about default actions download url (#30360)

Fix #30359

6 months agoAdd container.FilterSlice function (#30339)
oliverpool [Tue, 9 Apr 2024 12:27:30 +0000 (14:27 +0200)]
Add container.FilterSlice function (#30339)

Many places have the following logic:
```go
func (jobs ActionJobList) GetRunIDs() []int64 {
ids := make(container.Set[int64], len(jobs))
for _, j := range jobs {
if j.RunID == 0 {
continue
}
ids.Add(j.RunID)
}
return ids.Values()
}
```

this introduces a `container.FilterMapUnique` function, which reduces
the code above to:
```go
func (jobs ActionJobList) GetRunIDs() []int64 {
return container.FilterMapUnique(jobs, func(j *ActionRunJob) (int64, bool) {
return j.RunID, j.RunID != 0
})
}
```

6 months agoFix label-list rendering in timeline, decrease gap (#30342)
silverwind [Tue, 9 Apr 2024 06:30:21 +0000 (08:30 +0200)]
Fix label-list rendering in timeline, decrease gap (#30342)

Not sure exactly when this regressed, but has been a while I think.

Before:

<img width="895" alt="Screenshot 2024-04-08 at 22 46 50"
src="https://github.com/go-gitea/gitea/assets/115237/9b1788f8-017e-4fe1-8ab9-938e0d76fb41">

After:

<img width="689" alt="Screenshot 2024-04-08 at 23 00 58"
src="https://github.com/go-gitea/gitea/assets/115237/90193df9-5c24-4a1a-96fe-3d4e8392063c">

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoPerformance optimization for git push (#30104)
Lunny Xiao [Tue, 9 Apr 2024 03:43:17 +0000 (11:43 +0800)]
Performance optimization for git push (#30104)

Agit returned result should be from `ProcReceive` hook but not
`PostReceive` hook. Then for all non-agit pull requests, it will not
check the pull requests for every pushing `refs/pull/%d/head`.

6 months agoReduce checkbox size to 15px (#30346)
silverwind [Tue, 9 Apr 2024 03:09:43 +0000 (05:09 +0200)]
Reduce checkbox size to 15px (#30346)

16 seems to big, 14 too small. Let's do 15. Alignment:

<img width="181" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/f2988611-dee2-492e-a18f-dc5ab3a1cd6c">

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 9 Apr 2024 00:24:26 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoFix missed doer (#30231)
Lunny Xiao [Mon, 8 Apr 2024 21:26:41 +0000 (05:26 +0800)]
Fix missed doer (#30231)

Fix #29879

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoAdd optional doctor storage init (#30330)
Michael Kriese [Mon, 8 Apr 2024 20:59:09 +0000 (22:59 +0200)]
Add optional doctor storage init (#30330)

Add optional storage init to doctor

6 months agoAvoid running action when action unit is disabled after workflows detected (#30331)
yp05327 [Mon, 8 Apr 2024 14:08:26 +0000 (23:08 +0900)]
Avoid running action when action unit is disabled after workflows detected (#30331)

Fix #30243

We only checking unit disabled when detecting workflows, but not in
runner `FetchTask`.
So if a workflow was detected when action unit is enabled, but disabled
later, `FetchTask` will still return these detected actions.

Global setting: repo.ENABLED and repository.`DISABLED_REPO_UNITS` will
not effect this.

6 months agoAvoid showing `Failed to change the default wiki branch` if repo has no wiki when...
yp05327 [Mon, 8 Apr 2024 11:43:23 +0000 (20:43 +0900)]
Avoid showing `Failed to change the default wiki branch` if repo has no wiki when saving repo settings (#30329)

6 months agoFix oauth2 builtin application logic (#30304)
wxiaoguang [Mon, 8 Apr 2024 04:13:34 +0000 (12:13 +0800)]
Fix oauth2 builtin application logic (#30304)

Fix #29074 (allow to disable all builtin apps) and don't make the doctor
command remove the builtin apps.

By the way, rename refobject and joincond to camel case.

6 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 8 Apr 2024 00:25:35 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

6 months agoSome NuGet package enhancements (#30280)
KN4CK3R [Sun, 7 Apr 2024 16:46:59 +0000 (18:46 +0200)]
Some NuGet package enhancements (#30280)

Fixes #30265

1. Read second type of dependencies
2. Render `Description` and `ReleaseNotes`

old:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/abac057c-11cd-4d25-b196-01ff899d948e)

new:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/35302273-740c-481a-a031-1f80d2d7d336)

The NuGet spec does not specify what kind of text can be stored in the
description but we can best guess markdown. The official NuGet registry
just [converts the newlines to html
lines](https://www.nuget.org/packages/rb.Firefox#readme-body-tab).

3. Extract and render the readme. This is the new and better place to
store larger text than in the description. The content is markdown.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/f442264e-3735-4b55-92c4-3b89a8ebafb0)

---------

Co-authored-by: Benjamin Heemann <benjamin.heemann@raith.de>
6 months agoFix and rewrite contrast color calculation, fix project-related bugs (#30237)
silverwind [Sun, 7 Apr 2024 16:19:25 +0000 (18:19 +0200)]
Fix and rewrite contrast color calculation, fix project-related bugs (#30237)

1. The previous color contrast calculation function was incorrect at
least for the `#84b6eb` where it output low-contrast white instead of
black. I've rewritten these functions now to accept hex colors and to
match GitHub's calculation and to output pure white/black for maximum
contrast. Before and after:
<img width="94" alt="Screenshot 2024-04-02 at 01 53 46"
src="https://github.com/go-gitea/gitea/assets/115237/00b39e15-a377-4458-95cf-ceec74b78228"><img
width="90" alt="Screenshot 2024-04-02 at 01 51 30"
src="https://github.com/go-gitea/gitea/assets/115237/1677067a-8d8f-47eb-82c0-76330deeb775">

2. Fix project-related issues:

- Expose the new `ContrastColor` function as template helper and use it
for project cards, replacing the previous JS solution which eliminates a
flash of wrong color on page load.
- Fix a bug where if editing a project title, the counter would get
lost.
- Move `rgbToHex` function to color utils.

@HesterG fyi

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoAdd `--page-spacing` variable, fix admin dashboard notice (#30302)
silverwind [Sun, 7 Apr 2024 15:45:36 +0000 (17:45 +0200)]
Add `--page-spacing` variable, fix admin dashboard notice (#30302)

Fixes https://github.com/go-gitea/gitea/issues/30293 and introduce the
`--page-spacing` variable which holds the spacing between the elements
on the page. This is working vertically for all pages, including ones
that have fomantic grid, and horizontally for all that use
`flex-container`.

The `.page-content > :first-child:not(.secondary-nav)` selector uses
margin which in some cases enables to adjacent margins to overlap, which
is nice.

<img width="1320" alt="Screenshot 2024-04-06 at 01 35 19"
src="https://github.com/go-gitea/gitea/assets/115237/3e81e707-e9ff-4b7f-a211-3d98f4f85353">
---
<img width="1327" alt="Screenshot 2024-04-06 at 01 35 45"
src="https://github.com/go-gitea/gitea/assets/115237/aad196c0-9e21-4c06-ae59-7e33a76c61e1">
---
<img width="1321" alt="Screenshot 2024-04-06 at 01 35 31"
src="https://github.com/go-gitea/gitea/assets/115237/785f6c5d-08b6-4e66-aa16-aeca7cfed3ad">

6 months agoAction view mobile improvements and fixes (#30309)
silverwind [Sun, 7 Apr 2024 12:41:42 +0000 (14:41 +0200)]
Action view mobile improvements and fixes (#30309)

Fix the action issue in https://github.com/go-gitea/gitea/issues/30303,
specifically:

- Use opaque step header hover background to avoid transparency issue
- Un-sticky the `action-view-left` on mobile, it would otherwise overlap
into right view
- Improve commit summary, let it wrap
- Fix and comment z-indexes
- Tweak width for run-list-item-right so it wastes less space on desktop
- Synced latest changes to console colors from dark to light theme

<img width="467" alt="Screenshot 2024-04-06 at 18 58 15"
src="https://github.com/go-gitea/gitea/assets/115237/8ad26b72-6cd9-4522-8ad1-6fd86b2d0d53">

6 months agoFix checkboxes on mobile view, remove some dead css (#30308)
silverwind [Sun, 7 Apr 2024 12:36:33 +0000 (14:36 +0200)]
Fix checkboxes on mobile view, remove some dead css (#30308)

Fix the checkbox issues in
https://github.com/go-gitea/gitea/issues/30303 which were existing
problems with these selectors, but made visible with
https://github.com/go-gitea/gitea/pull/30162.

There is a lot of dead/useless CSS in `form.css`, I only fixed the two
problems and remove CSS that was definitely not in use or needed.

<img width="369" alt="Screenshot 2024-04-06 at 18 00 08"
src="https://github.com/go-gitea/gitea/assets/115237/720f178b-1b22-48d4-8704-becb8ce66129">
<img width="405" alt="Screenshot 2024-04-06 at 18 00 28"
src="https://github.com/go-gitea/gitea/assets/115237/61c0f8ec-34af-46c5-a3fa-7c5c4d30c7d2">

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoClean up log messages (#30313)
wxiaoguang [Sun, 7 Apr 2024 11:17:06 +0000 (19:17 +0800)]
Clean up log messages (#30313)

`log.Xxx("%v")` is not ideal, this PR adds necessary context messages.
Remove some unnecessary logs.

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix right-aligned input icons (#30301)
silverwind [Sun, 7 Apr 2024 08:53:28 +0000 (10:53 +0200)]
Fix right-aligned input icons (#30301)

Fix regression from https://github.com/go-gitea/gitea/pull/30194 where
right-aligned items would not display correctly.

Before and After:

<img width="285" alt="Screenshot 2024-04-06 at 01 12 11"
src="https://github.com/go-gitea/gitea/assets/115237/f9168db5-0f69-4b5d-ba17-b60145ac4a09">
<img width="285" alt="Screenshot 2024-04-06 at 01 11 49"
src="https://github.com/go-gitea/gitea/assets/115237/639ab6ed-d018-4e3a-9980-1f079e4ebe9d">

Frontpage search tweaked to accommodate (which was the reason for the
changes that broken above):

<img width="445" alt="Screenshot 2024-04-06 at 01 11 34"
src="https://github.com/go-gitea/gitea/assets/115237/1919220b-390e-463a-8e3d-33a3556bf111">
<img width="438" alt="Screenshot 2024-04-06 at 01 11 39"
src="https://github.com/go-gitea/gitea/assets/115237/fd94f8e4-1d56-4b04-99e3-1cd240bd7ab4">

6 months agoRefactor startup deprecation messages (#30305)
wxiaoguang [Sun, 7 Apr 2024 01:11:25 +0000 (09:11 +0800)]
Refactor startup deprecation messages (#30305)

It doesn't change logic, it only does:

1. Rename the variable and function names
2. Use more consistent format when mentioning config section&key
3. Improve some messages

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 7 Apr 2024 00:27:31 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoRemove fomantic list module (#30281)
silverwind [Sat, 6 Apr 2024 21:33:45 +0000 (23:33 +0200)]
Remove fomantic list module (#30281)

Likely still some unnecessary CSS but any combinations with the `ui
list` classes are covered. There was only on instance of `horizontal
list` which I removed. It was this part of the commit page:

<img width="396" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/c49ec4f5-93c3-41d6-a907-cdbedf8abc44">

6 months agoMarkup color and font size fixes (#30282)
silverwind [Sat, 6 Apr 2024 21:06:27 +0000 (23:06 +0200)]
Markup color and font size fixes (#30282)

1. Distinguish inline an block code with new CSS variable
`--color-markup-code-inline`
2. Various color tweaks, better contrast from background

<img width="447" alt="Screenshot 2024-04-05 at 00 51 00"
src="https://github.com/go-gitea/gitea/assets/115237/93e069f4-6807-4f2c-9331-2d69730919d4">
<img width="456" alt="Screenshot 2024-04-05 at 00 50 44"
src="https://github.com/go-gitea/gitea/assets/115237/0dc9c745-c531-40fa-94ec-b0ba10bd7ccf">

6 months agoFix code block style for code preview (#30298)
wxiaoguang [Sat, 6 Apr 2024 12:07:08 +0000 (20:07 +0800)]
Fix code block style for code preview (#30298)

Fix #30292

To avoid unnecessary style overriding, use "div" instead of "code"

6 months agoAlways use `octicon-eye` on watch button (#30288)
silverwind [Sat, 6 Apr 2024 08:25:39 +0000 (10:25 +0200)]
Always use `octicon-eye` on watch button (#30288)

This might appear odd but I think it's the right thing to do: On Github,
the "Watch" button always has the open eye icon:

<img width="177" alt="Screenshot 2024-04-05 at 08 26 48"
src="https://github.com/go-gitea/gitea/assets/115237/0c1188d1-145b-4c6d-909f-2e1460499941">
<img width="179" alt="Screenshot 2024-04-05 at 08 26 40"
src="https://github.com/go-gitea/gitea/assets/115237/e29d91fa-f122-4e10-9589-f79c1d612cf9">

On Gitea, while watching, the icon is this and this sometimes confuses
me slightly, being used to above:

<img width="158" alt="Screenshot 2024-04-05 at 08 29 08"
src="https://github.com/go-gitea/gitea/assets/115237/3301021b-744e-409f-a9d8-887ec2772fdc">

After this PR, both states will use the same icon:

<img width="145" alt="Screenshot 2024-04-05 at 08 26 27"
src="https://github.com/go-gitea/gitea/assets/115237/8addfa5b-c009-4bdb-bfa1-4f3dfaffa4cd">
<img width="161" alt="Screenshot 2024-04-05 at 08 26 33"
src="https://github.com/go-gitea/gitea/assets/115237/cef383e6-2cc0-460f-a4d3-83ebb321debe">

6 months agoFix view commit link (#30297)
wxiaoguang [Fri, 5 Apr 2024 18:03:07 +0000 (02:03 +0800)]
Fix view commit link (#30297)

Fix #30098

6 months agoAdd gap to commit status details (#30284)
silverwind [Fri, 5 Apr 2024 11:11:26 +0000 (13:11 +0200)]
Add gap to commit status details (#30284)

Before:
<img width="162" alt="Screenshot 2024-04-05 at 02 25 27"
src="https://github.com/go-gitea/gitea/assets/115237/9f786811-3e45-4b3c-aaf9-e1d2cad284d2">

After:
<img width="172" alt="Screenshot 2024-04-05 at 02 27 25"
src="https://github.com/go-gitea/gitea/assets/115237/f5254877-9e0d-44cb-9605-ba15c75872bb">

6 months agoUpdate JS dependencies and add new eslint rules (#30279)
silverwind [Fri, 5 Apr 2024 03:35:37 +0000 (05:35 +0200)]
Update JS dependencies and add new eslint rules (#30279)

- Run `make update-js`
- Added new eslint rules
- Tested webpack build and swagger ui

6 months agoUpgrade `golang.org/x/net` to v0.24.0 (#30283)
silverwind [Fri, 5 Apr 2024 02:45:59 +0000 (04:45 +0200)]
Upgrade `golang.org/x/net` to v0.24.0 (#30283)

Result of `go get -u golang.org/x/net; make tidy`.

This is related to the following vulncheck warning:
```
There are 2 vulnerabilities in modules that you require that are
neither imported nor called. You may not need to take any action.
See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck for details.

Vulnerability #1: GO-2024-2687
    HTTP/2 CONTINUATION flood in net/http
  More info: https://pkg.go.dev/vuln/GO-2024-2687
  Module: golang.org/x/net
    Found in: golang.org/x/net@v0.22.0
    Fixed in: golang.org/x/net@v0.23.0

Vulnerability #2: GO-2022-0470
    No access control in github.com/blevesearch/bleve and bleve/v2
  More info: https://pkg.go.dev/vuln/GO-2022-0470
  Module: github.com/blevesearch/bleve/v2
    Found in: github.com/blevesearch/bleve/v2@v2.3.10
    Fixed in: N/A
```

6 months agoCommit-Dropdown: Show Author of commit if available (#30272)
sebastian-sauer [Fri, 5 Apr 2024 00:51:53 +0000 (02:51 +0200)]
Commit-Dropdown: Show Author of commit if available (#30272)

As in commits page we show the author of the commit in the commits
dropdown and not the committer.

Commits Page:
![Screenshot from 2024-04-03
22-34-41](https://github.com/go-gitea/gitea/assets/1135157/1c7c5c19-6d0a-4176-8a87-7bca6a0c6dc8)

and the same contents in our dropdown:

![image](https://github.com/go-gitea/gitea/assets/1135157/aa094af2-c369-47ac-9c27-ca208d1d03f0)

fixes #29588

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 5 Apr 2024 00:24:29 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 4 Apr 2024 00:24:47 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoupdate mailer example config, remove deprecated HOST (#30267)
Knud Hollander [Wed, 3 Apr 2024 23:16:02 +0000 (01:16 +0200)]
update mailer example config, remove deprecated HOST (#30267)

6 months agoAdd `[other].SHOW_FOOTER_POWERED_BY` setting to hide `Powered by` (#30253)
Yakov [Wed, 3 Apr 2024 16:01:50 +0000 (09:01 -0700)]
Add `[other].SHOW_FOOTER_POWERED_BY` setting to hide `Powered by` (#30253)

This allows you to hide the "Powered by" text in footer via
`SHOW_FOOTER_POWERED_BY` flag in configuration.

---------

Co-authored-by: silverwind <me@silverwind.io>
6 months agofix: close file in the Upload func (#30262)
guangwu [Wed, 3 Apr 2024 14:58:13 +0000 (22:58 +0800)]
fix: close file in the Upload func (#30262)

6 months agoReplace coloris with vanilla-colorful (#30201)
silverwind [Wed, 3 Apr 2024 09:15:06 +0000 (11:15 +0200)]
Replace coloris with vanilla-colorful (#30201)

Found [a better color
picker](https://github.com/web-padawan/vanilla-colorful) that [does not
rely](https://github.com/mdbassit/Coloris/issues/139) on
`querySelectorAll` or a global shared instance, and is also around a
third of the size of the previous one.

The popover is handled by tippy.js for which I introduced a new "bare"
theme and it uses a new sibling-based mechanism which should prove
useful later to create tippy popovers via HTML only.

<img width="846" alt="Screenshot 2024-03-31 at 04 03 38"
src="https://github.com/go-gitea/gitea/assets/115237/7639b911-a2d7-4f5c-bffd-a9d84561e747">

6 months agoRefactor "dump" sub-command (#30240)
wxiaoguang [Wed, 3 Apr 2024 02:16:46 +0000 (10:16 +0800)]
Refactor "dump" sub-command (#30240)

Major changes:

* Move some functions like "addReader" / "isSubDir" /
"addRecursiveExclude" to a separate package, and add tests
* Clarify the filename&dump type logic and add tests
* Clarify the logger behavior and remove FIXME comments

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoAdd -u git to docs when using docker exec with root installation (#29314)
scribblemaniac [Wed, 3 Apr 2024 01:47:13 +0000 (19:47 -0600)]
Add -u git to docs when using docker exec with root installation (#29314)

This fixes a minor issue in the documentation for SSH Container
Passthrough for non-rootless installs. The non-rootless Dockerfile and
docker-compose do not set `USER`/`user` instructions so `docker exec`
will run as root by default. While running as root, gitea commands will
refuse to execute, breaking these approaches. For containers built with
the rootless instructions, `docker exec` will run as git by default so
this is not necessary in that case.

This issue was already discussed in #19065, but it does not appear this
part of the issue was ever added to the documentation.

6 months agoShow 12 lines in markup code preview (#30255)
silverwind [Wed, 3 Apr 2024 01:44:15 +0000 (03:44 +0200)]
Show 12 lines in markup code preview (#30255)

Show up to 12 lines instead of previous 5.

6 months agoFixes #27605: inline math blocks can't be preceeded/followed by alphanumerical charac...
João Tiago [Tue, 2 Apr 2024 18:15:40 +0000 (19:15 +0100)]
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175)

- Inline math blocks couldn't be preceeded or succeeded by
alphanumerical characters due to changes introduced in PR #21171.
Removed the condition that caused this (precedingCharacter condition)
and added a new exit condition of the for-loop that checks if a specific
'$' was escaped using '\' so that the math expression can be rendered as
intended.
- Additionally this PR fixes another bug where math blocks of the type
'$xyz$abc$' where the dollar sign was not escaped by the user, generated
an error (shown in the screenshots below)
- Altered the tests to accomodate for the changes

Former behaviour (from try.gitea.io):

![image](https://github.com/go-gitea/gitea/assets/114936010/8f0cbb21-321d-451c-b871-c67a8e1e9235)

Fixed behaviour (from my local build):

![image](https://github.com/go-gitea/gitea/assets/114936010/5c22687c-6f11-4407-b5e7-c14b838bc20d)

(Edit) Source code for the README.md file:
```
$x$ -$x$ $x$-

a$xa$ $xa$a 1$xb$ $xb$1

$a a$b b$

a$b $a a$b b$

$a a\$b b$
```

---------

Signed-off-by: João Tiago <joao.leal.tintas@tecnico.ulisboa.pt>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRender embedded code preview by permlink in markdown (#30234)
wxiaoguang [Tue, 2 Apr 2024 17:48:27 +0000 (01:48 +0800)]
Render embedded code preview by permlink in markdown (#30234)

The permlink in markdown will be rendered as a code preview block, like GitHub

Co-authored-by: silverwind <me@silverwind.io>
6 months agoFix missing 0 prefix of GPG key id (#30245)
KN4CK3R [Tue, 2 Apr 2024 15:50:57 +0000 (17:50 +0200)]
Fix missing 0 prefix of GPG key id (#30245)

Fixes #30235

If the key id "front" byte has a single digit, `%X` is missing the 0
prefix.
38D1A3EADDBEA9C` instead of
`038D1A3EADDBEA9C`
When using the `IssuerFingerprint` slice `%X` is enough but I changed it
to `%016X` too to be consistent.

6 months agoFix spacing in issue navbar (#30238)
silverwind [Tue, 2 Apr 2024 11:48:07 +0000 (13:48 +0200)]
Fix spacing in issue navbar (#30238)

Create a new `issue-navbar` class specifically for this bar, previous
class used in many places and I thought I had them all removed, but not
this one.

Fixes: https://github.com/go-gitea/gitea/issues/30226
6 months agoAdd unique index for project_issue to prevent duplicate data (#30190)
Lunny Xiao [Tue, 2 Apr 2024 08:02:05 +0000 (16:02 +0800)]
Add unique index for project_issue to prevent duplicate data (#30190)

Fix #27639

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 2 Apr 2024 00:24:02 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoRefactor commit signature parser (#30228)
wxiaoguang [Mon, 1 Apr 2024 20:23:17 +0000 (04:23 +0800)]
Refactor commit signature parser (#30228)

To make it more flexible and support SSH signature.

The existing tests are not changed, there are also tests covering
`parseTagRef` which also calls `parsePayloadSignature` now. Add some new
tests to `Test_parseTagData`

6 months agoRefactor dropzone (#30232)
wxiaoguang [Mon, 1 Apr 2024 18:16:38 +0000 (02:16 +0800)]
Refactor dropzone (#30232)

Simplify code and use `.files` elements

6 months agoRemove scheduled action tasks if the repo is archived (#30224)
Zettat123 [Mon, 1 Apr 2024 13:48:14 +0000 (21:48 +0800)]
Remove scheduled action tasks if the repo is archived (#30224)

Fix #30220

6 months agoRefactor file view & render (#30227)
wxiaoguang [Mon, 1 Apr 2024 13:11:30 +0000 (21:11 +0800)]
Refactor file view & render (#30227)

The old code is inconsistent and fragile, and the UI isn't right.

6 months agoRefactor DeleteInactiveUsers, fix bug and add tests (#30206)
wxiaoguang [Mon, 1 Apr 2024 02:06:35 +0000 (10:06 +0800)]
Refactor DeleteInactiveUsers, fix bug and add tests (#30206)

1. check `IsActive` before calling `IsLastAdminUser`.
2. Fix some comments and error messages.
3. Don't `return err` if "removing file" fails in `DeleteUser`.
4. Remove incorrect `DeleteInactiveEmailAddresses`. Active users could
also have inactive emails, and inactive emails do not support
"olderThan"
5. Add tests

6 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 1 Apr 2024 00:27:21 +0000 (00:27 +0000)]
[skip ci] Updated licenses and gitignores

6 months agoAdd `/options/license` and `/options/gitignore` to `.ignore` (#30219)
silverwind [Sun, 31 Mar 2024 20:22:29 +0000 (22:22 +0200)]
Add `/options/license` and `/options/gitignore` to `.ignore` (#30219)

Ignore this folder in tools like `rg` or `ag`. Also sorted the entries
alphabetically.

6 months agoRemove fomantic input module (#30194)
silverwind [Sun, 31 Mar 2024 16:06:06 +0000 (18:06 +0200)]
Remove fomantic input module (#30194)

Another pure CSS module. Some styling is part of the `form` module which
will likely follow next.

6 months agoRemove most jQuery function calls from the repository topic box (#30191)
Yarden Shoham [Sun, 31 Mar 2024 15:39:50 +0000 (18:39 +0300)]
Remove most jQuery function calls from the repository topic box (#30191)

Remove most jQuery function calls

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoPrevent flash of dropdown menu on labels list (#30215)
silverwind [Sun, 31 Mar 2024 14:58:55 +0000 (16:58 +0200)]
Prevent flash of dropdown menu on labels list (#30215)

On the labels list, This `left` class caused the dropdown content to
flash on page load until JS had hidden it. Remove it as I see no purpose
to it.

<img width="215" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9e1de97f-dd89-41e0-9229-5c4a786ba762">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoRemove jQuery class from the `repo-issue.js` file (#30192)
Yarden Shoham [Sun, 31 Mar 2024 12:01:21 +0000 (15:01 +0300)]
Remove jQuery class from the `repo-issue.js` file (#30192)

Switched from jQuery class functions to plain JavaScript `classList`.

Tested the following functionalities and they work as before:
- delete issue comment
- cancel code comment
- update (merge or rebase) pull request
- re-request review
- reply to code comment
- show/hide outdated comments
- add code comment
- edit issue title

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
6 months agoIgnore fomantic folder in linters (#30200)
silverwind [Sun, 31 Mar 2024 11:41:28 +0000 (13:41 +0200)]
Ignore fomantic folder in linters (#30200)

We are not linting these files but editor integrations will still try to
lint, disable that.

6 months agoRemove `modifies/frontend` from labeler (#30198)
silverwind [Sun, 31 Mar 2024 11:35:11 +0000 (13:35 +0200)]
Remove `modifies/frontend` from labeler (#30198)

Remove this label, I find it barely useful and we already have more
useful labels like `modifies/js`. Backport so that we can eventually
delete that label.

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoMake a distinction between `active` and `selected` in the issue author dropdown ...
Yarden Shoham [Sun, 31 Mar 2024 11:27:39 +0000 (14:27 +0300)]
Make a distinction between `active` and `selected` in the issue author dropdown (#30207)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoMove and simplify tab-size helpers (#30196)
silverwind [Sun, 31 Mar 2024 11:22:28 +0000 (13:22 +0200)]
Move and simplify tab-size helpers (#30196)

Tailwind does not support. Dropped the vendor-prefix.

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix markdown color code detection (#30208)
wxiaoguang [Sun, 31 Mar 2024 11:17:34 +0000 (19:17 +0800)]
Fix markdown color code detection (#30208)

When reviewing PRs, some color names might be mentioned, the
`transformCodeSpan` (which calls `css.ColorHandler`) considered it as a
valid color, but actually it shouldn't be rendered as a color codespan.

6 months agoDo not allow different storage configurations to point to the same directory (#30169)
wxiaoguang [Sun, 31 Mar 2024 03:03:24 +0000 (11:03 +0800)]
Do not allow different storage configurations to point to the same directory (#30169)

Replace #29171

6 months agoFix GPG subkey verify (#30193)
KN4CK3R [Sun, 31 Mar 2024 02:35:19 +0000 (04:35 +0200)]
Fix GPG subkey verify (#30193)

Fixes #30189

Can't verify subkeys if they are not loaded.

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 31 Mar 2024 00:27:17 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoFix unclickable checkboxes (#30195)
silverwind [Sun, 31 Mar 2024 00:00:58 +0000 (01:00 +0100)]
Fix unclickable checkboxes (#30195)

Fix https://github.com/go-gitea/gitea/issues/30185, regression from
https://github.com/go-gitea/gitea/pull/30162.

The checkboxes were unclickable because the label was positioned over
the checkbox with `padding`. Now it uses `margin` so the checkbox itself
will be clickable in all cases.

Secondly, I changed the for/id linking to also add missing `for`
attributes when `id` is present. The other way around (only `for`
present) is currently not handled and I think there are likey no
occurences in the code and introducing new non-generated `id`s might
cause problems elsewhere if we do, so I skipped on that.

6 months agoRemove jQuery class from the issue author dropdown (#30188)
Yarden Shoham [Sat, 30 Mar 2024 22:14:57 +0000 (01:14 +0300)]
Remove jQuery class from the issue author dropdown (#30188)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the issue author dropdown functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRemove jQuery class from the comment edit history (#30186)
Yarden Shoham [Sat, 30 Mar 2024 22:09:46 +0000 (01:09 +0300)]
Remove jQuery class from the comment edit history (#30186)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the comment edit history functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRemove jQuery class from the repository branch settings (#30184)
Yarden Shoham [Sat, 30 Mar 2024 21:30:00 +0000 (00:30 +0300)]
Remove jQuery class from the repository branch settings (#30184)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the repository branch settings functionality and it works as
before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 30 Mar 2024 18:47:50 +0000 (18:47 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoUse Crowdin action for translation sync (#30054)
Denys Konovalov [Sat, 30 Mar 2024 18:11:50 +0000 (19:11 +0100)]
Use Crowdin action for translation sync (#30054)

Switch from the old self-built action to the official one.

We get:
- config managed inside the repo
- automatic upload when source file changes
- automatic invalidation if source string changes (tested)
- automatic download of new translation files

Tested both upload and download.

6 months agoRemove jQuery class from the project page (#30183)
Yarden Shoham [Sat, 30 Mar 2024 17:36:28 +0000 (20:36 +0300)]
Remove jQuery class from the project page (#30183)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the edit column modal functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoRemove jQuery class from the comment context menu (#30179)
Yarden Shoham [Sat, 30 Mar 2024 09:40:39 +0000 (12:40 +0300)]
Remove jQuery class from the comment context menu (#30179)

- Switched from jQuery class functions to plain JavaScript
- Tested the comment context menu functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
6 months agoInclude encoding in signature payload (#30174)
KN4CK3R [Fri, 29 Mar 2024 21:55:10 +0000 (22:55 +0100)]
Include encoding in signature payload (#30174)

Fixes #30119

Include the encoding in the signature payload.

before

![grafik](https://github.com/go-gitea/gitea/assets/1666336/01ab94a3-8af5-4d6f-be73-a10b65a15421)

after

![grafik](https://github.com/go-gitea/gitea/assets/1666336/3a37d438-c70d-4d69-b178-d170e74aa683)

6 months agoAdd `stylelint-value-no-unknown-custom-properties` and convert stylelint config to...
silverwind [Fri, 29 Mar 2024 20:32:35 +0000 (21:32 +0100)]
Add `stylelint-value-no-unknown-custom-properties` and convert stylelint config to js (#30117)

Add
[`stylelint-value-no-unknown-custom-properties`](https://github.com/csstools/stylelint-value-no-unknown-custom-properties)
which lints for undefined CSS variables. No current violations.

To make it work properly with editor integrations, I had to convert the
config to JS to be able to pass absolute paths to the plugin, but this
is a needed change anyways.

6 months agoRemove jQuery class from the commit button (#30178)
Yarden Shoham [Fri, 29 Mar 2024 19:24:17 +0000 (22:24 +0300)]
Remove jQuery class from the commit button (#30178)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the commit button disabled toggling functionality and it works
as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRemove jQuery class from the diff view (#30176)
Yarden Shoham [Fri, 29 Mar 2024 18:51:44 +0000 (21:51 +0300)]
Remove jQuery class from the diff view (#30176)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the diff view functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
6 months agoRemove jQuery class from the notification count (#30172)
Yarden Shoham [Fri, 29 Mar 2024 17:17:21 +0000 (20:17 +0300)]
Remove jQuery class from the notification count (#30172)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the notification count and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRemove jQuery class from the code range selection (#30173)
Yarden Shoham [Fri, 29 Mar 2024 17:08:54 +0000 (20:08 +0300)]
Remove jQuery class from the code range selection (#30173)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the code range selection functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoFix:the rounded corners of the folded file are not displayed correctly (#29953)
HEREYUA [Fri, 29 Mar 2024 15:39:46 +0000 (23:39 +0800)]
Fix:the rounded corners of the folded file are not displayed correctly (#29953)

Fix:    [#29933](https://github.com/go-gitea/gitea/issues/29933)

**Before**

![image](https://github.com/go-gitea/gitea/assets/37935145/71ec80f6-5896-4e4a-b686-4d792c11ebe2)

**After**

![image](https://github.com/go-gitea/gitea/assets/37935145/81348a61-946a-4562-881d-8d873e50228f)

---------

Co-authored-by: silverwind <me@silverwind.io>
6 months agoAdd setting to disable user features when user login type is not plain (#29615)
Jack Hay [Fri, 29 Mar 2024 15:05:41 +0000 (11:05 -0400)]
Add setting to disable user features when user login type is not plain (#29615)

## Changes
- Adds setting `EXTERNAL_USER_DISABLE_FEATURES` to disable any supported
user features when login type is not plain
- In general, this is necessary for SSO implementations to avoid
inconsistencies between the external account management and the linked
account
- Adds helper functions to encourage correct use

6 months agoRemove jQuery class from the image diff (#30140)
Yarden Shoham [Fri, 29 Mar 2024 12:40:17 +0000 (15:40 +0300)]
Remove jQuery class from the image diff (#30140)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the image diff and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoRemove fomantic checkbox module (#30162)
silverwind [Fri, 29 Mar 2024 04:56:01 +0000 (05:56 +0100)]
Remove fomantic checkbox module (#30162)

CSS is pretty slim already and the `.ui.toggle.checkbox` sliders on
admin page also still work. The only necessary JS is the one that links
`input` and `label` so that it can be toggled via label. All checkboxes
except the markdown ones render at `--checkbox-size: 16px` now.

<img width="174" alt="Screenshot 2024-03-28 at 22 15 10"
src="https://github.com/go-gitea/gitea/assets/115237/3455c1bb-166b-47e4-9847-2d20dd1f04db">

<img width="499" alt="Screenshot 2024-03-28 at 21 00 07"
src="https://github.com/go-gitea/gitea/assets/115237/412be2b3-d5a0-478a-b17b-43e6bc12e8ce">

<img width="83" alt="Screenshot 2024-03-28 at 22 14 34"
src="https://github.com/go-gitea/gitea/assets/115237/d8c89838-a420-4723-8c49-89405bb39474">

---------

Co-authored-by: delvh <dev.lh@web.de>
6 months agoRefactor topic Find functions and add more tests for pagination (#30127)
Lunny Xiao [Fri, 29 Mar 2024 03:38:16 +0000 (11:38 +0800)]
Refactor topic Find functions and add more tests for pagination (#30127)

This also fixed #22238

6 months agoreplace jquery-minicolors with coloris (#30055)
silverwind [Fri, 29 Mar 2024 03:00:07 +0000 (04:00 +0100)]
replace jquery-minicolors with coloris (#30055)

Get rid of one more jQuery dependant and have a nicer color picker as
well.

Now there is only a single global color picker init because that is all
that's necessary because the elements are present on the page when the
init code runs. The init is slightly weird because the module only takes
a selector instead of DOM elements directly.

The label modals now also perform form validation because previously it
was possible to trigger a 500 error `Color cannot be empty.` by clearing
out the color value on labels.

<img width="867" alt="Screenshot 2024-03-25 at 00 21 05"
src="https://github.com/go-gitea/gitea/assets/115237/71215c39-abb1-4881-b5c1-9954b4a89adb">
<img width="860" alt="Screenshot 2024-03-25 at 00 20 48"
src="https://github.com/go-gitea/gitea/assets/115237/a12cb68f-c38b-4433-ba05-53bbb4b1023e">