summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary template helper repoAvatar (#26387)wxiaoguang2023-08-086-42/+16
| | | And simplify the "repo/icon" code
* Start using template context function (#26254)wxiaoguang2023-08-0812-22/+91
| | | | | | | | | | | | | | | | | | | | | | Before: * `{{.locale.Tr ...}}` * `{{$.locale.Tr ...}}` * `{{$.root.locale.Tr ...}}` * `{{template "sub" .}}` * `{{template "sub" (dict "locale" $.locale)}}` * `{{template "sub" (dict "root" $)}}` * ..... With context function: only need to `{{ctx.Locale.Tr ...}}` The "ctx" could be considered as a super-global variable for all templates including sub-templates. To avoid potential risks (any bug in the template context function package), this PR only starts using "ctx" in "head.tmpl" and "footer.tmpl" and it has a "DataRaceCheck". If there is anything wrong, the code can be fixed or reverted easily.
* Allow package cleanup from admin page (#25307)KN4CK3R2023-08-087-7/+45
| | | | | | | | | | | | | | | Until now expired package data gets deleted daily by a cronjob. The admin page shows the size of all packages and the size of unreferenced data. The users (#25035, #20631) expect the deletion of this data if they run the cronjob from the admin page but the job only deletes data older than 24h. This PR adds a new button which deletes all expired data. ![grafik](https://github.com/go-gitea/gitea/assets/1666336/b3e35d73-9496-4fa7-a20c-e5d30b1f6850) --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix text truncate (#26354)Maxim Slipenko2023-08-071-1/+1
| | | | | | | | | | | | | | | Fixes: https://github.com/go-gitea/gitea/issues/25597 Before: ![image](https://github.com/go-gitea/gitea/assets/36362599/c8c27bcb-469f-4def-8521-d9e054c16ecb) After: ![image](https://github.com/go-gitea/gitea/assets/36362599/2405b6e8-fc5c-4b13-b66b-007bc11edbc4) Co-authored-by: Giteabot <teabot@gitea.io>
* Fix incorrect sort link with `.profile` repository (#26374)CaiCandong2023-08-071-10/+10
| | | fix #26360
* Use more `IssueList` instead of `[]*Issue` (#26369)Lunny Xiao2023-08-074-8/+7
|
* Rename code_langauge.go to code_language.go (#26377)cassiozareck2023-08-071-0/+0
|
* Add changelog for 1.20.3 (#26373)delvh2023-08-071-3/+32
|
* Do not highlight `#number` in documents (#26365)Earl Warren2023-08-073-1/+61
| | | | | | | | | | | | | | - Currently the post processing will transform all issue indexes (such as `#6`) into a clickable link. - This makes sense in an situation like issues or PRs, where referencing to other issues is quite common and only referencing their issue index is an handy and efficient way to do it. - Currently this is also run for documents (which is the user profile and viewing rendered files), but in those situations it's less common to reference issues by their index and instead could mean something else. - This patch disables this post processing for issue index for documents. Matches Github's behavior. - Added unit tests. - Resolves https://codeberg.org/Codeberg/Community/issues/1120 Co-authored-by: Gusted <postmaster@gusted.xyz>
* Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect ↵wxiaoguang2023-08-073-9/+59
| | | | | | IssueIndex (#26279) Close #26277 Fix #26285
* Fix nil pointer dereference error when open link with invalid pull index ↵CaiCandong2023-08-072-29/+30
| | | | | | | | | | | | | (#26353) fix #26331 Before: ![image](https://github.com/go-gitea/gitea/assets/50507092/028e6944-84d1-4404-80b6-4a4accdc7d0a) After: ![image](https://github.com/go-gitea/gitea/assets/50507092/b78978f9-e77f-459f-96e1-3a1f36ec8abe)
* [skip ci] Updated licenses and gitignoresGiteaBot2023-08-073-0/+27
|
* Display human-readable text instead of cryptic filemodes (#26352)delvh2023-08-063-2/+30
| | | | | | | | | | | | | | | | Now, you don't need to be a git expert anymore to know what these numbers mean. ## Before ![grafik](https://github.com/go-gitea/gitea/assets/51889757/9a964bf6-10fd-40a6-aeb2-ac8f437f8c32) ## After ![grafik](https://github.com/go-gitea/gitea/assets/51889757/84573cb9-55b6-4dde-9866-95f71b657554) or when the mode actually changed: ![grafik](https://github.com/go-gitea/gitea/assets/51889757/0f327538-ebdc-40e7-8c99-f9e21b67f638)
* [docs] Add missing backtick in quickstart.zh-cn.md (#26349)Track32023-08-061-1/+1
| | | | | | Added missing backtick in quickstart.zh-cn.md docs so inline code can render properly. Co-authored-by: Giteabot <teabot@gitea.io>
* Fix incorrect CLI exit code and duplicate error message (#26346)wxiaoguang2023-08-054-27/+98
| | | Follow the CLI refactoring, and add tests.
* Improve CLI and messages (#26341)wxiaoguang2023-08-052-52/+17
| | | | | | | Follow the CLI refactoring 1. Remove the "checkCommandFlags" helper 2. Unify the web startup message, make them have consistent names as `./gitea help` 3. Fine tune some other messages (see the diff)
* Remove backslashed newlines on markdown (#26344)Lunny Xiao2023-08-051-2/+2
| | | Fix https://gitea.com/gitea/gitea-docusaurus/issues/56
* Hide `last indexed SHA` when a repo could not be indexed yet (#26340)CaiCandong2023-08-051-2/+4
| | | | | | | | | Now, for a new repo without any commit, the Last indexed SHA field looks like this: Before: ![image](https://github.com/go-gitea/gitea/assets/50507092/cecc6e24-3366-4093-ae07-c361ea34b373) After: ![image](https://github.com/go-gitea/gitea/assets/50507092/9b6ba703-b0d5-4648-ad6b-9a2341dd60f9) Fixes #26336
* Fix log typo in task.go (#26337)cassiozareck2023-08-051-1/+1
| | | Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
* Prevent newline errors with Debian packages (#26332)KN4CK3R2023-08-052-11/+12
| | | Fixes #26313
* Fix the bug when getting files changed for `pull_request_target` event (#26320)Zettat1232023-08-054-13/+77
| | | | | | | | | | | Follow #25229 Copy from https://github.com/go-gitea/gitea/pull/26290#issuecomment-1663135186 The bug is that we cannot get changed files for the `pull_request_target` event. This event runs in the context of the base branch, so we won't get any changes if we call `GetFilesChangedSinceCommit` with `PullRequest.Base.Ref`.
* Refactor backend SVG package and add tests (#26335)wxiaoguang2023-08-054-38/+111
| | | | Introduce a well-tested `svg.Normalize` function. Make `RenderHTML` faster and more stable.
* Fix bug with sqlite load read (#26305)Lunny Xiao2023-08-054-10/+25
| | | Possible fix #26280
* Remove commit load branches and tags in wiki repo (#26304)yp053272023-08-041-0/+2
| | | | | | | | | | If click `load branches and tags`, you will get 500 error from backend, as it is a wiki repo. ![image](https://github.com/go-gitea/gitea/assets/18380374/1eb2a68b-cc72-4607-a1d1-4f74f83623f6) ![image](https://github.com/go-gitea/gitea/assets/18380374/c385de25-0cfb-4084-9452-d7e9d27deea9) Co-authored-by: Giteabot <teabot@gitea.io>
* Add highlight to selected repos in milestone dashboard (#26300)yp053272023-08-041-3/+14
| | | | | | | | | | | Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/d3fa1e15-423a-4216-8a60-b02f5aa4f5d3) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/643df586-ec2f-4480-b7a0-bd252883d761) Co-authored-by: Giteabot <teabot@gitea.io>
* Do not show Profile README when repository is private (#26295)Nicholas Pease2023-08-041-1/+1
| | | | | | | | As mentioned in the original thread (#23260) and in the enhancements PR #24753, this PR ensures the .profile repository is public before the README file is shown. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix incorrect color of selected assignees when create issue (#26324)yp053272023-08-041-0/+2
| | | | | | | | | | | Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/75d610b2-3823-4366-be85-c77c9106feff) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/15afc6ac-f5ad-4e24-8983-fea8ace5921f) Co-authored-by: Giteabot <teabot@gitea.io>
* Delete `issue_service.CreateComment` (#26298)caicandong2023-08-045-31/+17
| | | | | | | I noticed that `issue_service.CreateComment` adds transaction operations on `issues_model.CreateComment`, we can merge the two functions and we can avoid calling each other's methods in the `services` layer. Co-authored-by: Giteabot <teabot@gitea.io>
* Make git batch operations use parent context timeout instead of default ↵wxiaoguang2023-08-041-0/+4
| | | | | | | | | timeout (#26325) Fix #26064 Some git commands should use parent context, otherwise it would exit too early (by the default timeout, 10m), and the "cmd.Wait" waits till the pipes are closed.
* Fix typos and grammer problems for actions documentation (#26328)sillyguodong2023-08-042-16/+19
| | | | follow #26317 fix typos and adjust grammer problems.
* Update documentation for 1.21 actions (#26317)sillyguodong2023-08-042-4/+60
| | | | | As title. Close #26309 Related to #24724, #24806
* Fix the wrong derive path (#26271)Lunny Xiao2023-08-042-17/+215
| | | | | | | | | | | | | This PR will fix #26264, caused by #23911. The package configuration derive is totally wrong when storage type is local in that PR. This PR fixed the inherit logic when storage type is local with some unit tests. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support getting changed files when commit ID is `EmptySHA` (#26290)Zettat1232023-08-043-3/+50
| | | | | | | | | | | | | | | | | | | | Fixes #26270. Co-Author: @wxiaoguang Thanks @lunny for providing this solution As https://github.com/go-gitea/gitea/issues/26270#issuecomment-1661695151 said, at present we cannot get the names of changed files correctly when the `OldCommitID` is `EmptySHA`. In this PR, the `GetCommitFilesChanged` method is added and will be used to get the changed files by commit ID. References: - https://stackoverflow.com/a/424142 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add `Retry` button when creating a mirror-repo fails (#26228)Kerwin Bryant2023-08-046-4/+57
| | | | | | | | | | | | | | | fixed #26156 * Added a retry button in the frontend (only displayed when the status is abnormal) * After clicking Retry, the backend adds the task back to the task queue ![7UJDNM671RI})EA8~~XPL39](https://github.com/go-gitea/gitea/assets/3371163/e088fd63-5dcc-4bc6-8849-7db3086511b7) ![T83F1WL9)VGHR@MB956$VT9](https://github.com/go-gitea/gitea/assets/3371163/744425bb-dde1-4315-be2e-5c99ac3a44d4) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2023-08-041-13/+13
|
* Add locale for deleted head branch (#26296)yp053272023-08-032-2/+4
| | | | | | | | As title. It will be displayed in: ![image](https://github.com/go-gitea/gitea/assets/18380374/e8507a3b-14f4-4418-a347-a36689707a16)
* Use yellow if an approved review is stale (#26312)sebastian-sauer2023-08-041-0/+3
| | | | | | | | | | | | | | By using a different color it's clear that the review isn't pointing to the latest commit. **Screenshots:** Not stale review: ![image](https://github.com/go-gitea/gitea/assets/1135157/2901ad69-e0d8-4041-b760-277d02dafd45) Stale review: ![image](https://github.com/go-gitea/gitea/assets/1135157/500b306e-a994-42d4-a2fd-1174774ba5ee) fixes #26306
* Remove nonsense `<a>` for commit status check icon (#26287)yp053272023-08-031-2/+2
| | | | | | | | | We are using `<a>` for commit status check icon with no link. So it is clickable but this is no sense. I think we can convert this to `div`. ![image](https://github.com/go-gitea/gitea/assets/18380374/23db1a11-b0c7-4444-bfa6-fe68aeb1c682) Co-authored-by: Giteabot <teabot@gitea.io>
* Make confusable character warning less jarring (#25069)Panagiotis "Ivory" Vasilopoulos2023-08-032-5/+5
| | | | | | | | | | | | | | | This commit assumes that the warning can be made more discreet so as to make it less annoying for the people that do not actually need the warning, without necessarily increasing the risk for those that do need it. This doesn't fix the underlying problem of the warning being shown in certain cases that, say, a certain kind of whitespace character like 0x1E could be absolutely justifiable from a technical perspective. --------- Co-authored-by: delvh <dev.lh@web.de>
* Update Gmail example (#26302)Bård Aase2023-08-031-2/+1
| | | | The `IS_TLS_ENABLED` option in the `mailer` section is deprecated. This is specified by setting `PROTOCOL=smtps`
* Fix the topic validation rule and suport dots (#26286)wxiaoguang2023-08-034-3/+5
| | | | | 1. Allow leading and trailing spaces by user input, these spaces have already been trimmed at backend 2. Allow using dots in the topic
* Upgrade x/net to 0.13.0 (#26297)Lunny Xiao2023-08-032-3/+3
|
* add unit test for user renaming (#26261)Earl Warren2023-08-031-0/+64
| | | | | | | | | | | | | - The user renaming function has zero test coverage. - This patch brings that up to speed to test for various scenarios and ensure that in a normal workflow the correct things has changed to their respective new value. Most scenarios are to ensure certain things DO NOT happen. (cherry picked from commit 5b9d34ed115c9ef24012b8027959ea0afdcb4e2d) Refs: https://codeberg.org/forgejo/forgejo/pulls/1156 Co-authored-by: Gusted <postmaster@gusted.xyz>
* add some Wiki unit tests (#26260)Earl Warren2023-08-031-0/+12
| | | | | | | | | | - Just to get 100% coverage on services/wiki/wiki_path.go, nothing special. This is just an formality. (cherry picked from commit 6b3528920fbf18c41d6aeb95498af48443282370) Refs: https://codeberg.org/forgejo/forgejo/pulls/1156 Co-authored-by: Gusted <postmaster@gusted.xyz>
* Clarify the logger's MODE config option (#26267)wxiaoguang2023-08-012-1/+4
| | | | | | | 1. Fix the wrong document (add the missing `MODE=`) 2. Add a more friendly log message to tell users to add `MODE=` in their config Co-authored-by: Giteabot <teabot@gitea.io>
* speed up TestEventSourceManagerRun (#26262)Earl Warren2023-08-011-0/+4
| | | | | | | | | | | | | - `setting.UI.Notification.EventSourceUpdateTime` is by default 10 seconds, which adds an 10 second delay before the test succeeds. - Lower the interval to reduce it to at most 3 second delay (the code only send events when they are at least 2 seconds old). (cherry picked from commit 3adb9ae6009ff3ddebaed4875e086343f668ef7b) Refs: https://codeberg.org/forgejo/forgejo/pulls/1166 Co-authored-by: Gusted <postmaster@gusted.xyz> Co-authored-by: Giteabot <teabot@gitea.io>
* Merge `templates/projects/list.tmpl` and `templates/repo/projects/list.tmpl` ↵Earl Warren2023-08-013-100/+3
| | | | | | | | | | together (#26265) (cherry picked from commit 473862a1d599382ca022482e2e044025872d240b) Refs: https://codeberg.org/forgejo/forgejo/pulls/1126 Co-authored-by: Louis Seubert <louis.seubert.ls@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Allow editing push mirrors after creation (#26151)puni98692023-08-015-4/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow users to edit the sync interval for existing push mirrors. Currently, there is no way to modify the interval once the mirror is created. <details> <summary>Screenshots</summary> ## Before <img width="936" alt="Screenshot 2023-07-26 at 9 31 21 AM" src="https://github.com/go-gitea/gitea/assets/80308335/35b8a40c-4320-474c-a866-1dea0f1fa0de"> ## After <img width="945" alt="Screenshot 2023-07-26 at 9 44 40 AM" src="https://github.com/go-gitea/gitea/assets/80308335/ee12e12f-0f68-4feb-90eb-33366f5997d3"> ### On hover <img width="247" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/2f32de45-bd50-4150-9623-3be2ef3ea7f8"> <img width="237" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/49f4ab4d-ccff-4489-80ce-a9788a73c3bb"> <img width="245" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/165fc888-9d48-438a-b730-d4beb12122af"> ### Edit modal <img width="905" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/2a7ca24b-4f36-4e0e-9799-39f2ecc46413"> ### Only valid times are allowed <img width="728" alt="Screenshot 2023-07-26 at 9 50 01 AM" src="https://github.com/go-gitea/gitea/assets/80308335/ced6d330-c235-4e29-8f17-28daddcf1444"> <img width="853" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/8636f62a-70d1-4684-a3e8-b205adc03580"> </details> Fixes #21295 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update Arch linux URL from community to extra (#26273)minijaws2023-08-011-1/+1
| | | | Arch linux package link has changed from the community repo to the extra repo. The link has been updated.
* Fix due date rendering the wrong date in issue (#26268)Yarden Shoham2023-08-011-1/+1
| | | | | | | | | | | | | | | Closes #26263 We have to pass the date without the time. # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/6b6cb43d-2b1c-4679-951d-20f48c94bfdd) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/50441baf-2c52-452b-bb0d-6034a407abde) Signed-off-by: Yarden Shoham <git@yardenshoham.com>