summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unused error in graceful manager (#29871)Nanguan Lin2024-03-182-12/+4
| | | As title.
* Meilisearch double quote on "match" query (#29740)65432024-03-162-70/+37
| | | | | make `nonFuzzyWorkaround` unessesary cc @Kerollmops
* Refactor markdown attention render (#29833)wxiaoguang2024-03-163-32/+12
| | | | | | | * Remove some deadcode * Use 2-word name for CSS class names * Remove "gt-*" rules for sanitizer The UI doesn't change much.
* Refactor code_indexer to use an SearchOptions struct for PerformSearch (#29724)65432024-03-166-35/+53
| | | | | | | | similar to how it's already done for the issue_indexer --- *Sponsored by Kithara Software GmbH*
* Remove the `time-since` class (#29826)Yarden Shoham2024-03-152-2/+4
| | | | | | | | It serves no purpose. --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor graceful manager, fix misused WaitGroup (#29738)coldWater2024-03-154-51/+55
| | | Follow #29629
* Add `<overflow-menu>`, rename webcomponents (#29400)silverwind2024-03-152-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Add `<overflow-menu>` web component 2. Rename `<gitea-origin-url>` to `<origin-url>` and make filenames match. <img width="439" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/2fbe4ca4-110b-4ad2-8e17-c1e116ccbd74"> <img width="444" alt="Screenshot 2024-03-02 at 21 36 52" src="https://github.com/go-gitea/gitea/assets/115237/aa8f786e-dc8c-4030-b12d-7cfb74bdfd6e"> <img width="537" alt="Screenshot 2024-03-03 at 03 05 06" src="https://github.com/go-gitea/gitea/assets/115237/fddd50aa-adf1-4b4b-bd7f-caf30c7b2245"> ![image](https://github.com/go-gitea/gitea/assets/115237/0f43770c-834c-4a05-8e3d-d30eb8653786) ![image](https://github.com/go-gitea/gitea/assets/115237/4b4c6bd7-843f-4f49-808f-6b3aed5e9f9a) TODO: - [x] Check if removal of `requestAnimationFrame` is possible to avoid flash of content. Likely needs a `MutationObserver`. - [x] Hide tippy when button is removed from DOM. - [x] ~~Implement right-aligned items (https://github.com/go-gitea/gitea/pull/28976)~~. Not going to do it. - [x] Clean up CSS so base element has no background and add background via tailwind instead. - [x] Use it for org and user page. --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT env (#29788)Jason Song2024-03-141-0/+3
| | | | | | | | | | | | It is convenient to skip by setting environment, since it's OK to use root user in job containers. It's not a bug, but I want to backport it to v1.21 since it doesn't break anything. --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix lint-swagger warning (#29787)sillyguodong2024-03-141-7/+0
| | | | | | | | | | | Caused by: #23106 Fix: https://github.com/go-gitea/gitea/actions/runs/8274650046/job/22640335697 1. Delete `UserBadgeList` in `options.go`, because it wasn't used. (The struct defined in `options.go` is the struct used to parse the request body) 2. Move `BadgeList` struct under `routers/api/v1/swagger` folder which response should be defined in.
* Refactor markup/csv: don't read all to memory (#29760)coldWater2024-03-142-12/+55
|
* Add test for webhook (#29755)wxiaoguang2024-03-141-0/+9
| | | Follow #29690
* Improve QueryEscape helper function (#29768)wxiaoguang2024-03-131-1/+5
| | | | Make it return "template.URL" to follow Golang template's context auto-escaping.
* Use relative links for commits, mentions, and issues in markdown (#29427)KN4CK3R2024-03-136-22/+34
| | | | | | | | | | | | Fixes #29404 Use relative links for - commits - mentions - issues --------- Co-authored-by: silverwind <me@silverwind.io>
* Refactor to use optional.Option for issue index search option (#29739)65432024-03-139-187/+140
| | | Signed-off-by: 6543 <6543@obermui.de>
* Refactor label.IsArchived() (#29750)65432024-03-131-2/+1
| | | just some missed nits
* Fix date rendering by adding `<gitea-absolute-date>` (#29725)silverwind2024-03-122-14/+16
| | | | | | | | | | | | | Alternative to: https://github.com/go-gitea/gitea/pull/29698 Fixes: https://github.com/go-gitea/gitea/issues/29034 <img width="278" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/12ecd967-2723-410d-8a28-a1b0f41b7bba"> It also fixes a secondary issue that we were showing timestamp tooltips over date, which makes no sense, so these are now gone as well: <img width="284" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/a70432f3-97b6-41e6-b202-b53b76924a66">
* Highlight archived labels (#29680)65432024-03-121-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | the issue is, that you can not distinguish between normal and archived labels. So this will make archived labels 80% **grayscale**. And prepend "Archived: " to the tooltip info ![image](https://github.com/go-gitea/gitea/assets/24977596/fd77c4d2-eff5-4afd-9bfa-19cb9991c5e7) ![image](https://github.com/go-gitea/gitea/assets/24977596/2e0f30e5-f301-4c9c-8e9f-677298d90b27) ![image](https://github.com/go-gitea/gitea/assets/24977596/53d70abf-b306-453d-aa95-a3a035b19a33) ![image](https://github.com/go-gitea/gitea/assets/24977596/6020e5f5-2364-4807-979f-37dffa8735e5) --- *Sponsored by Kithara Software GmbH* --------- Co-authored-by: delvh <dev.lh@web.de>
* Some performance optimization on dashboard and issues page (#29010)Lunny Xiao2024-03-121-0/+9
| | | | | | | | | This PR do some loading speed optimization for feeds user interface pages. - Load action users batchly but not one by one. - Load action repositories batchly but not one by one. - Load action's Repo Owners batchly but not one by one. - Load action's possible issues batchly but not one by one. - Load action's possible comments batchly but not one by one.
* Lazy load object format with command line and don't do it in OpenRepository ↵Lunny Xiao2024-03-1215-31/+72
| | | | | | | (#29712) Most time, when invoking `git.OpenRepository`, `objectFormat` will not be used, so it's a waste to invoke commandline to get the object format. This PR make it a lazy operation, only invoke that when necessary.
* remove repetitive words (#29695)pengqiseven2024-03-111-1/+1
| | | Signed-off-by: pengqiseven <912170095@qq.com>
* Fix inconsistent rendering of block mathematical expressions (#29677)yp053272024-03-111-1/+2
| | | | | | | | | | | | | | | | Fix #28735 GitHub render `\```math\``` ` as a block now. Add `display` class will render it as a block. After: ![image](https://github.com/go-gitea/gitea/assets/18380374/2a1c20c7-438e-4ab1-8c66-cf91c8343087) ![image](https://github.com/go-gitea/gitea/assets/18380374/b81b8a93-8bca-46a5-b7db-e0d2f53e1342) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use repo object format name instead of detecting from git repository (#29702)Lunny Xiao2024-03-101-8/+4
| | | | It's unnecessary to detect the repository object format from git repository. Just use the repository's object format name.
* fix: rendering internal file links in org (#29669)Ankit R Gadiya2024-03-102-4/+38
| | | | | | | | The internal links to other files in the repository were not rendering with the Src Prefix (/src/branch-name/file-path). This commit fixes that by using the `SrcLink` as base if available. Resolves #29668
* Update allowed attachment types (#29688)silverwind2024-03-091-2/+2
| | | | | Update to match GitHub's latest. Co-authored-by: Giteabot <teabot@gitea.io>
* Patch in exact search for meilisearch (#29671)65432024-03-0911-27/+178
| | | | | | | | | | | | | | | | | | | meilisearch does not have an search option to contorl fuzzynes per query right now: - https://github.com/meilisearch/meilisearch/issues/1192 - https://github.com/orgs/meilisearch/discussions/377 - https://github.com/meilisearch/meilisearch/discussions/1096 so we have to create a workaround by post-filter the search result in gitea until this is addressed. For future works I added an option in backend only atm, to enable fuzzynes for issue indexer too. And also refactored the code so the fuzzy option is equal in logic to code indexer --- *Sponsored by Kithara Software GmbH*
* Don't use `<br />` in alert block (#29650)Yarden Shoham2024-03-081-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Follows https://github.com/go-gitea/gitea/pull/29121 When I implemented alert blocks I was always testing the markdown in issue comments. I used `<br />` for line breaks and it looked good. I have since learned that the markdown on README files doesn't allow these tags. So a comment with ```md > [!NOTE] > If you're interested in using our APIs, we have experimental support with [documentation](https://try.gitea.io/api/swagger). ``` looked like this in a comment ![image](https://github.com/go-gitea/gitea/assets/20454870/96b1de01-2c87-4d4f-83dd-98192b83e9d0) but looked like this in a README ![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3) So I changed how we render the alert block by having the alert itself have a dedicated paragraph, so line breaks happen naturally between paragraphs. # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3) ![image](https://github.com/go-gitea/gitea/assets/20454870/167a8d37-9a44-4479-9340-5dc80347b595) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/2f99fec0-98ff-4ba8-97fe-b4567041ae79) ![image](https://github.com/go-gitea/gitea/assets/20454870/ffdeae11-fb06-4d00-b497-eae135f0d7ad) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix incorrect rendering csv file when file size is larger than ↵yp053272024-03-081-2/+4
| | | | | UI.CSV.MaxFileSize (#29653) Fix #29506
* Move get/set default branch from git package to gitrepo package to hide ↵Lunny Xiao2024-03-082-9/+19
| | | | repopath (#29126)
* Avoid unexpected panic in graceful manager (#29629)wxiaoguang2024-03-062-2/+18
| | | | | | | | | | | | There is a fundamental design problem of the "manager" and the "wait group". If nothing has started, the "Wait" just panics: sync: WaitGroup is reused before previous Wait has returned There is no clear solution besides a complete rewriting of the "manager" If there are some mistakes in the app.ini, end users would just see the "panic", but not the real error messages. A real case: #27643 This PR is just a quick fix for the annoying panic problem.
* Fix wrong line number in code search result (#29260)yp053272024-03-061-19/+31
| | | | | | | | | | | Fix #29136 Before: The result is a table and all line numbers are all in one row. After: Use a separate table column for the line numbers. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make wiki default branch name changable (#29603)wxiaoguang2024-03-062-4/+4
| | | | | | | | | Fix #29000 Fix #28685 Fix #18568 Related: #27497 And by the way fix #24036, add a Cancel button there (one line)
* Improve natural sort (#29611)wxiaoguang2024-03-052-78/+12
| | | | Hugely simplify the code, and add more tests (only new approach could pass)
* Remove unnecessary SanitizeHTML from code (#29575)wxiaoguang2024-03-042-9/+2
| | | | | | * "mail/issue/default.tmpl": the body is rendered by backend `markdown.RenderString() HTML`, it has been already sanitized * "repo/settings/webhook/base_list.tmpl": "Description" is prepared by backend `ctx.Tr`, it doesn't need to be sanitized
* Add user blocking (#29028)KN4CK3R2024-03-042-1/+9
| | | | | | | | | | | | | | | | | | | | | | Fixes #17453 This PR adds the abbility to block a user from a personal account or organization to restrict how the blocked user can interact with the blocker. The docs explain what's the consequence of blocking a user. Screenshots: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/4ed884f3-e06a-4862-afd3-3b8aa2488dc6) ![grafik](https://github.com/go-gitea/gitea/assets/1666336/ae6d4981-f252-4f50-a429-04f0f9f1cdf1) ![grafik](https://github.com/go-gitea/gitea/assets/1666336/ca153599-5b0f-4b4a-90fe-18bdfd6f0b6b) --------- Co-authored-by: Lauris BH <lauris@nix.lv>
* Allow options to disable user ssh keys configuration from the interface on ↵Lunny Xiao2024-03-041-0/+1
| | | | | | | | | | | app.ini (#29447) Follow #29275 Extract from #20549 Fix #24716 --------- Co-authored-by: delvh <dev.lh@web.de>
* Enable/disable owner and repo projects independently (#28805)Denys Konovalov2024-03-042-0/+9
| | | | | | | | | | | | | | | Part of #23318 Add menu in repo settings to allow for repo admin to decide not just if projects are enabled or disabled per repo, but also which kind of projects (repo-level/owner-level) are enabled. If repo projects disabled, don't show the projects tab. ![grafik](https://github.com/go-gitea/gitea/assets/47871822/b9b43fb4-824b-47f9-b8e2-12004313647c) --------- Co-authored-by: delvh <dev.lh@web.de>
* Add an trailing slash to dashboard links (#29555)wxiaoguang2024-03-042-2/+4
| | | Fix #29533, and add some tests for "base/paginate.tmpl"
* Extend issue template yaml engine (#29274)65432024-03-044-29/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new option: `visible`: witch can hide a specific field of the form or the created content afterwards It is a string array witch can contain `form` and `content`. If only `form` is present, it wont show up in the created issue afterwards and the other way around. By default it sets both except for markdown As they are optional and github don't have any similar thing, it is non breaking and also do not conflict with it. With this you can: - define "post issue creation" elements like a TODO list to track an issue state - make sure to have a checkbox that reminds the user to check for a thing but dont have it in the created issue afterwards - define markdown for the created issue (was the downside of using yaml instead of md in the past) - ... ## Demo ```yaml name: New Contribution description: External Contributor creating a pull body: - type: checkboxes id: extern-todo visible: [form] attributes: label: Contribution Guidelines options: - label: I checked there exist no similar feature to be extended required: true - label: I did read the CONTRIBUTION.MD required: true - type: checkboxes id: intern-todo visible: [content] attributes: label: Maintainer Check-List options: - label: Does this pull follow the KISS principe - label: Checked if internal bord was notifyed # .... ``` [Demo Video](https://cloud.obermui.de/s/tm34fSAbJp9qw9z/download/vid-20240220-152751.mkv) --- *Sponsored by Kithara Software GmbH* --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Breaking summary for template refactoring (#29395)wxiaoguang2024-03-031-14/+14
| | | https://github.com/go-gitea/gitea/pull/29395
* Fix incorrect cookie path for AppSubURL (#29534)wxiaoguang2024-03-031-2/+5
| | | Regression of #24107
* Fix queue worker incorrectly stopped when there are still more items in the ↵wxiaoguang2024-03-023-9/+42
| | | | | | | | | queue (#29532) Without `case <-t.C`, the workers would stop incorrectly, the test won't pass. For the worse case, there might be only one running worker processing the queue items for long time because other workers are stopped. The root cause is related to the logic of doDispatchBatchToWorker. It isn't a serious problem at the moment, so keep it as-is.
* remove util.OptionalBool and related functions (#29513)65432024-03-028-77/+27
| | | | | | and migrate affected code _last refactoring bits to replace **util.OptionalBool** with **optional.Option[bool]**_
* 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 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)
* Allow options to disable user gpg keys configuration from the interface on ↵Lunny Xiao2024-03-021-1/+2
| | | | | | | | app.ini (#29486) Follow #29447 Fix #29454 Extract from #20549
* 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)
* Rename Str2html to SanitizeHTML and clarify its behavior (#29516)wxiaoguang2024-03-012-12/+17
| | | | | 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-011-0/+31
| | | | | | | Fix #22785 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Refactor some Str2html code (#29397)wxiaoguang2024-03-015-21/+39
| | | | | | | | | | | | | | | 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-011-243/+0
|