Commit Graph

18224 Commits

Author SHA1 Message Date
wxiaoguang a88f718c10
Refactor dropzone (#31482)
Refactor the legacy code and remove some jQuery calls.
2024-06-27 01:01:20 +08:00
GiteaBot 35ce7a5e0e [skip ci] Updated translations via Crowdin 2024-06-26 00:26:17 +00:00
Chl b5326a431f
Optimization of labels handling in issue_search (#26460)
This PR enhances the labels handling in issue_search by optimizing the
SQL query and de-duplicate the IDs when generating the query string.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2024-06-25 13:09:13 -04:00
CyberFlame 72c66bd479
use correct l10n string (#31487)
Uses the correct string for searching - this is what it looks like prior
to the change:

![image](https://github.com/go-gitea/gitea/assets/24910512/38519825-c347-44d6-85d4-6fa3c71ddb7c)
(observe how the top box has "Search teams" even though collaborator
would be user
2024-06-25 14:54:18 +00:00
Brecht Van Lommel 4af97cf383
Fix overflow menu flickering on mobile (#31484)
The overflow menu button was incorrectly included in the measurement of
the width of the items. As a result, it could get stuck in a loop
alternating between different measurements as the button appears and
disappears.
2024-06-25 10:24:15 -04:00
GiteaBot 24f4ebb8a9 [skip ci] Updated translations via Crowdin 2024-06-25 00:26:08 +00:00
Brecht Van Lommel 053e5829a3
Fix poor table column width due to breaking words (#31473)
Caused by #31091

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-06-24 17:48:43 +00:00
techknowlogick a4899ffa24
bump golang deps (#31422) 2024-06-24 13:26:42 +00:00
Kemal Zebari 0c4ff01109
Disable issue/PR comment button given empty input (#31463)
Given an empty issue/PR comment, the comment history would not be
updated if the user were to submit it. Therefore, it would make since to
just disable the comment button when the text editor is empty.

This is inline with what GitHub does when given empty text editor input.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-23 18:41:01 +00:00
wxiaoguang f4921b9daa
Simplify 404/500 page (#31409) 2024-06-23 17:45:21 +00:00
kiatt210 6a96deb589
Fix web notification icon not updated once you read all notifications (#31447)
Fix #29065
Remove status filtering from GetUIDsAndNotificationCounts sql.

---------

Co-authored-by: kiatt210 <kiatt210@github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-23 15:50:10 +08:00
wxiaoguang bda875b6e6
Switch to "Write" tab when edit comment again (#31445)
Fix #19031
2024-06-22 09:25:04 +00:00
wxiaoguang 1d76e9aabf
Add simple JS init performance trace (#31459)
Related to #23461, and help some cases like #31412

For developers, they could use browser's Performance tool to collect
performance data, while this PR is also quite handy to optimize the
`index.js`.

For end users, this PR is simple enough and could figure out the slow
function quickly.


![image](https://github.com/go-gitea/gitea/assets/2114189/a557b08e-6594-474b-81a3-03d5ac2bd68e)
2024-06-22 17:20:20 +08:00
wxiaoguang 1a811c0bd1
Refactor image diff (#31444)
And remove some jQuery functions
2024-06-22 04:52:09 +00:00
GiteaBot b3ed1e0e62 [skip ci] Updated translations via Crowdin 2024-06-22 00:25:47 +00:00
Sergey Sharybin 49b8716c40
Support relative paths to videos from Wiki pages (#31061)
This change fixes cases when a Wiki page refers to a video stored in the
Wiki repository using relative path. It follows the similar case which
has been already implemented for images.

Test plan:
- Create repository and Wiki page
- Clone the Wiki repository
- Add video to it, say `video.mp4`
- Modify the markdown file to refer to the video using `<video
src="video.mp4">`
- Commit the Wiki page
- Observe that the video is properly displayed

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-21 18:23:54 +00:00
silverwind 996037fb6a
Fix deprecated Dockerfile ENV format (#31450)
See
https://docs.docker.com/reference/build-checks/legacy-key-value-format/.
Fixes these warnings seen during the docker build:

```
 4 warnings found (use --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 5)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 9)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 75)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 76)
 ```

Introduced in: https://github.com/moby/buildkit/pull/4923
2024-06-21 11:08:42 -04:00
silverwind 6f2e150aeb
README Badge maintenance (#31441)
1. Remove tickgit badge, the service [only gives
errors](https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main)
and the repo [seems
unmaintained](https://github.com/augmentable-dev/tickgit).
2. Color the gitpod badge green because grey badges look odd.
2024-06-21 13:18:39 +00:00
wxiaoguang 621e1ff9c9
Improve markdown textarea for indentation and lists (#31406)
Almost works like GitHub

* use Tab/Shift-Tab to indent/unindent the selected lines
* use Enter to insert a new line with the same indentation and prefix
2024-06-21 08:14:40 +00:00
wxiaoguang 06782872c4
Split common-global.js into separate files (#31438)
To improve maintainability
2024-06-21 15:40:33 +08:00
wxiaoguang ed5ded3ff8
Fix the link for .git-blame-ignore-revs bypass (#31432)
A quick fix for #31429
2024-06-20 23:28:34 +00:00
Yarden Shoham a5a9885f72
Bump htmx to 2.0.0 (#31413)
Tested Subscribe, Follow, Star, Watch, and System Status.

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2024-06-20 20:04:09 +00:00
charles c60ef946b1
Fix the wrong line number in the diff view page when expanded twice. (#31431)
close #31149, regression of #29385 (incorrect `data-query=`)
2024-06-20 17:43:42 +00:00
Brecht Van Lommel 5afafe22a3
Fix labels and projects menu overflow on issue page (#31435)
It was correct only on the new issue page.

Resolves #31415
2024-06-20 16:54:19 +00:00
Sumit 17b3a38577
[Fix] Account Linking UpdateMigrationsByType (#31428)
Fix https://github.com/go-gitea/gitea/issues/31427
2024-06-20 21:24:53 +08:00
charles 90a3c20e79
Fix markdown math brackets render problem (#31420)
Close #31371, support `($ ... $)` like GitHub

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-20 02:12:54 +00:00
silverwind 1c15452687
Reduce `air` verbosity (#31417)
Make `air` log less. Uses the option added in
https://github.com/air-verse/air/pull/367.
2024-06-19 19:42:06 +00:00
silverwind 566d87bb8e
Fix new issue/pr avatar (#31419)
The avatar on "New Issue" and "New Pull Request" pages was inconsistent.
Removed the extra margin and the new CSS rules now use common parent
`<form id="#new-issue">` because `.repository.new.issue` is not present
on pull request page.
2024-06-19 16:19:59 +00:00
Tobias Balle-Petersen 1c26127b52
Increase max length of org team names from 30 to 255 characters (#31410)
This PR modifies the structs for editing and creating org teams to allow
team names to be up to 255 characters. The previous maximum length was
30 characters.
2024-06-19 10:36:09 -04:00
GiteaBot 7adf8d7727 [skip ci] Updated translations via Crowdin 2024-06-19 00:26:25 +00:00
wxiaoguang 43c7a2e7b1
Refactor names (#31405)
This PR only does "renaming":

* `Route` should be `Router` (and chi router is also called "router")
* `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`)
* Use lower case for private functions to avoid exposing or abusing
2024-06-19 06:32:45 +08:00
silverwind 17baf1af10
Update JS dependencies, remove `eslint-plugin-jquery` (#31402)
- Result of `make update-js`
- Added 1 new eslint rule
- Autofixed 1 new eslint issue
- Remove `eslint-plugin-jquery` as `eslint-plugin-no-jquery` does all it
does and is actually the maintained fork of it.
- Tested all affected `dependencies`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-18 08:10:30 +00:00
Yarden Shoham 9c8092807a
Switch to upstream of `gorilla/feeds` (#31400)
They merged the PR we waited for.

- Reference: https://github.com/gorilla/feeds/pull/107
- Follows: https://github.com/go-gitea/gitea/pull/28860

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-18 16:05:28 +08:00
wxiaoguang 21783a5752
Fix rendered wiki page link (#31398)
Fix #31395
2024-06-18 03:09:20 +00:00
wxiaoguang 37a4b233a0
Refactor repo unit "disabled" check (#31389)
1. There are already global "unit consts", no need to use context data, which is fragile
2. Remove the "String()" method from "unit", it would only cause rendering problems in templates

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-06-18 00:51:13 +00:00
wxiaoguang d32648b204
Refactor route path normalization (#31381)
Refactor route path normalization and decouple it from the chi router.
Fix the TODO, fix the legacy strange path behavior.
2024-06-17 23:28:47 +00:00
wxiaoguang 5a7376c060
Refactor markup code (#31399)
1. use clearer names
2. remove deadcode
3. avoid name shadowing
4. eliminate some lint warnings
2024-06-17 22:56:45 +00:00
6543 363c123598
Add cache test for admins (#31265)
Add a test to probe the cache similar to the email test func.


![image](https://github.com/go-gitea/gitea/assets/24977596/700e2733-586d-4091-900f-f5f71e6e94bf)


![image](https://github.com/go-gitea/gitea/assets/24977596/2a953802-18fc-4e81-a37d-24ebe1297365)


![image](https://github.com/go-gitea/gitea/assets/24977596/e00d62ad-bb60-41cc-9138-09993daee156)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
2024-06-17 21:22:39 +02:00
silverwind 4b6eb46e69
Fix double border in system status table (#31363)
Fix regression from https://github.com/go-gitea/gitea/pull/30712 where
the introduction of this `<div>` caused the `.ui.attached:not(.message)
+ .ui.attached.segment:not(.top)` CSS selector to no longer work and
cause a double border.

Before:

<img width="200" alt="Screenshot 2024-06-13 at 19 06 12"
src="https://github.com/go-gitea/gitea/assets/115237/a9fa0688-adf0-4b2d-a958-6a7679a62031">

After:
<img width="232" alt="Screenshot 2024-06-13 at 19 05 57"
src="https://github.com/go-gitea/gitea/assets/115237/025b780f-f72f-4049-86de-a5d84851bd1d">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-17 15:21:59 +02:00
wxiaoguang 0f09c22663
Improve rubygems package registry (#31357)
To make it work with Bundler:
https://guides.rubygems.org/rubygems-org-compact-index-api/

It only adds 2 new API endpoints and improves some tests, existing logic
is not changed.
2024-06-17 08:42:46 +00:00
wxiaoguang 25f3ec5b65
Fix natural sort (#31384)
Fix #31374
2024-06-17 06:45:12 +00:00
Brecht Van Lommel 597d1da96b
Fix missing images in editor preview due to wrong links (#31299)
Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves #31294

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-17 14:16:14 +08:00
wxiaoguang f5dfd7d73c
Add a simple test for AdoptRepository (#31391)
Follow #31333
2024-06-17 01:18:35 +00:00
GiteaBot 129206da45 [skip ci] Updated licenses and gitignores 2024-06-17 00:27:39 +00:00
wxiaoguang f446e3b4ab
Fix JS error when creating new issue (#31383)
Fix #31336
2024-06-16 02:07:21 +00:00
GiteaBot c70d4f03c9 [skip ci] Updated translations via Crowdin 2024-06-16 00:28:50 +00:00
6543 78e8296e11
Rename repo_model.SearchOrderByMap to repo_model.OrderByMap (#31359)
https://github.com/go-gitea/gitea/pull/30876#discussion_r1637112394
2024-06-15 06:45:02 +00:00
6543 e37ecd1732
rm const do inline (#31360)
https://github.com/go-gitea/gitea/pull/30876/files#r1637288202
2024-06-15 04:48:52 +00:00
Zettat123 42718d32af
Allow downloading attachments of draft releases (#31369)
Fix #31362
2024-06-15 12:20:14 +08:00
wxiaoguang 84cbb6c4d2
Fix duplicate sub-path for avatars (#31365)
Fix #31361, and add tests

And this PR introduces an undocumented & debug-purpose-only config
option: `USE_SUB_URL_PATH`. It does nothing for end users, it only helps
the development of sub-path related problems.

And also fix #31366

Co-authored-by: @ExplodingDragon
2024-06-15 11:43:57 +08:00