]> source.dussan.org Git - gitea.git/log
gitea.git
7 months agoAvoid user does not exist error when detecting schedule actions when the commit autho...
Giteabot [Thu, 11 Apr 2024 07:51:02 +0000 (15:51 +0800)]
Avoid user does not exist error when detecting schedule actions when the commit author is an external user  (#30357) (#30409)

Backport #30357 by @yp05327

![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.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoUpdate actions variables documents (#30394) (#30405)
Giteabot [Thu, 11 Apr 2024 04:03:13 +0000 (12:03 +0800)]
Update actions variables documents (#30394) (#30405)

Backport #30394 by @lunny

Fix #30393

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Zettat123 <zettat123@gmail.com>
7 months agoMinor color tweaks (#30397) (#30398)
Giteabot [Thu, 11 Apr 2024 02:14:28 +0000 (10:14 +0800)]
Minor color tweaks (#30397) (#30398)

Backport #30397 by @silverwind

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">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoVarious improvements for long file and commit names (#30374) (#30386)
Giteabot [Wed, 10 Apr 2024 06:56:21 +0000 (14:56 +0800)]
Various improvements for long file and commit names (#30374) (#30386)

Backport #30374 by @silverwind

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: silverwind <me@silverwind.io>
7 months agoFix line height on inline code preview (#30372) (#30385)
Giteabot [Wed, 10 Apr 2024 05:49:40 +0000 (13:49 +0800)]
Fix line height on inline code preview (#30372) (#30385)

Backport #30372 by @silverwind

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.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix label-list rendering in timeline, decrease gap (#30342) (#30380)
Giteabot [Wed, 10 Apr 2024 05:36:04 +0000 (13:36 +0800)]
Fix label-list rendering in timeline, decrease gap (#30342) (#30380)

Backport #30342 by @silverwind

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: silverwind <me@silverwind.io>
7 months agoFix ambiguous id when fetch Actions tasks (#30382) (#30383)
Giteabot [Wed, 10 Apr 2024 03:24:31 +0000 (11:24 +0800)]
Fix ambiguous id when fetch Actions tasks (#30382) (#30383)

Backport #30382 by @wolfogre

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"
```

I have tested it in my local env, and it should work now.

Co-authored-by: Jason Song <i@wolfogre.com>
7 months agoFix actions design about default actions download url (#30360) (#30371)
Giteabot [Wed, 10 Apr 2024 02:07:34 +0000 (10:07 +0800)]
Fix actions design about default actions download url (#30360) (#30371)

Backport #30360 by @lunny

Fix #30359

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoFix and rewrite contrast color calculation, fix project-related bugs (#30326)
silverwind [Tue, 9 Apr 2024 09:45:29 +0000 (11:45 +0200)]
Fix and rewrite contrast color calculation, fix project-related bugs (#30326)

Backport https://github.com/go-gitea/gitea/pull/30237 to 1.22. Also
includes https://github.com/go-gitea/gitea/pull/30183. Both were clean
cherry-picks.

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoPerformance optimization for git push (#30104) (#30348)
Giteabot [Tue, 9 Apr 2024 06:34:30 +0000 (14:34 +0800)]
Performance optimization for git push (#30104) (#30348)

Backport #30104 by @lunny

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`.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoReduce checkbox size to 15px (#30346) (#30347)
Giteabot [Tue, 9 Apr 2024 06:06:39 +0000 (14:06 +0800)]
Reduce checkbox size to 15px (#30346) (#30347)

Backport #30346 by @silverwind

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">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix missed doer (#30231) (#30343)
Giteabot [Mon, 8 Apr 2024 23:42:45 +0000 (07:42 +0800)]
Fix missed doer (#30231) (#30343)

Backport #30231 by @lunny

Fix #29879

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoAvoid running action when action unit is disabled after workflows detected (#30331...
Giteabot [Mon, 8 Apr 2024 14:34:44 +0000 (22:34 +0800)]
Avoid running action when action unit is disabled after workflows detected (#30331) (#30338)

Backport #30331 by @yp05327

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.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix create commit status (#30225)
Lunny Xiao [Mon, 8 Apr 2024 13:15:23 +0000 (21:15 +0800)]
Fix create commit status (#30225)

Partially backport #30223

This PR uses the service layer `CreateCommitstatus` method instead of
the git model method.

7 months agoAvoid showing `Failed to change the default wiki branch` if repo has no wiki when...
Giteabot [Mon, 8 Apr 2024 12:48:43 +0000 (20:48 +0800)]
Avoid showing `Failed to change the default wiki branch` if repo has no wiki when saving repo settings (#30329) (#30337)

Backport #30329 by @yp05327

If repo does not have wiki, we should return after save the default wiki
branch into DB.
Or you will always see `Failed to change the default wiki branch` error.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix oauth2 builtin application logic (#30304) (#30327)
Giteabot [Mon, 8 Apr 2024 07:46:21 +0000 (15:46 +0800)]
Fix oauth2 builtin application logic (#30304) (#30327)

Backport #30304 by wxiaoguang

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.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoAdd `--page-spacing` variable, fix admin dashboard notice (#30302) (#30323)
Giteabot [Mon, 8 Apr 2024 02:04:24 +0000 (10:04 +0800)]
Add `--page-spacing` variable, fix admin dashboard notice (#30302) (#30323)

Backport #30302 by @silverwind

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">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoSome NuGet package enhancements (#30280) (#30324)
Giteabot [Sun, 7 Apr 2024 17:13:36 +0000 (01:13 +0800)]
Some NuGet package enhancements (#30280) (#30324)

Backport #30280 by @KN4CK3R

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: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Benjamin Heemann <benjamin.heemann@raith.de>
7 months agoAction view mobile improvements and fixes (#30309) (#30320)
Giteabot [Sun, 7 Apr 2024 15:22:47 +0000 (23:22 +0800)]
Action view mobile improvements and fixes (#30309) (#30320)

Backport #30309 by @silverwind

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">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix checkboxes on mobile view, remove some dead css (#30308) (#30319)
Giteabot [Sun, 7 Apr 2024 13:10:40 +0000 (21:10 +0800)]
Fix checkboxes on mobile view, remove some dead css (#30308) (#30319)

Backport #30308 by @silverwind

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: silverwind <me@silverwind.io>
7 months agoClean up log messages (#30313) (#30318)
Giteabot [Sun, 7 Apr 2024 11:44:09 +0000 (19:44 +0800)]
Clean up log messages (#30313) (#30318)

Backport #30313 by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor startup deprecation messages (#30305) (#30312)
Giteabot [Sun, 7 Apr 2024 01:43:54 +0000 (09:43 +0800)]
Refactor startup deprecation messages (#30305) (#30312)

Backport #30305 by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoMarkup color and font size fixes (#30282) (#30310)
Giteabot [Sat, 6 Apr 2024 21:48:41 +0000 (05:48 +0800)]
Markup color and font size fixes (#30282) (#30310)

Backport #30282 by @silverwind

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">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoAlways use `octicon-eye` on watch button (#30288) (#30307)
Giteabot [Sat, 6 Apr 2024 15:42:11 +0000 (23:42 +0800)]
Always use `octicon-eye` on watch button (#30288) (#30307)

Backport #30288 by @silverwind

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">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix code block style for code preview (#30298) (#30306)
Giteabot [Sat, 6 Apr 2024 12:34:38 +0000 (20:34 +0800)]
Fix code block style for code preview (#30298) (#30306)

Backport #30298 by wxiaoguang

Fix #30292

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix view commit link (#30297) (#30299)
wxiaoguang [Fri, 5 Apr 2024 21:38:26 +0000 (05:38 +0800)]
Fix view commit link (#30297) (#30299)

Backport #30297

7 months agoAdd gap to commit status details (#30284) (#30290)
Giteabot [Fri, 5 Apr 2024 14:44:03 +0000 (22:44 +0800)]
Add gap to commit status details (#30284) (#30290)

Backport #30284 by @silverwind

Co-authored-by: silverwind <me@silverwind.io>
7 months agoUpgrade `golang.org/x/net` to v0.24.0 (#30283) (#30286)
Giteabot [Fri, 5 Apr 2024 03:31:04 +0000 (11:31 +0800)]
Upgrade `golang.org/x/net` to v0.24.0 (#30283) (#30286)

Backport #30283 by @silverwind

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
```

Co-authored-by: silverwind <me@silverwind.io>
7 months agoCommit-Dropdown: Show Author of commit if available (#30272) (#30285)
Giteabot [Fri, 5 Apr 2024 02:00:20 +0000 (10:00 +0800)]
Commit-Dropdown: Show Author of commit if available (#30272) (#30285)

Backport #30272 by @sebastian-sauer

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

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
7 months agoupdate mailer example config, remove deprecated HOST (#30267) (#30274)
Giteabot [Wed, 3 Apr 2024 23:18:43 +0000 (07:18 +0800)]
update mailer example config, remove deprecated HOST (#30267) (#30274)

7 months agoClose file in the Upload func (#30262) (#30270)
Giteabot [Wed, 3 Apr 2024 15:29:49 +0000 (23:29 +0800)]
Close file in the Upload func (#30262) (#30270)

Co-authored-by: guangwu <guoguangwu@magic-shield.com>
7 months agoFixes #27605: inline math blocks can't be preceeded/followed by alphanumerical charac...
Giteabot [Wed, 3 Apr 2024 06:17:02 +0000 (14:17 +0800)]
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30251)

Backport #30175 by @jmlt2002

- 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: João Tiago <114936010+jmlt2002@users.noreply.github.com>
7 months agoAdd -u git to docs when using docker exec with root installation (#29314) (#30259)
Giteabot [Wed, 3 Apr 2024 05:44:26 +0000 (13:44 +0800)]
Add -u git to docs when using docker exec with root installation (#29314) (#30259)

Backport #29314 by @scribblemaniac

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.

Co-authored-by: scribblemaniac <scribblemaniac@users.noreply.github.com>
7 months agoShow 12 lines in markup code preview (#30255) (#30257)
Giteabot [Wed, 3 Apr 2024 03:51:34 +0000 (11:51 +0800)]
Show 12 lines in markup code preview (#30255) (#30257)

Backport #30255 by @silverwind

Show up to 12 lines instead of previous 5.

<img width="929" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/de68f200-b9e2-4a25-bd6e-c46849849620">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoRefactor "dump" sub-command (#30240) (#30260)
Giteabot [Wed, 3 Apr 2024 02:47:06 +0000 (10:47 +0800)]
Refactor "dump" sub-command (#30240) (#30260)

Backport #30240 by wxiaoguang

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: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRender embedded code preview by permlink in markdown (#30234) (#30249)
Giteabot [Tue, 2 Apr 2024 18:20:16 +0000 (02:20 +0800)]
Render embedded code preview by permlink in markdown (#30234) (#30249)

Backport #30234 by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix missing 0 prefix of GPG key id (#30245) (#30248)
Giteabot [Tue, 2 Apr 2024 16:23:52 +0000 (00:23 +0800)]
Fix missing 0 prefix of GPG key id (#30245) (#30248)

Backport #30245 by @KN4CK3R

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.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoFix spacing in issue navbar (#30238) (#30242)
Giteabot [Tue, 2 Apr 2024 12:15:50 +0000 (20:15 +0800)]
Fix spacing in issue navbar (#30238) (#30242)

Backport #30238 by @silverwind

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
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRefactor dropzone (#30232) (#30233)
Giteabot [Mon, 1 Apr 2024 19:05:05 +0000 (03:05 +0800)]
Refactor dropzone (#30232) (#30233)

Backport #30232 by wxiaoguang

Simplify code and use `.files` elements

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove scheduled action tasks if the repo is archived (#30224) (#30230)
Giteabot [Mon, 1 Apr 2024 17:43:09 +0000 (01:43 +0800)]
Remove scheduled action tasks if the repo is archived (#30224) (#30230)

Backport #30224 by @Zettat123

Fix #30220

Co-authored-by: Zettat123 <zettat123@gmail.com>
7 months agoRefactor file view & render (#30227) (#30229)
Giteabot [Mon, 1 Apr 2024 13:39:36 +0000 (21:39 +0800)]
Refactor file view & render (#30227) (#30229)

Backport #30227 by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoPrevent flash of dropdown menu on labels list (#30215) (#30216)
Giteabot [Mon, 1 Apr 2024 06:16:55 +0000 (14:16 +0800)]
Prevent flash of dropdown menu on labels list (#30215) (#30216)

Backport #30215 by @silverwind

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: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor DeleteInactiveUsers, fix bug and add tests (#30206) (#30222)
Giteabot [Mon, 1 Apr 2024 04:58:46 +0000 (12:58 +0800)]
Refactor DeleteInactiveUsers, fix bug and add tests (#30206) (#30222)

Backport #30206 by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix home topic edit form layout (#30213)
wxiaoguang [Sun, 31 Mar 2024 13:19:12 +0000 (21:19 +0800)]
Fix home topic edit form layout (#30213)

The UI has been refactored by #30191 , so here are 2 choices:

1. Backport #30191
2. Apply this quick fix

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/0db583cf-8ce8-4fdb-9e4d-8c93fe6766c7)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/0e732c4c-d28d-4c04-b328-72b9efd7daa9)

</details>

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoFix markdown color code detection (#30208) (#30211)
Giteabot [Sun, 31 Mar 2024 12:25:15 +0000 (20:25 +0800)]
Fix markdown color code detection (#30208) (#30211)

Backport #30208 by wxiaoguang

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.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove `modifies/frontend` from labeler (#30198) (#30212)
Giteabot [Sun, 31 Mar 2024 11:37:01 +0000 (19:37 +0800)]
Remove `modifies/frontend` from labeler (#30198) (#30212)

Backport #30198 by @silverwind

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: silverwind <me@silverwind.io>
7 months agoFix GPG subkey verify (#30193) (#30203)
Giteabot [Sun, 31 Mar 2024 06:48:33 +0000 (14:48 +0800)]
Fix GPG subkey verify (#30193) (#30203)

Backport #30193 by @KN4CK3R

Fixes #30189

Can't verify subkeys if they are not loaded.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoDo not allow different storage configurations to point to the same directory (#30169...
Giteabot [Sun, 31 Mar 2024 03:29:51 +0000 (11:29 +0800)]
Do not allow different storage configurations to point to the same directory (#30169) (#30204)

Backport #30169 by wxiaoguang

Replace #29171

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix unclickable checkboxes (#30195) (#30199)
Giteabot [Sun, 31 Mar 2024 00:05:52 +0000 (08:05 +0800)]
Fix unclickable checkboxes (#30195) (#30199)

Backport #30195 by @silverwind

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.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoInclude encoding in signature payload (#30174) (#30182)
Giteabot [Fri, 29 Mar 2024 23:03:11 +0000 (07:03 +0800)]
Include encoding in signature payload (#30174) (#30182)

Backport #30174 by @KN4CK3R

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)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoRemove fomantic checkbox module (#30162) (#30168)
Giteabot [Fri, 29 Mar 2024 17:44:22 +0000 (01:44 +0800)]
Remove fomantic checkbox module (#30162) (#30168)

Backport #30162 by @silverwind

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: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
7 months agoFix:the rounded corners of the folded file are not displayed correctly (#29953) ...
Giteabot [Fri, 29 Mar 2024 17:16:40 +0000 (01:16 +0800)]
Fix:the rounded corners of the folded file are not displayed correctly (#29953) (#30177)

Backport #29953 by @HEREYUA

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: HEREYUA <37935145+HEREYUA@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRefactor topic Find functions and add more tests for pagination (#30127) (#30167)
Giteabot [Fri, 29 Mar 2024 17:09:40 +0000 (01:09 +0800)]
Refactor topic Find functions and add more tests for pagination (#30127) (#30167)

Backport #30127 by @lunny

This also fixed #22238

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoFix migration v292 (#30153) v1.22.0-rc0
Lunny Xiao [Thu, 28 Mar 2024 16:14:30 +0000 (00:14 +0800)]
Fix migration v292 (#30153)

Fix https://github.com/go-gitea/gitea/pull/29874#discussion_r1542227686

- The migration of v292 will miss many projects. These projects will
have no default board. This PR introduced a new migration number and
removed v292 migration.

- This PR also added the missed transactions on project-related
operations.

- Only `SetDefaultBoard` will remove duplicated defaults but not in
`GetDefaultBoard`

7 months agoAdjust VS Code debug filename match in .gitignore (#30158)
Paweł Bogusławski [Thu, 28 Mar 2024 15:24:30 +0000 (16:24 +0100)]
Adjust VS Code debug filename match in .gitignore (#30158)

7 months agoPrevent re-review and dismiss review actions on closed and merged PRs (#30065)
Kemal Zebari [Thu, 28 Mar 2024 15:19:24 +0000 (08:19 -0700)]
Prevent re-review and dismiss review actions on closed and merged PRs (#30065)

Resolves #29965.

---
Manually tested this by:
- Following the
[installation](https://docs.gitea.com/next/installation/install-with-docker#basics)
guide (but built a local Docker image instead)
- Creating 2 users, one who is the `Owner` of a newly-created repository
and the other a `Collaborator`
- Had the `Collaborator` create a PR that the `Owner` reviews
- `Collaborator` resolves conversation and `Owner` merges PR

And with this change we see that we can no longer see re-request review
button for the `Owner`:

<img width="1351" alt="Screenshot 2024-03-25 at 12 39 18 AM"
src="https://github.com/go-gitea/gitea/assets/60799661/bcd9c579-3cf7-474f-a51e-b436fe1a39a4">

7 months agoRender code tags in commit messages (#30146)
silverwind [Thu, 28 Mar 2024 10:42:31 +0000 (11:42 +0100)]
Render code tags in commit messages (#30146)

Extend https://github.com/go-gitea/gitea/pull/21432 to commit messages.
Color is changed because the markup code block bg does not offer enough
contrast on varying backgrounds.

<img width="568" alt="Screenshot 2024-03-27 at 19 52 55"
src="https://github.com/go-gitea/gitea/assets/115237/ddc9307e-f32f-4e97-8b88-91f88ced2a36">
<img width="573" alt="Screenshot 2024-03-27 at 19 53 33"
src="https://github.com/go-gitea/gitea/assets/115237/14b30fd2-bf28-46b8-9e82-eb60a28f6bf2">
<img width="422" alt="Screenshot 2024-03-27 at 19 53 01"
src="https://github.com/go-gitea/gitea/assets/115237/a12136b5-c02b-460c-9830-f830542987ae">
<img width="397" alt="Screenshot 2024-03-27 at 19 53 27"
src="https://github.com/go-gitea/gitea/assets/115237/c9f05d81-c73e-468e-98e9-e5929bc0da3e">
<img width="333" alt="Screenshot 2024-03-27 at 19 53 07"
src="https://github.com/go-gitea/gitea/assets/115237/06b5a9f9-f95d-46b6-8c57-df0b02555652">
<img width="279" alt="Screenshot 2024-03-27 at 19 53 21"
src="https://github.com/go-gitea/gitea/assets/115237/b06a0afc-ddd8-48ae-b557-a6dc47802e68">

7 months agoBump `@github/relative-time-element` to v4.4.0 (#30154)
Yarden Shoham [Thu, 28 Mar 2024 09:42:08 +0000 (11:42 +0200)]
Bump `@github/relative-time-element` to v4.4.0 (#30154)

I tested and all timestamps work as before.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoMigrate font-family to tailwind (#30118)
silverwind [Thu, 28 Mar 2024 08:31:07 +0000 (09:31 +0100)]
Migrate font-family to tailwind (#30118)

Enable us to use tailwind's
[`font-family`](https://tailwindcss.com/docs/font-family) classes as
well as remove `gt-mono` in favor of `tw-font-mono`. I also merged the
"compensation" to one selector, previously this was two different values
0.9em and 0.95em. I did not declare a `serif` font because I don't think
there will ever be a use case for those. Command ran:

```sh
perl -p -i -e 's#gt-mono#tw-font-mono#g' web_src/js/**/* templates/**/*

7 months agoMove from `max( id )` to `max( index )` for latest commit statuses (#30076)
YR Chen [Thu, 28 Mar 2024 08:01:15 +0000 (16:01 +0800)]
Move from `max( id )` to `max( index )` for latest commit statuses (#30076)

This PR replaces the use of `max( id )`, and instead using ``max(
`index` )`` for determining the latest commit status. Building business
logic over an `auto_increment` primary key like `id` is risky and
there’re already plenty of discussions on the Internet.

There‘s no guarantee for `auto_increment` values to be monotonic,
especially upon failures or with a cluster. In the specific case, we met
the problem of commit statuses being outdated when using TiDB as the
database. As [being
documented](https://docs.pingcap.com/tidb/stable/auto-increment),
`auto_increment` values assigned to an `insert` statement will only be
monotonic on a per server (node) basis.

Closes #30074.

7 months agoRemember login for a month by default (#30150)
delvh [Thu, 28 Mar 2024 03:13:42 +0000 (04:13 +0100)]
Remember login for a month by default (#30150)

Previously, the default was a week.
As most instances don't set the setting, this leads to a bad user
experience by default.

## :warning: Breaking

If your instance requires a high level of security,
you may want to set `[security].LOGIN_REMEMBER_DAYS` so that logins are
not valid as long.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
7 months agoApply to become a maintainer (#30151)
HEREYUA [Thu, 28 Mar 2024 02:47:05 +0000 (10:47 +0800)]
Apply to become a maintainer (#30151)

PRs:https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3AHEREYUA+is%3Aclosed

Discord: hereyua

7 months agoRefactor markdown render (#30139)
wxiaoguang [Thu, 28 Mar 2024 02:26:13 +0000 (10:26 +0800)]
Refactor markdown render (#30139)

Only split the file into small ones (and rename AttentionTypes to
attentionTypes)

7 months agoDrag-and-drop improvements for projects and issue pins (#29875)
silverwind [Wed, 27 Mar 2024 23:20:38 +0000 (00:20 +0100)]
Drag-and-drop improvements for projects and issue pins (#29875)

1. Add "grabbing" cursor while dragging items:

![](https://github.com/go-gitea/gitea/assets/115237/c60845ff-7544-4215-aeaa-408e8c4ef03a)

2. Make project board only drag via their header, not via their whole
body.

![](https://github.com/go-gitea/gitea/assets/115237/62c27f3d-993a-481d-9cc3-b6226b4c5d61)

3. Fix some cursor problems in projects
4. Move shared options into `createSortable`.

7 months agoFix table alignment classes (#30144)
silverwind [Wed, 27 Mar 2024 21:47:40 +0000 (22:47 +0100)]
Fix table alignment classes (#30144)

Fixes https://github.com/go-gitea/gitea/issues/30142, regression from
https://github.com/go-gitea/gitea/pull/30047. I searched the codebase
and only `bottom aligned` was definitely not in use so I removed it.

7 months agoAdd default board to new projects, remove uncategorized pseudo-board (#29874)
Denys Konovalov [Wed, 27 Mar 2024 20:54:32 +0000 (21:54 +0100)]
Add default board to new projects, remove uncategorized pseudo-board (#29874)

On creation of an empty project (no template) a default board will be
created instead of falling back to the uneditable pseudo-board.

Every project now has to have exactly one default boards. As a
consequence, you cannot unset a board as default, instead you have to
set another board as default. Existing projects will be modified using a
cron job, additionally this check will run every midnight by default.

Deleting the default board is not allowed, you have to set another board
as default to do it.

Fixes #29873
Fixes #14679 along the way
Fixes #29853

Co-authored-by: delvh <dev.lh@web.de>
7 months agoFix loading spinner on ContextPopup (#30145)
silverwind [Wed, 27 Mar 2024 20:18:04 +0000 (21:18 +0100)]
Fix loading spinner on ContextPopup (#30145)

Fix regression from https://github.com/go-gitea/gitea/pull/26670. Here
with simulated delay:

![](https://github.com/go-gitea/gitea/assets/115237/9de5a136-c8a6-4d69-adc7-07e1184e3311)

7 months agoFix download buttons on branches page (#30147)
silverwind [Wed, 27 Mar 2024 20:05:49 +0000 (21:05 +0100)]
Fix download buttons on branches page (#30147)

Fixes https://github.com/go-gitea/gitea/issues/30143, regression from
https://github.com/go-gitea/gitea/pull/29920.

We have `.button` on the repo page, but on the branch page it's a
`.btn`. Eventually we should find a solution to have a single button
class but until then this solution should be acceptable.

7 months agoRelax generic package filename restrictions (#30135)
wxiaoguang [Wed, 27 Mar 2024 16:55:05 +0000 (00:55 +0800)]
Relax generic package filename restrictions (#30135)

Now, the chars `=:;()[]{}~!@#$%^ &` are possible as well
Fixes #30134

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoRemove jQuery class from the common admin functions (#30137)
Yarden Shoham [Wed, 27 Mar 2024 16:14:18 +0000 (18:14 +0200)]
Remove jQuery class from the common admin functions (#30137)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the new authentication source form and the deletion of system
notices. They work as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove jQuery class from the reaction selector (#30138)
Yarden Shoham [Wed, 27 Mar 2024 16:09:34 +0000 (18:09 +0200)]
Remove jQuery class from the reaction selector (#30138)

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

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoForbid jQuery `.attr` (#30116)
Yarden Shoham [Wed, 27 Mar 2024 13:49:54 +0000 (15:49 +0200)]
Forbid jQuery `.attr` (#30116)

Use `.getAttribute`, `.setAttribute`, or `.removeAttribute` instead

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoRefactor render (#30136)
wxiaoguang [Wed, 27 Mar 2024 13:14:34 +0000 (21:14 +0800)]
Refactor render (#30136)

7 months agoFix: Organization Interface Display Issue (#30133)
HEREYUA [Wed, 27 Mar 2024 12:48:09 +0000 (20:48 +0800)]
Fix: Organization Interface Display Issue (#30133)

**Before**

![image](https://github.com/go-gitea/gitea/assets/37935145/88d04a4b-6dc5-4399-9813-2c339eae3722)

**After**

![image](https://github.com/go-gitea/gitea/assets/37935145/e97a64b8-ea24-4de7-992d-5928888872d0)

7 months agoRemove jQuery `.attr` from the Fomantic dropdowns (#30114)
Yarden Shoham [Wed, 27 Mar 2024 10:50:07 +0000 (12:50 +0200)]
Remove jQuery `.attr` from the Fomantic dropdowns (#30114)

- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the dropdowns and they work as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove jQuery `.attr` from the common admin functions (#30115)
Yarden Shoham [Wed, 27 Mar 2024 10:45:05 +0000 (12:45 +0200)]
Remove jQuery `.attr` from the common admin functions (#30115)

- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested most of the functions and they work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove jQuery from the create/rename branch modals (except Fomantic) (#30109)
Yarden Shoham [Wed, 27 Mar 2024 10:40:21 +0000 (12:40 +0200)]
Remove jQuery from the create/rename branch modals (except Fomantic) (#30109)

- Switched to plain JavaScript
- Tested the create/rename branch modals' functionality and they work as
before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/ca53155e-856e-44ca-9852-12ff60065735)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove fomantic label module (#30081)
silverwind [Wed, 27 Mar 2024 09:58:02 +0000 (10:58 +0100)]
Remove fomantic label module (#30081)

Of note is the CSS has references to "floating label" and "transparent
label" but I could not find those anywhere in the code. They are related
to https://github.com/go-gitea/gitea/pull/3939, but I think these have
long been removed.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoFix bug for markdown rendering of blockquote (#30130)
Lunny Xiao [Wed, 27 Mar 2024 09:09:25 +0000 (17:09 +0800)]
Fix bug for markdown rendering of blockquote (#30130)

Caused by #29984

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix: The interface is broken when modifying code comments under mobile devices ...
HEREYUA [Wed, 27 Mar 2024 08:13:12 +0000 (16:13 +0800)]
Fix: The interface is broken when modifying  code comments under mobile devices  (#30125)

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

**Before**

![image](https://github.com/go-gitea/gitea/assets/37935145/2a186399-85b0-480a-b2f9-f4feffd9a8e2)

**After**

![image](https://github.com/go-gitea/gitea/assets/37935145/ce1ce3e4-3bbb-4a4b-b0e7-e7943a0774f2)

7 months agoWhen the title in the issue has a value, set the text cursor at the end of the text...
HEREYUA [Wed, 27 Mar 2024 07:20:10 +0000 (15:20 +0800)]
When the title in the issue has a value, set the text cursor at the end of the text. (#30090)

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

Before

![image](https://github.com/go-gitea/gitea/assets/37935145/1b89cd7b-4fa3-49aa-9b5e-a8413add436e)

After

![image](https://github.com/go-gitea/gitea/assets/37935145/fa808f8d-d3ce-4245-a4fe-dd0282ba3fdf)

ps: I've noticed that we are gradually replacing jQuery, so I didn't use jQuery here.

7 months agoLoad attachments for code comments (#30124)
yp05327 [Wed, 27 Mar 2024 04:44:26 +0000 (13:44 +0900)]
Load attachments for code comments (#30124)

Fix #30103

ps: comments has `LoadAttributes`, but maybe considering performance
problem, we don't call it.

7 months agoUpgrade fabric to 6.0.0-beta20 (#30121)
silverwind [Wed, 27 Mar 2024 04:17:14 +0000 (05:17 +0100)]
Upgrade fabric to 6.0.0-beta20 (#30121)

Fixes https://github.com/go-gitea/gitea/issues/29326 because it includes
https://github.com/fabricjs/fabric.js/pull/9707.

7 months agoFix click handler in job-step-summary (#30122)
silverwind [Wed, 27 Mar 2024 03:50:24 +0000 (04:50 +0100)]
Fix click handler in job-step-summary (#30122)

Fix mistake from https://github.com/go-gitea/gitea/pull/29977 where the
click handler wasn't updated for the change with the `isExpandable`
function.

7 months agoPut an edit file button on pull request files to allow a quick operation (#29697)
Lunny Xiao [Wed, 27 Mar 2024 02:34:10 +0000 (10:34 +0800)]
Put an edit file button on pull request files to allow a quick operation (#29697)

Resolve #23848

This PR put an edit file button on pull request files to allow a quick
edit for a file. After the edit finished, it will return back to the
viewed file position on pull request files tab.

It also use a branch view file link instead of commit link when it's a
non-commit pull request files view.

<img width="1532" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/3637ca4c-89d5-4621-847b-79702a44f617">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRemove jQuery `.attr` from the Fomantic modal cancel buttons (#30113)
Yarden Shoham [Tue, 26 Mar 2024 19:57:57 +0000 (21:57 +0200)]
Remove jQuery `.attr` from the Fomantic modal cancel buttons (#30113)

- Switched from jQuery `attr` to plain javascript `setAttribute`
- Tested the modals and they work as before

---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoRemove jQuery `.attr` from the code comments (#30112)
Yarden Shoham [Tue, 26 Mar 2024 19:49:38 +0000 (21:49 +0200)]
Remove jQuery `.attr` from the code comments (#30112)

- Switched from jQuery `attr` to plain javascript `getAttribute`
- Tested the code comments and they work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove jQuery calls that have no effect on `showElem` and `hideElem` (#30110)
Yarden Shoham [Tue, 26 Mar 2024 19:38:37 +0000 (21:38 +0200)]
Remove jQuery calls that have no effect on `showElem` and `hideElem` (#30110)

There's no need to initialize a jQuery object with a CSS selector when
we can pass the CSS selector directly.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoRemove jQuery `.attr` from the common issue page functions (#30083)
Yarden Shoham [Tue, 26 Mar 2024 19:33:32 +0000 (21:33 +0200)]
Remove jQuery `.attr` from the common issue page functions (#30083)

- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested most of the functions and they work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
7 months agoRestore aligned grid column CSS (#30106)
silverwind [Tue, 26 Mar 2024 15:37:14 +0000 (16:37 +0100)]
Restore aligned grid column CSS (#30106)

Fixes #30097, regression from #29894.

7 months agoFix possible data race on tests (#30093)
Lunny Xiao [Tue, 26 Mar 2024 14:08:30 +0000 (22:08 +0800)]
Fix possible data race on tests (#30093)

7 months agoAdd svg linter and fix incorrect svgs (#30086)
silverwind [Tue, 26 Mar 2024 11:19:15 +0000 (12:19 +0100)]
Add svg linter and fix incorrect svgs (#30086)

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

Adds a new linter that searches for non-existant SVG images in
templates. Output before the fix was:

```
$ make lint-templates
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-markup" not found, used in templates/repo/diff/comment_form.tmpl
make: *** [Makefile:438: lint-templates] Error 1
```

<img width="306" alt="Screenshot 2024-03-25 at 23 31 05"
src="https://github.com/go-gitea/gitea/assets/115237/1052d1a9-bfec-4d5a-9cae-f895f78f7c93">

7 months agoFix duplicate migrated milestones (#30102)
yp05327 [Tue, 26 Mar 2024 10:20:26 +0000 (19:20 +0900)]
Fix duplicate migrated milestones (#30102)

Fix #17567

7 months agoUpdate JS any PY dependencies, remove workarounds (#30085)
silverwind [Tue, 26 Mar 2024 09:41:40 +0000 (10:41 +0100)]
Update JS any PY dependencies, remove workarounds (#30085)

- Update dependencies via `make update-js update-py svg`
- Remove `postcss` workaround -
https://github.com/postcss/postcss/issues/1914
- Remove `happy-dom` workaround -
https://github.com/capricorn86/happy-dom/pull/1365.
- Tested Katex and Asciinema

7 months agoFix gitea doctor will remove repo-avatar files when execute command `storage-archives...
yp05327 [Tue, 26 Mar 2024 08:24:13 +0000 (17:24 +0900)]
Fix gitea doctor will remove repo-avatar files when execute command `storage-archives` (#30094)

Fix #30037

7 months agoFix alignment in actions right view (#29979)
silverwind [Tue, 26 Mar 2024 07:56:44 +0000 (08:56 +0100)]
Fix alignment in actions right view (#29979)

Fixes: https://github.com/go-gitea/gitea/issues/29974, Regression from
https://github.com/go-gitea/gitea/pull/29640.

Depending on the number of steps on the left side, the right side will
vertically expand. Collapse it with `align-self`.

<img width="1308" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9bcede9c-d869-4f3f-8a10-026c74c03f71">

7 months agoRemove repetitive words (#30091)
crazeteam [Tue, 26 Mar 2024 07:48:53 +0000 (15:48 +0800)]
Remove repetitive words (#30091)

remove repetitive words

Signed-off-by: crazeteam <lilujing@outlook.com>
7 months agoFix table header text-align (#30084)
silverwind [Tue, 26 Mar 2024 06:50:04 +0000 (07:50 +0100)]
Fix table header text-align (#30084)

Fix regression from https://github.com/go-gitea/gitea/pull/30047.
Apparently tables have certain user-agent styles that center inside
`<th>` etc. Restored the original fomantic rules for these.

Before:
<img width="1332" alt="Screenshot 2024-03-25 at 21 59 33"
src="https://github.com/go-gitea/gitea/assets/115237/e06a5509-b505-4752-9b6e-91d5ed49f61d">

After:
<img width="1330" alt="Screenshot 2024-03-25 at 21 59 40"
src="https://github.com/go-gitea/gitea/assets/115237/6444817f-dd61-4a1e-a8b3-959c2780148d">

7 months agoFix panic for `fixBrokenRepoUnits16961` (#30068)
yp05327 [Tue, 26 Mar 2024 06:45:11 +0000 (15:45 +0900)]
Fix panic for `fixBrokenRepoUnits16961` (#30068)

![image](https://github.com/go-gitea/gitea/assets/18380374/508b3ceb-f53d-4d3b-a781-97c1542af1cb)

7 months agoEnable eslint `space-before-function-paren` (#30078)
silverwind [Mon, 25 Mar 2024 23:14:17 +0000 (00:14 +0100)]
Enable eslint `space-before-function-paren` (#30078)

Anonymous are set to ignore as I [couldn't
decide](https://github.com/go-gitea/gitea/pull/30077#discussion_r1538117497).
No current violations.

Rule docs: https://eslint.style/rules/js/space-before-function-paren