Commit Graph

17729 Commits

Author SHA1 Message Date
wxiaoguang 6d34ce25b1
Do not allow different storage configurations to point to the same directory (#30169)
Replace #29171
2024-03-31 03:03:24 +00:00
KN4CK3R 82ffd91607
Fix GPG subkey verify (#30193)
Fixes #30189

Can't verify subkeys if they are not loaded.
2024-03-31 02:35:19 +00:00
GiteaBot 7eb3ab0765 [skip ci] Updated translations via Crowdin 2024-03-31 00:27:17 +00:00
silverwind 640850e15f
Fix unclickable checkboxes (#30195)
Fix https://github.com/go-gitea/gitea/issues/30185, regression from
https://github.com/go-gitea/gitea/pull/30162.

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

Secondly, I changed the for/id linking to also add missing `for`
attributes when `id` is present. The other way around (only `for`
present) is currently not handled and I think there are likey no
occurences in the code and introducing new non-generated `id`s might
cause problems elsewhere if we do, so I skipped on that.
2024-03-31 02:00:58 +02:00
Yarden Shoham 72a5d3faa8
Remove jQuery class from the issue author dropdown (#30188)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the issue author dropdown functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-03-30 22:14:57 +00:00
Yarden Shoham 6aeff21b76
Remove jQuery class from the comment edit history (#30186)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the comment edit history functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-03-30 23:09:46 +01:00
Yarden Shoham 2b3f7d3e96
Remove jQuery class from the repository branch settings (#30184)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the repository branch settings functionality and it works as
before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-03-30 22:30:00 +01:00
GiteaBot bcf3be3a6c [skip ci] Updated translations via Crowdin 2024-03-30 18:47:50 +00:00
Denys Konovalov f32ce753f6
Use Crowdin action for translation sync (#30054)
Switch from the old self-built action to the official one.

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

Tested both upload and download.
2024-03-30 18:11:50 +00:00
Yarden Shoham b535c6ca7b
Remove jQuery class from the project page (#30183)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the edit column modal functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-03-30 18:36:28 +01:00
Yarden Shoham 66f7d47d2c
Remove jQuery class from the comment context menu (#30179)
- Switched from jQuery class functions to plain JavaScript
- Tested the comment context menu functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
2024-03-30 10:40:39 +01:00
KN4CK3R b6a3cd4b8d
Include encoding in signature payload (#30174)
Fixes #30119

Include the encoding in the signature payload.

before

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

after

![grafik](https://github.com/go-gitea/gitea/assets/1666336/3a37d438-c70d-4d69-b178-d170e74aa683)
2024-03-29 21:55:10 +00:00
silverwind f31a88d3cb
Add `stylelint-value-no-unknown-custom-properties` and convert stylelint config to js (#30117)
Add
[`stylelint-value-no-unknown-custom-properties`](https://github.com/csstools/stylelint-value-no-unknown-custom-properties)
which lints for undefined CSS variables. No current violations.

To make it work properly with editor integrations, I had to convert the
config to JS to be able to pass absolute paths to the plugin, but this
is a needed change anyways.
2024-03-29 20:32:35 +00:00
Yarden Shoham 42870cf402
Remove jQuery class from the commit button (#30178)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the commit button disabled toggling functionality and it works
as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-03-29 20:24:17 +01:00
Yarden Shoham c487a32bcd
Remove jQuery class from the diff view (#30176)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the diff view functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
2024-03-29 18:51:44 +00:00
Yarden Shoham 56ac5f18e8
Remove jQuery class from the notification count (#30172)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the notification count and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-03-29 17:17:21 +00:00
Yarden Shoham 911993429f
Remove jQuery class from the code range selection (#30173)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the code range selection functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-03-29 18:08:54 +01:00
HEREYUA c9068ef9e4
Fix:the rounded corners of the folded file are not displayed correctly (#29953)
Fix:    [#29933](https://github.com/go-gitea/gitea/issues/29933)

**Before**


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


**After**


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

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-03-29 15:39:46 +00:00
Jack Hay 59d4aadba5
Add setting to disable user features when user login type is not plain (#29615)
## Changes
- Adds setting `EXTERNAL_USER_DISABLE_FEATURES` to disable any supported
user features when login type is not plain
- In general, this is necessary for SSO implementations to avoid
inconsistencies between the external account management and the linked
account
- Adds helper functions to encourage correct use
2024-03-29 16:05:41 +01:00
Yarden Shoham 849eee8db7
Remove jQuery class from the image diff (#30140)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the image diff and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-29 12:40:17 +00:00
silverwind 8fd15990c5
Remove fomantic checkbox module (#30162)
CSS is pretty slim already and the `.ui.toggle.checkbox` sliders on
admin page also still work. The only necessary JS is the one that links
`input` and `label` so that it can be toggled via label. All checkboxes
except the markdown ones render at `--checkbox-size: 16px` now.

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

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

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

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-03-29 04:56:01 +00:00
Lunny Xiao 8acc7aab4c
Refactor topic Find functions and add more tests for pagination (#30127)
This also fixed #22238
2024-03-29 11:38:16 +08:00
silverwind dd8dde2be8
replace jquery-minicolors with coloris (#30055)
Get rid of one more jQuery dependant and have a nicer color picker as
well.

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

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

<img width="867" alt="Screenshot 2024-03-25 at 00 21 05"
src="https://github.com/go-gitea/gitea/assets/115237/71215c39-abb1-4881-b5c1-9954b4a89adb">
<img width="860" alt="Screenshot 2024-03-25 at 00 20 48"
src="https://github.com/go-gitea/gitea/assets/115237/a12cb68f-c38b-4433-ba05-53bbb4b1023e">
2024-03-29 04:00:07 +01:00
sillyguodong 62b073e6f3
Add API for `Variables` (#29520)
close #27801

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-03-28 20:40:35 +00:00
yp05327 6103623596
Fix `DEFAULT_SHOW_FULL_NAME=false` has no effect in commit list and commit graph page (#30096)
Fix #20446

This PR will fix the username in:
repo home page

![image](https://github.com/go-gitea/gitea/assets/18380374/347c0f70-ea42-432d-aae3-bf87a7e07ae1)
repo commit list page

![image](https://github.com/go-gitea/gitea/assets/18380374/b3b1f5d5-c371-4222-ac2e-64b8994c7551)
repo commit graph page

![image](https://github.com/go-gitea/gitea/assets/18380374/01b7117c-3aea-4d7d-8bd1-35e5ea942821)
pr commit page

![image](https://github.com/go-gitea/gitea/assets/18380374/4d180c30-2150-4348-8eeb-0b4b2559ec19)

Will not fix:
wiki revisions page:

![image](https://github.com/go-gitea/gitea/assets/18380374/b49df6bf-d751-4374-b7ea-1ac85e2739e3)
ps: the author name is `FullName` by default
2024-03-28 15:15:39 -04:00
Lunny Xiao 40cdc84b36
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`
2024-03-28 16:14:30 +00:00
Paweł Bogusławski 9585e19bb4
Adjust VS Code debug filename match in .gitignore (#30158) 2024-03-28 11:24:30 -04:00
Kemal Zebari 242b331260
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">
2024-03-28 15:19:24 +00:00
silverwind e40fc75bac
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">
2024-03-28 10:42:31 +00:00
Yarden Shoham eca4c48534
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>
2024-03-28 10:42:08 +01:00
silverwind 226a82a939
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/**/*
2024-03-28 08:31:07 +00:00
YR Chen 7443a10fc3
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.
2024-03-28 16:01:15 +08:00
delvh 0d5abe3454
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.

## ⚠️ 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>
2024-03-28 03:13:42 +00:00
HEREYUA 7ba485bd49
Apply to become a maintainer (#30151)
PRs:https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3AHEREYUA+is%3Aclosed

Discord: hereyua
2024-03-28 02:47:05 +00:00
wxiaoguang 71706126b5
Refactor markdown render (#30139)
Only split the file into small ones (and rename AttentionTypes to
attentionTypes)
2024-03-28 02:26:13 +00:00
silverwind 7fda109aba
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`.
2024-03-28 00:20:38 +01:00
silverwind b08c7afe5f
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.
2024-03-27 21:47:40 +00:00
Denys Konovalov e5160185ed
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>
2024-03-27 20:54:32 +00:00
silverwind 4eb86d6823
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)
2024-03-27 20:18:04 +00:00
silverwind c85619b82d
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.
2024-03-27 21:05:49 +01:00
wxiaoguang 1ad48f781e
Relax generic package filename restrictions (#30135)
Now, the chars `=:;()[]{}~!@#$%^ &` are possible as well
Fixes #30134

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-03-27 16:55:05 +00:00
Yarden Shoham 1551d73d3f
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>
2024-03-27 16:14:18 +00:00
Yarden Shoham 1a71dbfb78
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>
2024-03-27 17:09:34 +01:00
Yarden Shoham 34acd8e376
Forbid jQuery `.attr` (#30116)
Use `.getAttribute`, `.setAttribute`, or `.removeAttribute` instead

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-03-27 21:49:54 +08:00
wxiaoguang f1707f4562
Refactor render (#30136) 2024-03-27 13:14:34 +00:00
HEREYUA 0262c66ba6
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)
2024-03-27 12:48:09 +00:00
Yarden Shoham 0922ce8191
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>
2024-03-27 10:50:07 +00:00
Yarden Shoham a190f68f1b
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>
2024-03-27 10:45:05 +00:00
Yarden Shoham 4efe7884a3
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>
2024-03-27 11:40:21 +01:00
silverwind 643e6b0958
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>
2024-03-27 09:58:02 +00:00