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

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

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

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

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

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

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

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

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

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

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