]> source.dussan.org Git - gitea.git/log
gitea.git
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

7 months agoRemove jQuery `.attr` from the code line range selection (#30077)
Yarden Shoham [Mon, 25 Mar 2024 23:03:12 +0000 (01:03 +0200)]
Remove jQuery `.attr` from the code line range selection (#30077)

- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the code line range selection and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoAdd muted class to author name in repo commit list (#29989)
yp05327 [Mon, 25 Mar 2024 20:18:58 +0000 (05:18 +0900)]
Add muted class to author name in repo commit list (#29989)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/f6b3728c-ed9a-4e47-8755-89373235dff2)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/272c85e3-620d-4758-ae4d-ad90b54e142c)

If repo is a mirror, external user's name will be white, but if user is
existed, then you will see blue names and white names together:

![image](https://github.com/go-gitea/gitea/assets/18380374/747622da-56e3-4162-b391-919787a8cee4)

---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoRefactor all `.length === 0` patterns in JS (#30045)
silverwind [Mon, 25 Mar 2024 18:37:55 +0000 (19:37 +0100)]
Refactor all `.length === 0` patterns in JS (#30045)

This pattern comes of often during review, so let's fix it once and for
all. Did not test, but changes are trivial enough imho.

7 months agoRemove fomantic table module (#30047)
silverwind [Mon, 25 Mar 2024 15:40:50 +0000 (16:40 +0100)]
Remove fomantic table module (#30047)

Big CSS module. I tested basic functionality on admin and commits table.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoFix menu buttons in issues and release (#30056)
silverwind [Mon, 25 Mar 2024 13:52:54 +0000 (14:52 +0100)]
Fix menu buttons in issues and release (#30056)

Fix regression from https://github.com/go-gitea/gitea/pull/30033

These buttons had lost their border because `.ui.header` sets `none` but
`.ui.menu` has it, after the migration, the order of styles changed and
header won. I see no reason why those have the `header` class in first
place, besides for semantic meaning.

Before:
<img width="491" alt="Screenshot 2024-03-25 at 00 39 27"
src="https://github.com/go-gitea/gitea/assets/115237/fa1b7505-75cf-4854-a97f-db3c46f31e93">

After:
<img width="496" alt="Screenshot 2024-03-25 at 00 39 14"
src="https://github.com/go-gitea/gitea/assets/115237/8f6bdc07-9596-436b-8c82-9af283300004">

7 months agoFix git grep search limit, add test (#30071)
wxiaoguang [Mon, 25 Mar 2024 13:25:22 +0000 (21:25 +0800)]
Fix git grep search limit, add test (#30071)

Fix #30069

7 months agoFix button hover border (#30048)
silverwind [Mon, 25 Mar 2024 10:14:43 +0000 (11:14 +0100)]
Fix button hover border (#30048)

Fix regression from https://github.com/go-gitea/gitea/pull/30014. The
rule was to broad and affecting things like `primary` button
unintentionally.

7 months agoFix Add/Remove WIP on pull request title failure (#29999)
Lunny Xiao [Mon, 25 Mar 2024 07:51:23 +0000 (15:51 +0800)]
Fix Add/Remove WIP on pull request title failure (#29999)

Fix #29997

7 months agoFix misuse of `TxContext` (#30061)
Jason Song [Mon, 25 Mar 2024 07:00:16 +0000 (15:00 +0800)]
Fix misuse of `TxContext` (#30061)

Help #29999, or its tests cannot pass.

Also, add some comments to clarify the usage of `TxContext`.

I don't check all usages of `TxContext` because there are too many
(almost 140+). It's a better idea to replace them with `WithTx` instead
of checking them one by one. However, that may be another refactoring
PR.

7 months agoRemove jQuery `.attr` from the reaction selector (#30052)
Yarden Shoham [Mon, 25 Mar 2024 04:30:38 +0000 (06:30 +0200)]
Remove jQuery `.attr` from the reaction selector (#30052)

- Switched from jQuery `attr` to plain javascript `getAttribute`
- Tested the reaction selector and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoRemove jQuery `.attr` from the ComboMarkdownEditor (#30051)
Yarden Shoham [Mon, 25 Mar 2024 00:00:54 +0000 (02:00 +0200)]
Remove jQuery `.attr` from the ComboMarkdownEditor (#30051)

- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the markdown editor and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoRemove jQuery `.attr` from the label edit exclusive checkbox (#30053)
Yarden Shoham [Sun, 24 Mar 2024 23:50:39 +0000 (01:50 +0200)]
Remove jQuery `.attr` from the label edit exclusive checkbox (#30053)

- Switched from jQuery `attr` to plain javascript `getAttribute`
- Tested the label edit exclusive checkbox and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoRemove jQuery `.attr` from the repository topic bar (#30050)
Yarden Shoham [Sun, 24 Mar 2024 23:44:05 +0000 (01:44 +0200)]
Remove jQuery `.attr` from the repository topic bar (#30050)

- Switched from jQuery `.attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the repository topic bar. It works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoUse db.ListOptions directly instead of Paginator interface to make it easier to use...
Lunny Xiao [Sun, 24 Mar 2024 18:51:08 +0000 (02:51 +0800)]
Use db.ListOptions directly instead of Paginator interface to make it easier to use and fix performance of /pulls and /issues (#29990)

This PR uses `db.ListOptions` instead of `Paginor` to make the code
simpler.
And it also fixed the performance problem when viewing /pulls or
/issues. Before the counting in fact will also do the search.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: silverwind <me@silverwind.io>
8 months agoMigrate `gt-hidden` to `tw-hidden` (#30046)
silverwind [Sun, 24 Mar 2024 18:23:38 +0000 (19:23 +0100)]
Migrate `gt-hidden` to `tw-hidden` (#30046)

We have to define this one in helpers.css because tailwind only
generates a single class but certain things rely on this being
double-class. Command ran:

```sh
perl -p -i -e 's#gt-hidden#tw-hidden#g' web_src/js/**/* templates/**/* models/**/* web_src/css/**/*

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoForbid jQuery `is` and fix issues (#30016)
silverwind [Sun, 24 Mar 2024 17:56:02 +0000 (18:56 +0100)]
Forbid jQuery `is` and fix issues (#30016)

Tested all functionality.

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
8 months agoRemove fomantic segment module (#30042)
silverwind [Sun, 24 Mar 2024 16:48:06 +0000 (17:48 +0100)]
Remove fomantic segment module (#30042)

Another CSS-only module. Also, I re-ordered the imports based on
[original fomantic
order](https://github.com/fomantic/Fomantic-UI/blob/2.8.7/src/semantic.less).

8 months agoMigrate margin and padding helpers to tailwind (#30043)
silverwind [Sun, 24 Mar 2024 16:42:49 +0000 (17:42 +0100)]
Migrate margin and padding helpers to tailwind (#30043)

This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:

```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g'   {web_src/js,templates,routers,services}/**/*
```

8 months agoSupport repo code search without setting up an indexer (#29998)
wxiaoguang [Sun, 24 Mar 2024 16:05:00 +0000 (00:05 +0800)]
Support repo code search without setting up an indexer (#29998)

By using git's ability, end users (especially small instance users) do
not need to enable the indexer, they could also benefit from the code
searching feature.

Fix #29996

![image](https://github.com/go-gitea/gitea/assets/2114189/11b7e458-88a4-480d-b4d7-72ee59406dd1)

![image](https://github.com/go-gitea/gitea/assets/2114189/0fe777d5-c95c-4288-a818-0427680805b6)

---------

Co-authored-by: silverwind <me@silverwind.io>
8 months agoMigrate `gap` helpers to tailwind (#30034)
silverwind [Sun, 24 Mar 2024 14:31:35 +0000 (15:31 +0100)]
Migrate `gap` helpers to tailwind (#30034)

Commands ran:

```sh
perl -p -i -e 's#gt-gap-0#tw-gap-0#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-1#tw-gap-0.5#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-2#tw-gap-1#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-3#tw-gap-2#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-4#tw-gap-4#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-5#tw-gap-8#g'   web_src/js/**/* templates/**/*

perl -p -i -e 's#gt-gap-x-0#tw-gap-x-0#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-1#tw-gap-x-0.5#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-2#tw-gap-x-1#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-3#tw-gap-x-2#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-4#tw-gap-x-4#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-5#tw-gap-x-8#g'   web_src/js/**/* templates/**/*

perl -p -i -e 's#gt-gap-y-0#tw-gap-y-0#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-1#tw-gap-y-0.5#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-2#tw-gap-y-1#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-3#tw-gap-y-2#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-4#tw-gap-y-4#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-5#tw-gap-y-8#g'   web_src/js/**/* templates/**/*

8 months agoRemove fomantic container module (#30036)
silverwind [Sun, 24 Mar 2024 14:04:18 +0000 (15:04 +0100)]
Remove fomantic container module (#30036)

Small CSS module. There was a ordering conflict between `.ui.menu` and
`.ui.container` which I've solved by adding the `.ui.menu` rule into
base.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
8 months agoDont show expansion for empty actions steps (#29977)
silverwind [Sun, 24 Mar 2024 13:38:10 +0000 (14:38 +0100)]
Dont show expansion for empty actions steps (#29977)

This hides the chevron icon and makes the step header unclickable for
skipped steps because there is no content to expand on those.

Before:

<img width="272" alt="Screenshot 2024-03-21 at 20 06 47"
src="https://github.com/go-gitea/gitea/assets/115237/9bb328d1-6f74-48a9-af19-de9b351e3707">

After:
<img width="295" alt="Screenshot 2024-03-21 at 20 03 07"
src="https://github.com/go-gitea/gitea/assets/115237/72a26e14-5a28-4606-8c3c-184b405872c8">

---------

Co-authored-by: Giteabot <teabot@gitea.io>