aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Switch to upstream of `gorilla/feeds` (#31400)Yarden Shoham2024-06-182-5/+3
| | | | | | | | | 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>
* Fix rendered wiki page link (#31398)wxiaoguang2024-06-1810-73/+58
| | | Fix #31395
* Refactor repo unit "disabled" check (#31389)wxiaoguang2024-06-1811-55/+25
| | | | | | | | 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>
* Refactor route path normalization (#31381)wxiaoguang2024-06-178-157/+153
| | | | Refactor route path normalization and decouple it from the chi router. Fix the TODO, fix the legacy strange path behavior.
* Refactor markup code (#31399)wxiaoguang2024-06-172-37/+10
| | | | | | 1. use clearer names 2. remove deadcode 3. avoid name shadowing 4. eliminate some lint warnings
* Add cache test for admins (#31265)65432024-06-178-27/+119
| | | | | | | | | | | | | | | | | 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>
* Fix double border in system status table (#31363)silverwind2024-06-171-3/+5
| | | | | | | | | | | | | | | | | | | 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>
* Improve rubygems package registry (#31357)wxiaoguang2024-06-173-108/+346
| | | | | | | 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.
* Fix natural sort (#31384)wxiaoguang2024-06-172-17/+87
| | | Fix #31374
* Fix missing images in editor preview due to wrong links (#31299)Brecht Van Lommel2024-06-175-78/+103
| | | | | | | | | | 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>
* Add a simple test for AdoptRepository (#31391)wxiaoguang2024-06-171-0/+13
| | | Follow #31333
* [skip ci] Updated licenses and gitignoresGiteaBot2024-06-173-10/+47
|
* Fix JS error when creating new issue (#31383)wxiaoguang2024-06-161-1/+1
| | | Fix #31336
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-161-0/+4
|
* Rename repo_model.SearchOrderByMap to repo_model.OrderByMap (#31359)65432024-06-154-22/+22
| | | https://github.com/go-gitea/gitea/pull/30876#discussion_r1637112394
* rm const do inline (#31360)65432024-06-151-42/+18
| | | https://github.com/go-gitea/gitea/pull/30876/files#r1637288202
* Allow downloading attachments of draft releases (#31369)Zettat1232024-06-151-2/+3
| | | Fix #31362
* Fix duplicate sub-path for avatars (#31365)wxiaoguang2024-06-1513-40/+150
| | | | | | | | | | | 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
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-152-0/+10
|
* Add tag protection via rest api #17862 (#31295)mzroot2024-06-148-0/+778
| | | | | | | | Add tag protection manage via rest API. --------- Co-authored-by: Alexander Kogay <kogay.a@citilink.ru> Co-authored-by: Giteabot <teabot@gitea.io>
* Extract and display readme and comments for Composer packages (#30927)KN4CK3R2024-06-143-26/+90
| | | | | | | | | Related #30075 CC @thojo0 Example with rendered readme: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/3516fef5-2631-40fd-8841-5d9894ec8904)
* Have new announcement about docs contributions (#31364)Lunny Xiao2024-06-142-6/+8
| | | | | According to the maintainers' discussion and voting. We decide to move docs to https://gitea.com/gitea/docs . Add some hints on this repository to not make contributors confusing.
* Fix bug filtering issues which have no project (#31337)Lunny Xiao2024-06-141-1/+6
| | | | | | Fix #31327 This is a quick patch to fix the bug. Some parameters are using 0, some are using -1. I think it needs a refactor to keep consistent. But that will be another PR.
* Refactor to use UnsafeStringToBytes (#31358)Oleksandr Redko2024-06-146-18/+14
| | | | | | | The PR replaces all `goldmark/util.BytesToReadOnlyString` with `util.UnsafeBytesToString`, `goldmark/util.StringToReadOnlyBytes` with `util.UnsafeStringToBytes`. This removes one `TODO`. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-141-7/+41
|
* Fix PullRequestList.GetIssueIDs's logic (#31352)yp053272024-06-131-6/+5
| | | | | | | | | | | | | | | fix a bug from #30490 `prs.GetIssueIDs()` will also be used in other places, e.g. `InvalidateCodeComments` so we should not add `if pr.Issue == nil` in it, or if `pr.Issue` is already loaded, you will not get the issueID in the results list and this is not an expected result. So this will caused a bug: before calling `InvalidateCodeComments`, all `pr.Issues` in `prs` are loaded, so `issueIDs` in this function will always be `[]`. ![image](https://github.com/go-gitea/gitea/assets/18380374/ef94d9d2-0bf9-455a-abd6-4d5e6497db7c)
* [Refactor] Unify repo search order by logic (#30876)65432024-06-136-78/+71
| | | | have repo OrderBy definitions defined in one place and use a single type for OrderBy database options
* Fixed incorrect localization `explorer.go` (#31348)Kerwin Bryant2024-06-131-5/+1
| | | see: https://github.com/go-gitea/gitea/pull/29701/files#r1637325139
* Improve detecting empty files (#31332)wxiaoguang2024-06-1311-13/+29
| | | Co-authored-by: silverwind <me@silverwind.io>
* Fix hash render end with colon (#31319)Lunny Xiao2024-06-122-1/+2
| | | | Fix a hash render problem like `<hash>: xxxxx` which is usually used in release notes.
* Fix line number widths (#31341)silverwind2024-06-122-8/+9
| | | | | | | | | | | | | | | | | | Fixes regression https://github.com/go-gitea/gitea/pull/31307#issuecomment-2162554913 Table CSS is weird. A `auto` value does not work and causes the regression while any pixel value causes another regression in diff where the code lines do not stretch. Partially revert that PR and clean up some related too-deep CSS selectors. <img width="109" alt="Screenshot 2024-06-12 at 15 07 22" src="https://github.com/go-gitea/gitea/assets/115237/756c5dea-44b8-49f9-8a08-acef68075f62"> <img width="119" alt="Screenshot 2024-06-12 at 15 07 43" src="https://github.com/go-gitea/gitea/assets/115237/28ae1adc-118e-4016-8d09-033b9f1c9a6f"> <img width="151" alt="Screenshot 2024-06-12 at 15 07 07" src="https://github.com/go-gitea/gitea/assets/115237/08db7ed9-de4e-405e-874d-c7ebe3082557"> <img width="141" alt="Screenshot 2024-06-12 at 15 07 14" src="https://github.com/go-gitea/gitea/assets/115237/c4a5492b-1bf1-4773-bc8d-64eb36d823f9">
* Fix navbar `+` menu flashing on page load (#31281)silverwind2024-06-126-28/+46
| | | | | | | | | | | Fixes https://github.com/go-gitea/gitea/pull/31273#issuecomment-2153771331. Same method as used in https://github.com/go-gitea/gitea/pull/30215. All left-opening dropdowns need to use it method. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Reduce memory usage for chunked artifact uploads to MinIO (#31325)Rowan Bohde2024-06-121-2/+2
| | | | | | | | | | | | When using the MinIO storage driver for Actions Artifacts, we found that the chunked artifact required significantly more memory usage to both upload and merge than the local storage driver. This seems to be related to hardcoding a value of `-1` for the size to the MinIO client [which has a warning about memory usage in the respective docs](https://pkg.go.dev/github.com/minio/minio-go/v7#Client.PutObject). Specifying the size in both the upload and merge case reduces memory usage of the MinIO client. Co-authored-by: Kyle D <kdumontnu@gmail.com>
* Fix dates displaying in a wrong manner when we're close to the end of the ↵Yarden Shoham2024-06-122-5/+5
| | | | | | | | | | month (#31331) I tested and all timestamps work as before. - Reference https://github.com/github/relative-time-element/pull/285 - Fixes https://github.com/go-gitea/gitea/issues/31197 Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Fix adopt repository has empty object name in database (#31333)Lunny Xiao2024-06-121-0/+1
| | | | | | | Fix #31330 Fix #31311 A workaround to fix the old database is to update object_format_name to `sha1` if it's empty or null.
* Optimize profile layout to enhance visual experience (#31278)Kerwin Bryant2024-06-121-10/+2
| | | Co-authored-by: silverwind <me@silverwind.io>
* Fix #31185 try fix lfs download from bitbucket failed (#31201)Zoupers Zou2024-06-118-13/+16
| | | Fix #31185
* Enable `unparam` linter (#31277)silverwind2024-06-1127-135/+86
| | | | | | | | | | | | Enable [unparam](https://github.com/mvdan/unparam) linter. Often I could not tell the intention why param is unused, so I put `//nolint` for those cases like webhook request creation functions never using `ctx`. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Make template `Iif` exactly match `if` (#31322)wxiaoguang2024-06-112-21/+47
|
* update nix flake and add gofumpt (#31320)65432024-06-112-3/+4
| | | nix flake maintenance
* code optimization (#31315)Kerwin Bryant2024-06-1114-48/+90
| | | Simplifying complex if-else to existing Iif operations
* Fix line number width in code preview (#31307)silverwind2024-06-111-2/+0
| | | | | | | Line numbers were using some hacky CSS `width: 1%` that did nothing to the code rendering as far as I can tell but broken the inline preview in markup when line numbers are greater than 2 digits. Also I removed one duplicate `font-family` rule (it is set below in the `.lines-num, .lines-code` selector.
* Delete legacy cookie before setting new cookie (#31306)wxiaoguang2024-06-111-4/+4
| | | Try to fix #31202
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-112-6/+11
|
* Use `querySelector` over alternative DOM methods (#31280)silverwind2024-06-1047-168/+165
| | | | | | | | | | | | | | | | As per https://github.com/go-gitea/gitea/pull/30115#discussion_r1626060164, prefer `querySelector` by enabling [`unicorn/prefer-query-selector`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md) and autofixing all except 10 issues. According to [this](https://old.reddit.com/r/learnjavascript/comments/i0f5o8/performance_of_getelementbyid_vs_queryselector/), querySelector may be faster as well, so it's a win-win. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Remove jQuery `.text()` (#30506)silverwind2024-06-1012-168/+160
| | | | | | | | | Remove and forbid [.text()](https://api.jquery.com/text/). Tested some, but not all functionality, but I think these are pretty safe replacements. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-101-0/+110
|
* Remove sub-path from container registry realm (#31293)wxiaoguang2024-06-095-14/+23
| | | | Container registry requires that the "/v2" must be in the root, so the sub-path in AppURL should be removed
* Fix some URLs whose sub-path is missing (#31289)wxiaoguang2024-06-073-3/+3
| | | Fix #31285
* Fix and clean up `ConfirmModal` (#31283)silverwind2024-06-075-15/+28
| | | | | | | | | | | | | | | | Bug: orange button color was removed in https://github.com/go-gitea/gitea/pull/30475, replaced with red Bug: translation text was not html-escaped Refactor: Replaced as much jQuery as possible, added useful `createElementFromHTML` Refactor: Remove colors checks that don't exist on `.link-action` <img width="381" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/5900bf6a-8a86-4a86-b368-0559cbfea66e"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de>