summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Rename actions unit to `repo.actions` and add docs for it (#23733)Jason Song2023-04-034-5/+6
| | | | | | | | | | I neglected that the `NameKey` of `Unit` is not only for translation, but also configuration. So it should be `repo.actions` to maintain consistency. ## :warning: BREAKING :warning: If users already use `actions.actions` in `DISABLED_REPO_UNITS` or `DEFAULT_REPO_UNITS`, it will be treated as an invalid unit key.
* Try to catch more broken translations (#23867)wxiaoguang2023-04-031-5/+30
| | | | | | Result: #23866 Gitea should drop the ``` ` ``` as string quoter, it is not recognized by Crowdin and it causes problem for translators.
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-034-4/+4
|
* Update JS deps (#23853)silverwind2023-04-025-342/+409
| | | | | - Update all JS dependencies - Regenerate svgs - Tested heatmap, swagger, citation
* Added close/open button to details page of milestone (#23877)Bartlomiej Komendarczuk2023-04-031-0/+7
| | | | | | | | | Depending on the current state, a close or open button appears. Close https://github.com/go-gitea/gitea/issues/19083 --- ![image](https://user-images.githubusercontent.com/11333925/229367898-844ff790-c725-440a-9cf7-242c7745d643.png) ![image](https://user-images.githubusercontent.com/11333925/229367873-6a77fceb-1627-41d4-9d76-1f10ba2b278b.png)
* Check `IsActionsToken` for LFS authentication (#23841)Zettat1232023-04-021-1/+19
| | | | | | | Close #23824 Actions cannot fetch LFS objects from private repos because we don't check if the user is the `ActionUser`.
* Prefill input values in oauth settings as intended (#23829)yp053272023-04-021-7/+7
|
* Display image size for multiarch container images (#23821)KN4CK3R2023-04-028-22/+198
| | | | | | | | Fixes #23771 Changes the display of different architectures for multiarch images to show the image size: ![grafik](https://user-images.githubusercontent.com/1666336/228781477-cc76c4d1-4728-434f-8a27-fc008790d924.png)
* Use clippie module to copy to clipboard (#23801)silverwind2023-04-025-45/+13
| | | | | | | | | | | | Externalize clipboard copying to the [clippie](https://github.com/silverwind/clippie) module which I feel I can maintain outside this repo for shared benefit with my other projects. The module is feature-equivalent to the previous code and has one improvement where it sets `aria-hidden` on the fallback textarea, preventing screen readers from picking it up. Also it support `Array` of `content` as well to copy multiple items at once, in case it's ever needed.
* Remove assertion debug code for show/hide refactoring (#23576)wxiaoguang2023-04-021-26/+0
| | | | | | | | | | | | | | | | | | | | When doing the refactoring: * #22950 I added some debug mode code (assertShown) to help to catch bugs, it did catch some bugs like: * #23074 If it has been proved that there is no more bugs, this assertion could be removed easily and clearly. Feel free to decide when to remove it (feel free to convert it from Draft to Ready for Review). cc: @silverwind
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-023-8/+28
|
* Remove jQuery ready usage (#23858)silverwind2023-04-013-3/+11
| | | | Replace it with equal function of our own and enable the eslint rule to forbid future usage.
* Fix JS error when changing PR's target branch (#23862)wxiaoguang2023-04-011-2/+0
| | | | | | | | | | | | | | Caught by @justusbunsi An old bug from #6488 In `pullrequest_targetbranch_change`, the `data` might be empty, because `UpdatePullRequestTarget` may respond `http.StatusNoContent`. And the old code's `$branchTarget.text(data.base_branch);` doesn't make sense, because in the end, the page will be always reloaded. So, just remove the `$branchTarget.text(data.base_branch);`, everything should be fine.
* Improve action log display with control chars (#23820)wxiaoguang2023-04-015-3/+92
| | | | | | | | | | | Close #23680 Some CLI programs use "\r" and control chars to print new content in current line. So, the strings in one line are actually from `\rReading...1%\rReading...5%\rReading...100%` This PR tries to make the output better.
* Fix review conversation reply (#23846)wxiaoguang2023-04-011-0/+1
| | | | | Regression of #23245 Close #23843
* Improve home page template, fix Sort dropdown menu flash (#23856)wxiaoguang2023-04-012-6/+4
| | | | | | | | | | | | | | | | | | Follow #23854 Major changes: 1. The old `<div class="ui"><div class="six wide column ..."> </div></div>` doesn't have affect any more * So clean them, and remove other unnecessary elements/styles. 2. Add padding for narrow view. Before ![image](https://user-images.githubusercontent.com/2114189/229262177-e8cf6c9b-b17b-482c-83fe-a84579e01e8e.png) After: ![image](https://user-images.githubusercontent.com/2114189/229262166-d46134b0-2117-4d5c-a469-a2115cbd4b6c.png)
* Make first section on home page full width (#23854)silverwind2023-03-311-1/+1
| | | | | | | | | Before: <img width="1272" alt="Screenshot 2023-03-31 at 19 56 16" src="https://user-images.githubusercontent.com/115237/229195611-4570453c-26bf-4663-865b-7e7eb9115060.png"> After: <img width="1270" alt="Screenshot 2023-03-31 at 20 00 14" src="https://user-images.githubusercontent.com/115237/229195639-23841b62-38d8-4e43-8ee5-3f70cba5de6e.png">
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-011-0/+3
|
* Fix incorrect CORS failure detection logic (#23844)wxiaoguang2023-03-311-5/+5
| | | | | | Regression of #23495 Fixes #23838 Fixes #23850
* Fix 500 error if there is a name conflict when edit authentication source ↵yp053272023-03-312-3/+12
| | | | (#23832)
* Use different SVG for pending and running actions (#23836)Hester Gong2023-03-312-2/+6
| | | | | | | | | | | | | | Before: <img width="641" alt="截屏2023-03-31 11 12 17" src="https://user-images.githubusercontent.com/17645053/229013472-237701db-2c30-4477-a7b5-d40640361b14.png"> <img width="576" alt="截屏2023-03-31 11 10 48" src="https://user-images.githubusercontent.com/17645053/229013535-571aa8be-8e58-4d93-8641-9b8b5fd90108.png"> After: <img width="709" alt="截屏2023-03-31 11 05 44" src="https://user-images.githubusercontent.com/17645053/229012963-ccd1e9a7-8bea-4197-aa36-865eafbf8858.png"> <img width="528" alt="截屏2023-03-31 11 06 56" src="https://user-images.githubusercontent.com/17645053/229012971-a7313eb6-ecd2-4da3-89a7-c20be33f4611.png">
* CSS color tweaks (#23828)silverwind2023-03-313-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change grey shades in arc-green to match the theme more: <img width="661" alt="Screenshot 2023-03-30 at 21 42 34" src="https://user-images.githubusercontent.com/115237/228957952-8e099e56-6923-4aa6-8ce9-3c1cd898b73e.png"> Adjusted grey shade in light theme: <img width="652" alt="image" src="https://user-images.githubusercontent.com/115237/228963876-3bde6181-8397-4dc2-be72-33982e6c7acb.png"> Increase contrast in arc-green, change background to slightly darker shade, change forgeground to slightly brighter colors: <img width="283" alt="Screenshot 2023-03-30 at 22 33 20" src="https://user-images.githubusercontent.com/115237/228957957-272c24a5-dd0b-427a-b6b7-e62836bdd73c.png"> Increase contrast of grey text in light theme as well by making them darker: <img width="273" alt="Screenshot 2023-03-30 at 22 33 35" src="https://user-images.githubusercontent.com/115237/228957959-283139c7-6fa7-4b68-9fdd-16c668ad1301.png"> Add color rule for border multiple select items: <img width="183" alt="Screenshot 2023-03-30 at 22 29 31" src="https://user-images.githubusercontent.com/115237/228957954-6b5a752d-bbb0-4519-ab35-d02c0804d955.png"> <img width="181" alt="Screenshot 2023-03-30 at 22 29 46" src="https://user-images.githubusercontent.com/115237/228957956-fca9790a-d6c9-4f31-8d1b-d183ab3ac669.png"> Added color rule for red `*` on required form fields: <img width="97" alt="image" src="https://user-images.githubusercontent.com/115237/228958760-517ad9ef-565d-4349-b734-9b559ab42429.png">
* Clarify Gitea/Crowdin locale behaviors, add tests for LocaleStore, fix some ↵wxiaoguang2023-03-313-15/+62
| | | | | | | | | | | | | strings with semicolons (#23819) Follow #23633 and #23240 Close #23814 Now we almost have a complete test set for Gitea's LocalStore. This PR is still a quick fix for the legacy locale system (see the TODOs), to resolve the problems fundamentally, it needs more work in the future.
* [skip ci] Updated translations via CrowdinGiteaBot2023-03-312-1/+7
|
* Fix dropdown direction behavior (#23806)wxiaoguang2023-03-303-7/+10
| | | | | | | | | | | Close #23803 More details in the comment. ![image](https://user-images.githubusercontent.com/2114189/228728786-7ec942b0-1f21-432d-93eb-575c77508b14.png) ![image](https://user-images.githubusercontent.com/2114189/228728825-62afb85e-7bfb-4702-a8bc-6c2160429978.png)
* Fix incorrect/Improve error handle in edit user page (#23805)yp053272023-03-301-3/+6
| | | | | | | Changes: - `RenderWithErr` should render `tplUserEdit` not `tplUserNew` in edit page - If error occurred in `HandleUsernameChange` redirect to original edit page instead of user list page
* Fix "Updating branch by merge" bug in "update_branch_by_merge.tmpl" (#23790)wxiaoguang2023-03-302-13/+11
| | | | | | | | | | | | | | Fix regression of #22683 , it didn't pass all variables into sub-template. Close #23787 After the fix, all links and the form are correct. ![image](https://user-images.githubusercontent.com/2114189/228511037-580b5f5d-43e7-494f-9b66-89f9f908e208.png) ![image](https://user-images.githubusercontent.com/2114189/228510958-f960284a-101d-4b0e-b887-80033127898d.png)
* Fix incorrect visibility dropdown list in add/edit user page (#23804)yp053272023-03-301-0/+2
| | | | Visibility dropdown list will not work in add/edit user page when error occurred
* Convert issue list checkboxes to native (#23596)silverwind2023-03-305-29/+8
| | | | | | | | | | | | | | | | | | | | | | | | Use native instead of fomantic checkboxes in issue list. Benefits include no more JS pop-in on load and perfect a11y. Before, with JS pop-in: <img width="92" alt="Screenshot 2023-03-20 at 17 02 02" src="https://user-images.githubusercontent.com/115237/226398955-99029a1c-1150-449c-821b-e4165e7446a8.png"> After, Firefox on macOS: <img width="126" alt="Screenshot 2023-03-20 at 17 01 26" src="https://user-images.githubusercontent.com/115237/226399018-58df2c32-c2b2-4c78-b7df-7b76523abe21.png"> After, Chrome on macOS: <img width="79" alt="Screenshot 2023-03-20 at 17 01 42" src="https://user-images.githubusercontent.com/115237/226399074-947e6279-8dc3-42c2-90b5-b106c471b23d.png"> I opted to not do styling yet but I see that the inconsistency between browsers may already be reason enough on doing it. I think if we style them, there should be one global style, including markdown ones which currently have custom styling.
* Fix checks for `needs` in Actions (#23789)Jason Song2023-03-305-21/+22
| | | | | | | | | | | | | | | | | Fix: - https://gitea.com/gitea/act_runner/issues/77 - https://gitea.com/gitea/act_runner/issues/81 Before: <img width="1489" alt="image" src="https://user-images.githubusercontent.com/9418365/228501567-f752cf87-a7ed-42c6-8f3d-ba741795c1fe.png"> Highlights: - Upgrade act to make things doable, related to - https://gitea.com/gitea/act/pulls/32 - https://gitea.com/gitea/act/pulls/33 - https://gitea.com/gitea/act/pulls/35 - Make `needs` works - Sort jobs in the original order in the workflow files
* Diff improvements (#23553)silverwind2023-03-307-40/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoid flash of wrong tree toggle icon on page load by setting icon based on sync state - Avoid "pop-in" of tree on page load by leaving space based on sync state - Use the same border/box-shadow combo used on comment `:target` also for file `:target`. - Refactor `DiffFileTree.vue` to use `toggleElem` instead of hardcoded class name. - Left-align inline comment boxes and make them fit the same amount of markup content on a line as GitHub. - Fix height of `diff-file-list` Fixes: https://github.com/go-gitea/gitea/issues/23593 <img width="1250" alt="Screenshot 2023-03-18 at 00 52 04" src="https://user-images.githubusercontent.com/115237/226071392-6789a644-aead-4756-a77e-aba3642150a0.png"> <img width="1246" alt="Screenshot 2023-03-18 at 00 59 43" src="https://user-images.githubusercontent.com/115237/226071443-8bcba924-458b-48bd-b2f0-0de59cb180ac.png"> <img width="1250" alt="Screenshot 2023-03-18 at 01 27 14" src="https://user-images.githubusercontent.com/115237/226073121-ccb99f9a-d3ac-40b7-9589-43580c4a01c9.png"> <img width="1231" alt="Screenshot 2023-03-19 at 21 44 16" src="https://user-images.githubusercontent.com/115237/226207951-81bcae1b-6b41-4e39-83a7-0f37951df6be.png"> (Yes I'm aware the border-radius in bottom corners is suboptimal, but this would be notorously hard to fix without relying on `overflow: hidden`).
* [Patch] Fix closed PR also triggers Webhooks and actions (#23782)sillyguodong2023-03-301-0/+4
| | | | | | Fix #23707 Cause by #23189 This PR is a quick fix that, when pushing commits to closed PR, webhook and actions also be triggered.
* Improve backport-locales.go (#23807)wxiaoguang2023-03-301-4/+5
| | | | | | | | | ps: there are more broken translation strings in 1.20 (main), most of them are still caused by incorrect quoting/unquoting. For example, translators might write text ``` `my text ```, such incorrect encoding might break crowdin & Gitea's locale package. In the future, a Go `update-locales.go` should replace the legacy `update-locales.sh`.
* [skip ci] Updated translations via CrowdinGiteaBot2023-03-3023-0/+40
|
* Refactor commit status for Actions jobs (#23786)Jason Song2023-03-297-70/+75
| | | | | | | | | | | | | | | | | | | Before: <img width="353" alt="xnip_230329_163852" src="https://user-images.githubusercontent.com/9418365/228479807-424452df-10fa-45cf-ae4b-09939c0ed54c.png"> After: <img width="508" alt="xnip_230329_163358" src="https://user-images.githubusercontent.com/9418365/228479923-537b54fe-9564-4105-a068-bcc75fa2a7ea.png"> Highlights: - Treat `StatusSkipped` as `CommitStatusSuccess` instead of `CommitStatusFailure`, so it fixed #23599. - Use the bot user `gitea-actions` instead of the trigger as the creator of commit status. - New format `<run_name> / <job_name> / (<event>)` for the context of commit status to avoid conflicts. - Add descriptions for commit status. - Add the missing calls to `CreateCommitStatus`. - Refactor `CreateCommitStatus` to make it easier to use.
* Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more ↵wxiaoguang2023-03-295-6/+26
| | | | | | | | | | | | | | | | | | | strict (#23766) Follow #21962 After I eat my own dogfood, I would say that ONLY_SHOW_RELEVANT_REPOS=false is necessary for many private/enterprise instances, because many private repositories do not have "description/topic", users just want to search by their names. This PR also adds `PageIsExploreRepositories` check, to make code more strict, because the `search` template is shared for different purpose. And during the test, I found a bug that the "Search" button didn't respect the "relevant" parameter, so this PR fixes the bug by the way together. I think this PR needs to be backported.
* Don't apply the group filter when listing LDAP group membership if it is ↵zeripath2023-03-291-1/+1
| | | | | | | | | | empty (#23745) When running listLdapGroupMemberships check if the groupFilter is empty before using it to list memberships. Fix #23615 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Refactor internal API for git commands, use meaningful messages instead of ↵wxiaoguang2023-03-2930-850/+546
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Internal Server Error" (#23687) # Why this PR comes At first, I'd like to help users like #23636 (there are a lot) The unclear "Internal Server Error" is quite anonying, scare users, frustrate contributors, nobody knows what happens. So, it's always good to provide meaningful messages to end users (of course, do not leak sensitive information). When I started working on the "response message to end users", I found that the related code has a lot of technical debt. A lot of copy&paste code, unclear fields and usages. So I think it's good to make everything clear. # Tech Backgrounds Gitea has many sub-commands, some are used by admins, some are used by SSH servers or Git Hooks. Many sub-commands use "internal API" to communicate with Gitea web server. Before, Gitea server always use `StatusCode + Json "err" field` to return messages. * The CLI sub-commands: they expect to show all error related messages to site admin * The Serv/Hook sub-commands (for git clients): they could only show safe messages to end users, the error log could only be recorded by "SSHLog" to Gitea web server. In the old design, it assumes that: * If the StatusCode is 500 (in some functions), then the "err" field is error log, shouldn't be exposed to git client. * If the StatusCode is 40x, then the "err" field could be exposed. And some functions always read the "err" no matter what the StatusCode is. The old code is not strict, and it's difficult to distinguish the messages clearly and then output them correctly. # This PR To help to remove duplicate code and make everything clear, this PR introduces `ResponseExtra` and `requestJSONResp`. * `ResponseExtra` is a struct which contains "extra" information of a internal API response, including StatusCode, UserMsg, Error * `requestJSONResp` is a generic function which can be used for all cases to help to simplify the calls. * Remove all `map["err"]`, always use `private.Response{Err}` to construct error messages. * User messages and error messages are separated clearly, the `fail` and `handleCliResponseExtra` will output correct messages. * Replace all `Internal Server Error` messages with meaningful (still safe) messages. This PR saves more than 300 lines, while makes the git client messages more clear. Many gitea-serv/git-hook related essential functions are covered by tests. --------- Co-authored-by: delvh <dev.lh@web.de>
* Add CSS rules for basic colored labels (#23774)silverwind2023-03-281-3/+101
| | | | | | | | | | | | | Before: <img width="164" alt="Screenshot 2023-03-28 at 23 35 46" src="https://user-images.githubusercontent.com/115237/228372437-663111b9-7285-4fa2-9125-fb5e1cad21d7.png"> After: <img width="166" alt="Screenshot 2023-03-28 at 23 35 54" src="https://user-images.githubusercontent.com/115237/228372441-49430517-6b2d-4389-b11c-c30a724f6de7.png"> Also I removed the `!important` on the primary label as it's very likely unnecessary with the amount of specificity the selector already has.
* Add meilisearch support (#23136)techknowlogick2023-03-288-8/+261
| | | | | Add meilisearch support Fixes #20665
* Add missing translation for ↵Jason Song2023-03-291-0/+1
| | | | | | | `actions.runners.reset_registration_token_success` (#23732) Used at https://github.com/go-gitea/gitea/blob/4011821c946e8db032be86266dd9364ccb204118/routers/web/shared/actions/runners.go#L157
* [skip ci] Updated translations via CrowdinGiteaBot2023-03-291-0/+15
|
* Implement Issue Config (#20956)JakobDev2023-03-2812-13/+463
| | | | | | | | Closes #20955 This PR adds the possibility to disable blank Issues, when the Repo has templates. This can be done by creating the file `.gitea/issue_config.yaml` with the content `blank_issues_enabled` in the Repo.
* Set repository link based on the url in package.json for npm packages (#20379)Mai-Lapyst2023-03-283-0/+135
| | | | | | automatically set repository link for package based on the repository url present inside package.json closes #20146
* Add API to manage issue dependencies (#17935)qwerty2872023-03-2812-34/+1074
| | | | | | | | | | | | | | | | | | | | Adds API endpoints to manage issue/PR dependencies * `GET /repos/{owner}/{repo}/issues/{index}/blocks` List issues that are blocked by this issue * `POST /repos/{owner}/{repo}/issues/{index}/blocks` Block the issue given in the body by the issue in path * `DELETE /repos/{owner}/{repo}/issues/{index}/blocks` Unblock the issue given in the body by the issue in path * `GET /repos/{owner}/{repo}/issues/{index}/dependencies` List an issue's dependencies * `POST /repos/{owner}/{repo}/issues/{index}/dependencies` Create a new issue dependencies * `DELETE /repos/{owner}/{repo}/issues/{index}/dependencies` Remove an issue dependency Closes https://github.com/go-gitea/gitea/issues/15393 Closes #22115 Co-authored-by: Andrew Thornton <art27@cantab.net>
* Add creation time in tag list page (#23693)Balki2023-03-281-0/+3
| | | | Fixes #21699
* Make minio package support legacy MD5 checksum (#23768)wxiaoguang2023-03-287-25/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | A feedback from discord: https://discord.com/channels/322538954119184384/561007778139734027/1090185427115319386 Some storages like: * https://developers.cloudflare.com/r2/api/s3/api/ * https://www.backblaze.com/b2/docs/s3_compatible_api.html They do not support "x-amz-checksum-algorithm" header But minio recently uses that header with CRC32C by default. So we have to tell minio to use legacy MD5 checksum. I guess this needs to be backported because IIRC we 1.19 and 1.20 are using similar minio package. The minio package code for SendContentMD5 looks like this: <details> <img width="755" alt="image" src="https://user-images.githubusercontent.com/2114189/228186768-4f2f6f67-62b9-4aee-9251-5af714ad9674.png"> </details>
* Yarden Shoham has a new email address (#23767)Yarden Shoham2023-03-281-1/+1
| | | Got a domain
* fix br display for packages curls (#23737)Hester Gong2023-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Before: <img width="1403" alt="截屏2023-03-27 15 48 23" src="https://user-images.githubusercontent.com/17645053/227875392-399debf7-db75-4d9a-9436-409f75447c65.png"> This happens because the `<br>` matches this [rule](https://github.com/go-gitea/gitea/blob/e6e602fd8d35471f1e2f4a42669a1f17e76e0176/web_src/css/markup/content.css#L428), which is not necessary here (This is introduced by #22861, did a quick check, and this is the only place used `<br>` inside `<code>` from the PR): ```css .markup code br, .markup tt br { display: none; } ``` After: <img width="1398" alt="截屏2023-03-27 15 46 50" src="https://user-images.githubusercontent.com/17645053/227875244-b7fba432-b32c-42f7-9517-4e05bb2e64ea.png"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix issue due date edit toggle bug (#23723)wxiaoguang2023-03-281-1/+1
| | | | | | | Use `toggleElem` instead of jQuery's `fadeToggle`, which can't be caught by eslint jquery plugin. Hopefully this could be the last bug for the jQuery show/hide refactoring.