aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* remove util.OptionalBool and related functions (#29513)65432024-03-0271-355/+308
| | | | | | and migrate affected code _last refactoring bits to replace **util.OptionalBool** with **optional.Option[bool]**_
* Rename Action.GetDisplayName to GetActDisplayName (#29540)wxiaoguang2024-03-022-5/+5
| | | | | | To avoid conflicting with User.GetDisplayName, because there is no data type in template. And it matches other methods like GetActFullName / GetActUserName
* Make PR form use toast to show error message (#29545)wxiaoguang2024-03-027-30/+35
| | | ![image](https://github.com/go-gitea/gitea/assets/2114189/b7a14ed6-db89-4f21-a590-66cd33307233)
* Fix a bug returning 404 when display a single tag with no release (#29466)Lunny Xiao2024-03-025-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Partially caused by #29149 When use ```go releases, err := getReleaseInfos(ctx, &repo_model.FindReleasesOptions{ ListOptions: db.ListOptions{Page: 1, PageSize: 1}, RepoID: ctx.Repo.Repository.ID, TagNames: []string{ctx.Params("*")}, // only show draft releases for users who can write, read-only users shouldn't see draft releases. IncludeDrafts: writeAccess, }) ``` replace ```go release, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, ctx.Params("*")) ``` It missed `IncludeTags: true,`. That means this bug will be occupied only when the release is a tag. This PR will fix - Get the right tag record when it's not a release - Display correct tag tab but not release tag when it's a tag. - The button will bring the tag name to the new page when it's a single tag page - the new page will automatically hide the release target inputbox when the tag name is pre filled. This should be backport to v1.21.
* Add a check for when the command is canceled by the program on Window… ↵charles2024-03-021-0/+12
| | | | | | | | | | | | | | | | | | (#29538) Close #29509 Windows, unlike Linux, does not have signal-specified exit codes. Therefore, we should add a Windows-specific check for Windows. If we don't do this, the logs will always show a failed status, even though the command actually works correctly. If you check the Go source code in exec_windows.go, you will see that it always returns exit code 1. ![image](https://github.com/go-gitea/gitea/assets/30816317/9dfd7c70-9995-47d9-9641-db793f58770c) The exit code 1 does not exclusively signify a SIGNAL KILL; it can indicate any issue that occurs when a program fails.
* Fix incorrect redirection when creating a PR fails (#29537)wxiaoguang2024-03-025-24/+6
| | | | | | | | | | | This is only a quick fix to make it easier to backport. After this PR gets merged, I will propose a new PR to fix the FIXME. <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/98d1d5c4-2e79-4a75-80e9-76fd898986e0) </details>
* Fix incorrect subpath in links (#29535)wxiaoguang2024-03-024-4/+4
| | | | | | * `$referenceUrl`: it is constructed by "Issue.Link", which already has the "AppSubURL" * `window.location.href`: AppSubURL could be empty string, so it needs the trailing slash
* Fix issue link does not support quotes (#29484) (#29487)charles2024-03-022-2/+6
| | | | | Close #29484 ![圖片](https://github.com/go-gitea/gitea/assets/30816317/b27e6e16-67e0-469c-8e04-30180c585890)
* Remove jQuery AJAX from the repo tag edit form (#29526)Yarden Shoham2024-03-021-29/+30
| | | | | | | | | | | | - Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the repo tag edit form functionality and it works as before # Demo using `fetch` instead of jQuery AJAX ![action](https://github.com/go-gitea/gitea/assets/20454870/11126bc4-1666-44ae-8644-a6351da43514) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Actions Artifacts v4 backend (#28965)ChristopherHX2024-03-0211-23/+2028
| | | | | | | | | | Fixes #28853 Needs both https://gitea.com/gitea/act_runner/pulls/473 and https://gitea.com/gitea/act_runner/pulls/471 on the runner side and patched `actions/upload-artifact@v4` / `actions/download-artifact@v4`, like `christopherhx/gitea-upload-artifact@v4` and `christopherhx/gitea-download-artifact@v4`, to not return errors due to GHES not beeing supported yet.
* Remove jQuery AJAX from common global functions (#29528)Yarden Shoham2024-03-021-14/+12
| | | | | | | | | | | - Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the locale change functionality and it works as before - Tested the delete button functionality and it works as before # Demo using `fetch` instead of jQuery AJAX ![action](https://github.com/go-gitea/gitea/assets/20454870/8a024f75-c2a5-4bff-898d-ca751d2489f1) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Allow options to disable user gpg keys configuration from the interface on ↵Lunny Xiao2024-03-027-4/+31
| | | | | | | | app.ini (#29486) Follow #29447 Fix #29454 Extract from #20549
* [skip ci] Updated translations via CrowdinGiteaBot2024-03-021-0/+2
|
* Fix issue & comment history bugs (#29525)wxiaoguang2024-03-013-7/+26
| | | | | | * Follow #17746: `HasIssueContentHistory` should use expr builder to make sure zero value (0) be respected. * Add "doer" check to make sure `canSoftDeleteContentHistory` only be called by sign-in users.
* Fix incorrect diff expander for deletion of last lines in a file (#29501)silverwind2024-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: https://github.com/go-gitea/gitea/issues/29498 I don't quite understand this code, but this change does seem to fix the issue and I tested a number of diffs with it and saw no issue. The function gets such value if last line is an addition: ``` LastLeftIdx: (int) 0, LastRightIdx: (int) 47, LeftIdx: (int) 47, RightIdx: (int) 48, ``` If it's a deletion, it gets: ``` LastLeftIdx: (int) 47, LastRightIdx: (int) 0, LeftIdx: (int) 48, RightIdx: (int) 47, ``` So I think it's correct to make this check respect both left and right side.
* Ignore `__debug_bin*` which is generated by vscode when debugging (#29524)sillyguodong2024-03-011-1/+1
| | | | When debugging in VSCode now, the executable file generated will come with a random string attached.
* Set pre-step status to `skipped` if job is skipped (#29489)sillyguodong2024-03-011-0/+3
| | | | | | | | | | | | | | | close #27496 1. Set pre-step (Set up job) status to `skipped` if job is skipped. 2. Apart from pre-step, the other steps should also be set to `skipped`. The status of other steps are reported from the runner side. This will be completed by this PR: https://gitea.com/gitea/act_runner/pulls/500 before: ![image](https://github.com/go-gitea/gitea/assets/33891828/4bac2ba9-66de-4679-b7ed-fbae459c0c54) after: ![image](https://github.com/go-gitea/gitea/assets/33891828/ead4871a-4e0f-4bb1-9fb4-37f4fdb78dfc)
* Use a predictiable fork URL to allow forking repositories without providing ↵wxiaoguang2024-03-015-30/+8
| | | | | | | | | | a repo ID (#29519) Close #29512 The "fork" URL: * Before: `/repo/fork/{RepoID}` * After: `/{OwnerName}/{RepoName}/fork`
* Adding back missing options to app.example.ini (#29511)Origami4042024-03-011-0/+6
| | | | | | | | | | | | | | | | In the refactoring of the configuration file #15807, some lines were accidentally deleted: DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false ENABLE_PUSH_CREATE_USER = false ENABLE_PUSH_CREATE_ORG = false Fix #29510 --------- Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor the "attachments" sub-template data key to RenderedContent (#29517)wxiaoguang2024-03-015-7/+7
| | | | | The value passed into "attachments" sub-template is from "RedneredContent", so use the same name for consistent. And it makes readers easy to know its data type.
* Rename Str2html to SanitizeHTML and clarify its behavior (#29516)wxiaoguang2024-03-0114-43/+48
| | | | | Str2html was abused a lot. So use a proper name for it: SanitizeHTML And add some tests to show its behavior.
* Add admin API route for managing user's badges (#23106)techknowlogick2024-03-019-2/+523
| | | | | | | Fix #22785 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Refactor some Str2html code (#29397)wxiaoguang2024-03-0132-61/+91
| | | | | | | | | | | | | | | This PR touches the most interesting part of the "template refactoring". 1. Unclear variable type. Especially for "web/feed/convert.go": sometimes it uses text, sometimes it uses HTML. 2. Assign text content to "RenderedContent" field, for example: ` project.RenderedContent = project.Description` in web/org/projects.go 3. Assign rendered content to text field, for example: `r.Note = rendered content` in web/repo/release.go 4. (possible) Incorrectly calling `{{Str2html .PackageDescriptor.Metadata.ReleaseNotes}}` in package/content/nuget.tmpl, I guess the name Str2html misleads developers to use it to "render string to html", but it only sanitizes. if ReleaseNotes really contains HTML, then this is not a problem.
* Move migration functions to services layer (#29497)Lunny Xiao2024-03-015-248/+267
|
* Don’t comment when locking (#29508)techknowlogick2024-03-011-4/+0
| | | | | This reduces the number of emails/notifications on outdated issues. Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2024-03-012-1/+39
|
* migrate some more "OptionalBool" to "Option[bool]" (#29479)65432024-02-2923-174/+183
| | | | | | | | just some refactoring bits towards replacing **util.OptionalBool** with **optional.Option[bool]** --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Update FAQ about git hook problems (#29495)Jason Song2024-02-292-4/+8
| | | | Close https://github.com/go-gitea/gitea/issues/29338#issuecomment-1970363817
* Lighten text colors on dark theme for increased contrast (#29481)silverwind2024-02-292-16/+16
| | | | | Improve contrast by lightening the text colors in dark theme by around 35%. Additionally, share some variables that had the same or similar color, which will ease future theme creation.
* Fix wrong test usage of `AppSubURL` (#29459)KN4CK3R2024-02-292-31/+26
| | | | The tests use an invalid `setting.AppSubURL`. The wrong behaviour disturbs other PRs like #29222 and #29427.
* Improve contrast on blame timestamp, fix double border (#29482)silverwind2024-02-291-1/+5
| | | | | | | | | | | | | Before, double border on top, bad contrast on dark: <img width="155" alt="Screenshot 2024-02-29 at 02 06 17" src="https://github.com/go-gitea/gitea/assets/115237/fc0f1e08-a5ce-47ed-9eb6-135eed5a1abb"> <img width="126" alt="Screenshot 2024-02-29 at 02 07 28" src="https://github.com/go-gitea/gitea/assets/115237/38ae8483-8d9b-484c-8909-d4466131ea16"> After, no double border on top, good contrast: <img width="154" alt="Screenshot 2024-02-29 at 02 20 20" src="https://github.com/go-gitea/gitea/assets/115237/ad91282b-e9f5-4f41-8f5e-6ba28db3beac"> <img width="147" alt="Screenshot 2024-02-29 at 02 20 38" src="https://github.com/go-gitea/gitea/assets/115237/7ee2ec92-e72a-4981-aec3-98fc8e579bae">
* Fix/Improve `processWindowErrorEvent` (#29407)silverwind2024-02-281-21/+36
| | | | | | | | - `e.error` can be undefined in some cases which would raise an error inside this error handler, fixed that. - The displayed message mentions looking into the console, but in my case of error from `ResizeObserver` there was nothing there, so add this logging. I think this logging was once there but got lost during refactoring.
* Apply compact padding to small buttons with svg icons (#29471)silverwind2024-02-282-1/+8
| | | | | | | | | | | | | | | | | | | | | | | The buttons on the repo release tab were larger in height than on other tabs because one of them contained the RSS icon which stretched the button height by 3px. Workaround this problem by applying the "compact" padding to any such button. They are within 0.4px in height now to non-icon buttons. Before: <img width="406" alt="Screenshot 2024-02-28 at 15 30 23" src="https://github.com/go-gitea/gitea/assets/115237/805bb93a-6fe4-40a0-82d1-03001bee8ecf"> After: <img width="407" alt="Screenshot 2024-02-28 at 15 38 43" src="https://github.com/go-gitea/gitea/assets/115237/27707588-890f-4852-ab08-105a57eda880"> For comparison, button on issue tab: <img width="452" alt="Screenshot 2024-02-28 at 15 31 46" src="https://github.com/go-gitea/gitea/assets/115237/74ac13d5-d016-49ba-9dd9-40ed32a748e9">
* Fix counter display number incorrectly displayed on the page (#29448)charles2024-02-281-0/+2
| | | | | | | | | | | | | | | issue : #28239 The counter number script uses the 'checkbox' attribute to determine whether an item is selected or not. However, the input event only increments the counter value, and when more items are displayed, it does not update all previously loaded items. As a result, the display becomes incorrect because it triggers the update counter script, but checkboxes that are selected without the 'checked' attribute are not counted
* Fix incorrect user location link on profile page (#29474)wxiaoguang2024-02-281-2/+3
| | | Fix #29472. Regression of #29236, a "if" check was missing.
* Fix workflow trigger event bugs (#29467)Zettat1232024-02-282-1/+10
| | | | | | 1. Fix incorrect `HookEventType` for issue-related events in `IssueChangeAssignee` 2. Add `case "types"` in the `switch` block in `matchPullRequestEvent` to avoid warning logs
* Fix URL calculation in clone input box (#29470)silverwind2024-02-282-9/+18
| | | | | | Ported the function as-is and added comments so we don't forget about this in the future. Fixes: https://github.com/go-gitea/gitea/issues/29462
* Remove jQuery from the "find file" page (#29456)Yarden Shoham2024-02-281-31/+29
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the file searching functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/8ceef0ed-ab87-448c-8b9b-9b5c0cd8bebd) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Move generate from module to service (#29465)Lunny Xiao2024-02-288-82/+97
|
* The job should always run when `if` is `always()` (#29464)Zettat1232024-02-282-1/+76
| | | | | | | | | | | | | | | Fix #27906 According to GitHub's [documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds), a job should always run when its `if` is `always()` > If you would like a job to run even if a job it is dependent on did not succeed, use the `always()` conditional expression in `jobs.<job_id>.if`. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Recolor dark theme to blue shade (#29283)silverwind2024-02-281-95/+95
| | | | | | | | | | | | | | | | | | Now uses the same primary color as light theme. The secondary colors are shifted towards a slightly blue shade. Could maybe desaturate a bit more, but overall I think I'm happy with it. Fixes: https://github.com/go-gitea/gitea/issues/27097 <img width="1343" alt="Screenshot 2024-02-27 at 22 21 46" src="https://github.com/go-gitea/gitea/assets/115237/4163c393-b469-4a53-8f4b-1c33aa04f3ac"> <img width="581" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/e621f7f8-5679-4605-bf42-3d5ff1071e1e"> <img width="581" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/20e66493-2457-482b-b8f1-e5710934e189"> --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Let ctx.FormOptionalBool() return optional.Option[bool] (#29461)65432024-02-285-19/+22
| | | | just some refactoring bits towards replacing **util.OptionalBool** with **optional.Option[bool]**
* Implement actions badge svgs (#28102)Nanguan Lin2024-02-276-0/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replace #27187 close #23688 The badge has two parts: label(workflow name) and message(action status). 5 colors are provided with 7 statuses. Color mapping: ```go var statusColorMap = map[actions_model.Status]string{ actions_model.StatusSuccess: "#4c1", // Green actions_model.StatusSkipped: "#dfb317", // Yellow actions_model.StatusUnknown: "#97ca00", // Light Green actions_model.StatusFailure: "#e05d44", // Red actions_model.StatusCancelled: "#fe7d37", // Orange actions_model.StatusWaiting: "#dfb317", // Yellow actions_model.StatusRunning: "#dfb317", // Yellow actions_model.StatusBlocked: "#dfb317", // Yellow } ``` preview: ![1](https://github.com/go-gitea/gitea/assets/70063547/5465cbaf-23cd-4437-9848-2738c3cb8985) ![2](https://github.com/go-gitea/gitea/assets/70063547/ec393d26-c6e6-4d38-b72c-51f2494c5e71) ![3](https://github.com/go-gitea/gitea/assets/70063547/3edb4fdf-1b08-4a02-ab2a-6bdd7f532fb2) ![4](https://github.com/go-gitea/gitea/assets/70063547/8c189de2-2169-4251-b115-0e39a52f3df8) ![5](https://github.com/go-gitea/gitea/assets/70063547/3fe22c73-c2d7-4fec-9ea4-c501a1e4e3bd) --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: delvh <dev.lh@web.de>
* Fix missed return (#29450)Lunny Xiao2024-02-271-0/+1
|
* Use tailwind instead of `gt-[wh]-` helper classes (#29423)Lunny Xiao2024-02-277-16/+10
| | | | | Follow #29357 - Replace `gt-w-*` -> `tw-w-*` and remove `gt-w-*` - Replace `gt-h-*` -> `tw-h-*` and remove `gt-h-*`
* Lock issues and pulls faster (#29436)65432024-02-271-1/+6
| | | | | also point to the docs to explain why we do so followup to #29433
* Allow to change primary email before account activation (#29412)wxiaoguang2024-02-277-43/+91
|
* Update docs about `DEFAULT_ACTIONS_URL` (#29442)Jason Song2024-02-272-16/+15
| | | Follow #25581.
* Only use supported sort order for "explore/users" page (#29430)wxiaoguang2024-02-275-6/+79
| | | | | | | | | | | | | | Thanks to inferenceus : some sort orders on the "explore/users" page could list users by their lastlogintime/updatetime. It leaks user's activity unintentionally. This PR makes that page only use "supported" sort orders. Removing the "sort orders" could also be a good solution, while IMO at the moment keeping the "create time" and "name" orders is also fine, in case some users would like to find a target user in the search result, the "sort order" might help. ![image](https://github.com/go-gitea/gitea/assets/2114189/ce5c39c1-1e86-484a-80c3-33cac6419af8)
* Not trigger all jobs any more, when re-running the first job (#29439)sillyguodong2024-02-271-3/+8
| | | | | Previously, it will be treated as "re-run all jobs" when `jobIndex == 0`. So when you click re-run button on the first job, it triggers all the jobs actually.