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

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

6 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>
6 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>
6 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>
6 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>
6 months agoRefactor render (#30136)
wxiaoguang [Wed, 27 Mar 2024 13:14:34 +0000 (21:14 +0800)]
Refactor render (#30136)

6 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)

6 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>
6 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>
6 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>
6 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>
6 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>
6 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)

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

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

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

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

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

6 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)

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

6 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

6 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

6 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

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

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

6 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)

6 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

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

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

6 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

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

6 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

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

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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).

6 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}/**/*
```

6 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>
6 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/**/*

6 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>
6 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>
6 months agoRemove fomantic header module (#30033)
silverwind [Sun, 24 Mar 2024 13:32:19 +0000 (14:32 +0100)]
Remove fomantic header module (#30033)

Likely still a few useless classes left, but I think I at least don't
have missed any.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoVarious code view improvements (#30014)
silverwind [Sun, 24 Mar 2024 12:14:03 +0000 (13:14 +0100)]
Various code view improvements (#30014)

1. Restore missing styles for message close icon
2. Move `code-line-button` so that it does not go off-screen on small
viewports
3. Make `code-line-button` look and behave like other buttons
4. Make `code-line-button` work in blame
5. Make the active selection span the whole line, not just the code part
6. Tweak colors, make dark theme code bg darker, make line numbers same
color in diff and file view.
7. Move code background to parent, fixing border radius and other
problems
8. Enable code wrap in blame
9. Improve blame responsiveness
10. Remove `--color-code-sidebar-bg` in blame, now it uses same
background as code
11. Rename `--color-active-line` to `--color-highlight-bg`
12. Add `--color-highlight-bg`
13. Fix button group borders on hover and border-right on last button.

<img width="1343" alt="Screenshot 2024-03-23 at 22 34 13"
src="https://github.com/go-gitea/gitea/assets/115237/fcbb919f-5dc3-43f0-97f6-870d6f412554">
<img width="1334" alt="Screenshot 2024-03-23 at 22 34 26"
src="https://github.com/go-gitea/gitea/assets/115237/ca44c3b7-4328-4645-ba49-b0dc6a5ac06d">

<img width="1338" alt="Screenshot 2024-03-23 at 22 34 57"
src="https://github.com/go-gitea/gitea/assets/115237/00eb0b5a-1ec7-4669-a94a-4602b9d1c1ac">
<img width="1337" alt="Screenshot 2024-03-23 at 22 34 42"
src="https://github.com/go-gitea/gitea/assets/115237/752edc4a-064f-413c-9dff-c086187fcd85">

Fixes: https://github.com/go-gitea/gitea/issues/18074
6 months agoEnable a few stylelint rules (#30038)
silverwind [Sun, 24 Mar 2024 07:14:48 +0000 (08:14 +0100)]
Enable a few stylelint rules (#30038)

No violations but still good to have them.

6 months agoRemove remaining jQuery .css code (#30015)
silverwind [Sun, 24 Mar 2024 02:01:57 +0000 (03:01 +0100)]
Remove remaining jQuery .css code (#30015)

The linter missed these because they were set on a object. Tested and I
also renamed those properties to add `$` indicating a jQuery selection.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRespect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (#30013)
DrMaxNix [Sat, 23 Mar 2024 21:59:58 +0000 (22:59 +0100)]
Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (#30013)

This PR adds `setting.Service.DefaultOrgMemberVisible` value to dataset
of user when the initial org creator is being added to the created org.

Fixes #30012.

6 months agoRemove jQuery `.attr` from the common global functions (#30023)
Yarden Shoham [Sat, 23 Mar 2024 21:31:19 +0000 (23:31 +0200)]
Remove jQuery `.attr` from the common global functions (#30023)

- Switched from jQuery `.attr` to plain javascript `getAttribute`
- Tested the show/hide modal buttons, they work as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoMigrate font-size helpers to tailwind (#30029)
silverwind [Sat, 23 Mar 2024 21:22:15 +0000 (22:22 +0100)]
Migrate font-size helpers to tailwind (#30029)

Migrate `gt-font-*` to `tw-text-*` All tailwind-original class names are
also available and render like they would with 16px root font size.

We currently have root font size at 14px, but I would like to eventually
migrate us to 16px so that the tailwind docs apply to us unchangend and
because 16px is the recommended root font size for web pages in general.
Also the number 16 is much better dividable than 14 so will result in
more integers.

6 months agoReplace all simple inline styles with tailwind (#30032)
silverwind [Sat, 23 Mar 2024 20:11:15 +0000 (21:11 +0100)]
Replace all simple inline styles with tailwind (#30032)

These should be all simple inline styles that were left in the
templates.

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoMigrate font-weight helpers to tailwind (#30027)
silverwind [Sat, 23 Mar 2024 18:45:11 +0000 (19:45 +0100)]
Migrate font-weight helpers to tailwind (#30027)

Commands ran:

```sh
perl -p -i -e 's#gt-font-light#tw-font-light#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-normal#tw-font-normal#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-medium#tw-font-medium#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-semibold#tw-font-semibold#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-bold#tw-font-bold#g' web_src/js/**/* templates/**/*
```

6 months agoRemove jQuery from the issue "go to" button (#30028)
Yarden Shoham [Sat, 23 Mar 2024 18:18:45 +0000 (20:18 +0200)]
Remove jQuery from the issue "go to" button (#30028)

- Switched to plain JavaScript
- Tested the "go to" button functionality and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/76add18f-3294-4117-98b7-a97f576370e2)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoDetermine fuzziness of bleve indexer by keyword length (#29706)
6543 [Sat, 23 Mar 2024 15:45:13 +0000 (16:45 +0100)]
Determine fuzziness of bleve indexer by keyword length (#29706)

also bleve did match on fuzzy search and the other way around. this also fix that bug.

6 months agoEscape paths for find file correctly (#30026)
wxiaoguang [Sat, 23 Mar 2024 13:07:47 +0000 (21:07 +0800)]
Escape paths for find file correctly (#30026)

Fix #30020

6 months agoRemove jQuery `.attr` from the diff page (#30021)
Yarden Shoham [Sat, 23 Mar 2024 12:37:18 +0000 (14:37 +0200)]
Remove jQuery `.attr` from the diff page (#30021)

- Switched from jQuery `.attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the review box counter and Previous/Next code review
conversation buttons. They work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
6 months agoRemove jQuery `.attr` from the repository settings (#30018)
Yarden Shoham [Sat, 23 Mar 2024 12:28:53 +0000 (14:28 +0200)]
Remove jQuery `.attr` from the repository settings (#30018)

- Switched from jQuery `.attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the collaborator access mode change, team search box, and
branch protection form. They all work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoRemove jQuery `.attr` from the image diff again (#30022)
Yarden Shoham [Sat, 23 Mar 2024 11:51:34 +0000 (13:51 +0200)]
Remove jQuery `.attr` from the image diff again (#30022)

- Follows https://github.com/go-gitea/gitea/pull/29917

Missed these

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoIntroduce `.secondary-nav` and handle `.page-content` spacing universally (#29982)
silverwind [Fri, 22 Mar 2024 23:54:09 +0000 (00:54 +0100)]
Introduce `.secondary-nav` and handle `.page-content` spacing universally (#29982)

Fixes: https://github.com/go-gitea/gitea/issues/29981. Introduce
`.secondary-nav` as a universal way for styling and margin adjustments
inside `.page-content`.

If the first child of `.page-content` is `.secondary-nav`, we add margin
below it, otherwise we add padding to the first child. Notable changes:

- `--color-header-wrapper` is replaced with `--color-secondary-nav-bg`.
- `navbar` class is removed.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoRemove jQuery `.attr` from the branch/tag selector (#30010)
Yarden Shoham [Fri, 22 Mar 2024 23:26:56 +0000 (01:26 +0200)]
Remove jQuery `.attr` from the branch/tag selector (#30010)

- Switched from jQuery `.attr` to plain javascript `.setAttribute`
- Tested the cherry-pick from the branch/tag selector and it works as
before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoRemove jQuery `.attr` from the commit graph (#30006)
Yarden Shoham [Fri, 22 Mar 2024 23:22:01 +0000 (01:22 +0200)]
Remove jQuery `.attr` from the commit graph (#30006)

Switched from jQuery `.attr` to plain javascript `.getAttribute` and
`.setAttribute`

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
6 months agoRemove jQuery from the citation modal (except fomantic) (#30008)
Yarden Shoham [Fri, 22 Mar 2024 23:17:28 +0000 (01:17 +0200)]
Remove jQuery from the citation modal (except fomantic) (#30008)

- Switched to plain JavaScript
- Tested the citation modal functionality and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/65bba1eb-dd4c-477f-8a2d-08e65f1e9f42)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
6 months agoRemove jQuery `.attr` from the project page (#30004)
Yarden Shoham [Fri, 22 Mar 2024 19:56:38 +0000 (21:56 +0200)]
Remove jQuery `.attr` from the project page (#30004)

- Switched from jQuery `.attr` to plain javascript `.getAttribute`
- Tested the issue movement between columns, column background color
setting, and column deletion. It all works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix incorrect tailwind migration (#30007)
silverwind [Fri, 22 Mar 2024 19:51:29 +0000 (20:51 +0100)]
Fix incorrect tailwind migration (#30007)

Fixes https://github.com/go-gitea/gitea/issues/30005. Regression from
https://github.com/go-gitea/gitea/pull/29945.

There was only once instance of `tw-content-center` before that PR, so I
just ran below command and reverted that one instance.

```sh
perl -p -i -e 's#tw-content-center#tw-items-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
```

6 months agoEnforce trailing comma in JS on multiline (#30002)
silverwind [Fri, 22 Mar 2024 14:06:53 +0000 (15:06 +0100)]
Enforce trailing comma in JS on multiline (#30002)

To keep blame info accurate and to avoid [changes like
this](https://github.com/go-gitea/gitea/pull/29977/files#diff-c3422631a14edbe1e508c4b22f0c718db318be08a6e889427802f9b6165d88d6R359),
it's good to always have a trailing comma, so let's enforce it in JS.

This rule is completely automatically fixable with `make lint-js-fix`
and that's what I did here.

6 months agoReplace 10 more gt- classes with tw- (#29945)
silverwind [Fri, 22 Mar 2024 13:45:10 +0000 (14:45 +0100)]
Replace 10 more gt- classes with tw- (#29945)

Likely the biggest change of the tailwind refactors. Only thing of note
is that `tw-flex-1` resolves to `flex: 1 1 0%` while our `gt-f1` was
`flex: 1 1 0`, I don't think it will make any difference. Commands I've
ran:

```sh
perl -p -i -e 's#gt-vm#tw-align-middle#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-fw#tw-flex-wrap#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-f1#tw-flex-1#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-fc#tw-flex-col#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-sb#tw-justify-between#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-je#tw-justify-end#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-jc#tw-justify-center#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-ac#tw-content-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
perl -p -i -e 's#gt-df#tw-flex#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
perl -p -i -e 's#gt-dib#tw-inline-block#g' web_src/js/**/* templates/**/* models/**/* tests/**/*

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoAdd border radius for wiki pages (#29937)
Lunny Xiao [Fri, 22 Mar 2024 13:17:39 +0000 (21:17 +0800)]
Add border radius for wiki pages (#29937)

Before

<img width="1312" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/26a6dec2-9fea-4c0c-b6fb-290eab12a55a">

After

<img width="1298" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/01f7a714-eae9-4729-918f-3b4795094d0b">

6 months agoUse db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)
Lunny Xiao [Fri, 22 Mar 2024 12:53:52 +0000 (20:53 +0800)]
Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)

6 months agoSmall refactors in anchors.js (#29947)
silverwind [Fri, 22 Mar 2024 12:28:38 +0000 (13:28 +0100)]
Small refactors in anchors.js (#29947)

Some minor refactors, remove unnecessary `:is` selector and move the
`:target` check out of the function. Might as well backport for the rare
browser that does not support `:is`.

6 months agoRefactor markdown attention render (#29984)
wxiaoguang [Fri, 22 Mar 2024 12:16:23 +0000 (20:16 +0800)]
Refactor markdown attention render (#29984)

Follow #29833 and add tests

6 months agoRemove fomantic site module (#29980)
silverwind [Fri, 22 Mar 2024 11:47:50 +0000 (12:47 +0100)]
Remove fomantic site module (#29980)

Had to fiddle a bit with the css ordering, but seems to work well now
and should render exactly like before. Some of the CSS may be
unnecessary, but I kept it for now.

6 months agoFix: Abnormal strings appear when comments are saved after editing (#29991)
HEREYUA [Fri, 22 Mar 2024 11:22:36 +0000 (19:22 +0800)]
Fix: Abnormal strings appear when comments are saved after editing (#29991)

Partially resolved(The second problem):
[#29986](https://github.com/go-gitea/gitea/issues/29986)

**Before**
HTML strings appear when comments are saved after editing

![image](https://github.com/go-gitea/gitea/assets/37935145/c356d99a-8473-4cc5-8e38-1b207ccd8b12)

**After**

https://github.com/go-gitea/gitea/assets/37935145/525601f9-3ee1-4266-9105-36d82b91b1c8

6 months agoFix some pending problems (#29985)
wxiaoguang [Fri, 22 Mar 2024 11:17:30 +0000 (19:17 +0800)]
Fix some pending problems (#29985)

These changes are quite independent and trivial, so I don't want to open
too many PRs.

* https://github.com/go-gitea/gitea/pull/29882#discussion_r1529607091
    * the `f.Close` should be called properly
* the error message could be more meaningful
(https://github.com/go-gitea/gitea/pull/29882#pullrequestreview-1942557935)
*
https://github.com/go-gitea/gitea/pull/29859#pullrequestreview-1942324716
    * the new translation strings don't take arguments
* https://github.com/go-gitea/gitea/pull/28710#discussion_r1443778807
    * stale for long time
*  #28140
    * a form was forgotten to be changed to work with backend code

6 months agoFix bugs in rerunning jobs (#29955)
Zettat123 [Fri, 22 Mar 2024 03:19:17 +0000 (11:19 +0800)]
Fix bugs in rerunning jobs (#29955)

Fix #28761
Fix #27884
Fix #28093

## Changes

### Rerun all jobs
When rerun all jobs, status of the jobs with `needs` will be set to
`blocked` instead of `waiting`. Therefore, these jobs will not run until
the required jobs are completed.

### Rerun a single job
When a single job is rerun, its dependents should also be rerun, just
like GitHub does
(https://github.com/go-gitea/gitea/issues/28761#issuecomment-2008620820).
In this case, only the specified job will be set to `waiting`, its
dependents will be set to `blocked` to wait the job.

### Show warning if every job has `needs`
If every job in a workflow has `needs`, all jobs will be blocked and no
job can be run. So I add a warning message.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b"
width="480px" />

6 months agoremove PATH and GOPATH modification in Makefile (#29978)
silverwind [Thu, 21 Mar 2024 23:58:14 +0000 (00:58 +0100)]
remove PATH and GOPATH modification in Makefile (#29978)

We don't need these modifications anymore since all tool
dependencies run via `go run`.

6 months agoRefactor external URL detection (#29973)
wxiaoguang [Thu, 21 Mar 2024 20:32:40 +0000 (04:32 +0800)]
Refactor external URL detection (#29973)

Follow #29960, `IsExternalURL` is not needed anymore.
Add some tests for `RedirectToCurrentSite`

6 months agoRefactor repo header/list (#29969)
wxiaoguang [Thu, 21 Mar 2024 17:04:03 +0000 (01:04 +0800)]
Refactor repo header/list (#29969)

1. Use general "mobile-only" and "not-mobile" CSS styles, remove some`@media (max-width: 767.98px)` tricks
2. Use `CountFmt` for repo list, just like the repo header (and it matches GitHub, to avoid big numbers bloat the page)

6 months agoFix various loading states, remove `.loading` class (#29920)
silverwind [Thu, 21 Mar 2024 16:31:15 +0000 (17:31 +0100)]
Fix various loading states, remove `.loading` class (#29920)

Various code was using fomantic `loading` class which I think got broken
a while ago and rendered only a full circle. Fix those to use
`is-loading`.

Before:
<img width="295" alt="Screenshot 2024-03-19 at 22 56 26"
src="https://github.com/go-gitea/gitea/assets/115237/dbe83395-5db4-4868-90bc-3613866a35f0">

After:
<img width="60" alt="Screenshot 2024-03-19 at 22 54 35"
src="https://github.com/go-gitea/gitea/assets/115237/8ac19b7e-035a-4c6d-850b-53a234ef69c2">
<img width="294" alt="Screenshot 2024-03-19 at 22 54 56"
src="https://github.com/go-gitea/gitea/assets/115237/34e819d7-25f7-43a1-9d48-4a68dcd2b6ad">
<img width="320" alt="Screenshot 2024-03-19 at 22 55 16"
src="https://github.com/go-gitea/gitea/assets/115237/05127544-47ff-4e18-9fd8-c84e44c374f8">
<img width="153" alt="Screenshot 2024-03-19 at 23 01 43"
src="https://github.com/go-gitea/gitea/assets/115237/a33248c6-b11d-40ff-82d8-f5a3d85b55aa">
<img width="1300" alt="Screenshot 2024-03-19 at 23 56 25"
src="https://github.com/go-gitea/gitea/assets/115237/562ca876-b5d5-4295-961e-9d2cdab31ab0">
<img width="136" alt="Screenshot 2024-03-20 at 00 00 38"
src="https://github.com/go-gitea/gitea/assets/115237/44838ac4-67f3-4fec-a8e3-978cc5dbdb72">

6 months agoUpdate register application URL for GitLab (#29959)
yp05327 [Thu, 21 Mar 2024 15:48:13 +0000 (00:48 +0900)]
Update register application URL for GitLab (#29959)

Fix #26593
The old URL was updated 7 years ago. Maybe no need to hold it any more.

![image](https://github.com/go-gitea/gitea/assets/18380374/95a0b364-832b-4f10-800e-21845d64df1a)

6 months agoRefactor StringsToInt64s (#29967)
wxiaoguang [Thu, 21 Mar 2024 15:07:35 +0000 (23:07 +0800)]
Refactor StringsToInt64s (#29967)

And close #27176

6 months agoSwitch to happy-dom for testing (#29948)
silverwind [Thu, 21 Mar 2024 14:05:24 +0000 (15:05 +0100)]
Switch to happy-dom for testing (#29948)

Use `happy-dom` again in vitest as it has caught up recently to `jsdom`
in terms of features and it is a much more lightweight solution.

I encountered [one
bug](https://github.com/capricorn86/happy-dom/issues/1342), but it's an
easy workaround until fixed.

I regenerated the lockfile to get rid of the transitive dependencies so
that's why the diff also has some upgrades in it.

In total, this change removes 39 npm dependencies.

6 months agoPerformance improvements for pull request list page (#29900)
Lunny Xiao [Thu, 21 Mar 2024 13:13:08 +0000 (21:13 +0800)]
Performance improvements for pull request list page (#29900)

This PR will avoid load pullrequest.Issue twice in pull request list
page. It will reduce x times database queries for those WIP pull
requests.

Partially fix #29585

---------

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRefactor URL detection (#29960)
wxiaoguang [Thu, 21 Mar 2024 12:02:34 +0000 (20:02 +0800)]
Refactor URL detection (#29960)

"Redirect" functions should only redirect if the target is for current Gitea site.

6 months agoSolving the issue of UI disruption when the review is deleted without refreshing...
HEREYUA [Thu, 21 Mar 2024 10:38:27 +0000 (18:38 +0800)]
Solving the issue of UI disruption when the review is deleted without refreshing (#29951)

**After deleting the review and refreshing, the display is normal.
However, Without refreshing, the interface will be broken**

https://github.com/go-gitea/gitea/assets/37935145/f5cb19a6-eb26-47b0-b8ee-15b575bbe1ac

**after**

https://github.com/go-gitea/gitea/assets/37935145/aa65922c-2ebf-4fce-ad91-35661f70329a

6 months agoFix JS error and improve error message styles (#29963)
silverwind [Thu, 21 Mar 2024 10:16:11 +0000 (11:16 +0100)]
Fix JS error and improve error message styles (#29963)

Fixes: https://github.com/go-gitea/gitea/issues/29956. This error
exposed a existing bug in the code, it was just never noticed because
the jQuery expression evaluated without error before while the new one
doesn't.

Also improves error message styles:

Before:
<img width="1338" alt="Screenshot 2024-03-21 at 09 16 07"
src="https://github.com/go-gitea/gitea/assets/115237/1cc1ef89-ad94-491e-bbca-75387f7547a0">

After:
<img width="1335" alt="Screenshot 2024-03-21 at 09 15 44"
src="https://github.com/go-gitea/gitea/assets/115237/312efc79-5353-4e2a-a703-1bccd3c01736">

6 months agoFix the bug that user may logout if he switch pages too fast (#29962)
Lunny Xiao [Thu, 21 Mar 2024 08:48:08 +0000 (16:48 +0800)]
Fix the bug that user may logout if he switch pages too fast (#29962)

This PR fixed a bug when the user switching pages too fast, he will
logout automatically.

The reason is that when the error is context cancelled, the previous
code think user hasn't login then the session will be deleted. Now it
will return the errors but not think it's not login.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>