aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug on action list deleted branch (#32848)Lunny Xiao2024-12-163-4/+41
| | | | | | | | Fix https://github.com/go-gitea/gitea/issues/32761#issuecomment-2540946064 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enable tenv and testifylint rules (#32852)TheFox0x72024-12-151-2/+2
| | | | Enables tenv and testifylint linters closes: https://github.com/go-gitea/gitea/issues/32842
* Allow to fork repository into the same owner (#32819)wxiaoguang2024-12-141-3/+4
| | | | | | | | | | | | This feature is experimental, not fully tested, and may be changed in the future. It is only designed for users who really need it: set `[repository].ALLOW_FORK_INTO_SAME_OWNER=true` in your app.ini Doc: https://gitea.com/gitea/docs/pulls/122 ![image](https://github.com/user-attachments/assets/38d08c23-9cfc-49d8-9321-ff81edf65395)
* Detect whether action view branch was deleted (#32764)Lunny Xiao2024-12-122-2/+46
| | | | | Fix #32761 ![图片](https://github.com/user-attachments/assets/a5a7eef8-0fea-4242-b199-1b0b73d9bbdb)
* Make API "compare" accept commit IDs (#32801)wxiaoguang2024-12-121-2/+0
|
* Add `is_archived` option for issue indexer (#32735)yp053272024-12-121-0/+7
| | | | | | | Try to fix #32697 Reason: `is_archived` is already defined in the query options, but it is not implemented in the indexer.
* Rearrange Clone Panel (#31142)Blender Defender2024-12-111-2/+2
| | | | | | | | | | | | | Rearrange the clone panel to use less horizontal space. The following changes have been made to achieve this: - Moved everything into the dropdown menu - Moved the HTTPS/SSH Switch to a separate line - Moved the "Clone in VS Code"-Button up and added a divider - Named the dropdown button "Code", added appropriate icon --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add label/author/assignee filters to the user/org home issue list (#32779)wxiaoguang2024-12-112-114/+23
| | | | | | | | | | Replace #26661, fix #25979 Not perfect, but usable and much better than before. Since it is quite complex, I am not quite sure whether there would be any regression, if any, I will fix in first time. I have tested the related pages many times: issue list, milestone issue list, project view, user issue list, org issue list.
* Refactor issue filter (labels, poster, assignee) (#32771)wxiaoguang2024-12-103-34/+8
| | | | | | | | | | | | Rewrite a lot of legacy strange code, remove duplicate code, remove jquery, and make these filters reusable. Let's forget the old code, new code affects: * issue list open/close switch * issue list filter (label, author, assignee) * milestone list open/close switch * milestone issue list filter (label, author, assignee) * project view (label, assignee)
* Refactor issue list (#32755)wxiaoguang2024-12-081-17/+14
| | | | | 1. add backend support for filtering "poster" and "assignee" * due to the limits, there is no frontend support at the moment 2. rewrite TS code without jquery, now there are 14 jQuery files left:
* Fix compare page bug view as anonymous (#32754)Lunny Xiao2024-12-081-1/+3
| | | | Fix a bug introduced from https://github.com/go-gitea/gitea/pull/32403/files#diff-dc86301f15109eee38296d469630672193e0587ad1485fdd8f503bf4c789cf7eR692
* Split issue/pull view router function as multiple smaller functions (#32749)Lunny Xiao2024-12-082-298/+356
| | | | This PR splits issue/pull view function into multiple smaller functions. It also removed duplicated branches load.
* fix: render job title as commit message (#32748)metiftikci2024-12-081-13/+19
| | | | | | | resolves #32724 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* fix(project): add title to project view page (#32747)metiftikci2024-12-071-0/+1
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support "merge upstream branch" (Sync fork) (#32741)wxiaoguang2024-12-063-134/+178
| | | | | | | | | Add basic "sync fork" support (GitHub-like) <details> ![image](https://github.com/user-attachments/assets/e71473f4-4518-48c7-b9e2-fedfcd564fc3) </details>
* GitHub like repo home page (#32213)yp053272024-12-068-801/+882
| | | | | | | Move some components (description, license, release, language stats) to sidebar --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make wiki pages visit fast (#32732)Lunny Xiao2024-12-061-10/+21
|
* Refactor RepoActionView.vue, add `::group::` support (#32713)wxiaoguang2024-12-061-52/+46
| | | | | | | 1. make it able to "force reload", then the previous pending request won't block the new request 2. make it support `::group::` 3. add some TS types (but there are still many variables untyped, this PR is large enough, the remaining types could be added in the future)
* Issue time estimate, meaningful time tracking (#23113)Illya Marchenko2024-12-052-12/+41
| | | | | | | | | | | | | Redesign the time tracker side bar, and add "time estimate" support (in "1d 2m" format) Closes #23112 --------- Co-authored-by: stuzer05 <stuzer05@gmail.com> Co-authored-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix mentionable users when writing issue comments (#32715)wxiaoguang2024-12-044-9/+9
| | | Fix #32702
* Fix delete branch perm checking (#32654)Lunny Xiao2024-12-041-31/+32
|
* Fix issue title rendering and refactor legacy function names (#32703)wxiaoguang2024-12-041-2/+2
| | | | | | | | Fix #32700, regression of recent markup refactoring And by the way, clarify many legacy problems: 1. Some "RenderXxx" functions do not really "render", they only call "post processors" 2. Merge "RenderEmoji | RenderCodeBlock", they are all for "simple issue title"
* Quick fix for license file name (#32696)Lunny Xiao2024-12-031-0/+4
|
* Allow users with write permission to run actions (#32644)Pedro Nishiyama2024-11-281-2/+2
| | | | | --- I have a use case where I need a team to be able to run actions without admin access.
* Move team related functions to service layer (#32537)Lunny Xiao2024-11-271-2/+1
| | | | | There are still some functions under `models` after last big refactor about `models`. This change will move all team related functions to service layer with no code change.
* Add priority to protected branch (#32286)65432024-11-271-0/+10
| | | | | | | | | | | | | | | | | | | ## Solves Currently for rules to re-order them you have to alter the creation date. so you basicly have to delete and recreate them in the right order. This is more than just inconvinient ... ## Solution Add a new col for prioritization ## Demo WebUI Video https://github.com/user-attachments/assets/92182a31-9705-4ac5-b6e3-9bb74108cbd1 --- *Sponsored by Kithara Software GmbH*
* Add github compatible tarball download API endpoints (#32572)Lunny Xiao2024-11-251-2/+12
| | | | Fix #29654 Fix #32481
* Refactor markup render system (#32612)wxiaoguang2024-11-2410-120/+62
| | | | | | | | | | This PR removes (almost) all path tricks, and introduces "renderhelper" package. Now we can clearly see the rendering behaviors for comment/file/wiki, more details are in "renderhelper" tests. Fix #31411 , fix #18592, fix #25632 and maybe more problems. (ps: fix #32608 by the way)
* Update the list of watchers and stargazers when clicking watch/unwatch or ↵Yarden Shoham2024-11-222-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | star/unstar (#32570) We make sure the user cards are updated - Fixes https://github.com/go-gitea/gitea/issues/32561 I also removed `ctx.Data["PageIsWatchers"] = true` and `ctx.Data["PageIsStargazers"] = true` as they are not used anywhere. # Before ![before](https://github.com/user-attachments/assets/e3bc3235-35eb-4eda-862d-bdf2510282ea) # After ![after](https://github.com/user-attachments/assets/bc0488a5-8399-4cf6-95c9-17328a9702eb) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix get reviewers' bug (#32415)Lunny Xiao2024-11-221-4/+4
| | | | | | | | | | This PR rewrites `GetReviewer` function and move it to service layer. Reviewers should not be watchers, so that this PR removed all watchers from reviewers. When the repository is under an organization, the pull request unit read permission will be checked to resolve the bug of #32394 Fix #32394
* Refactor markup render system (#32589)wxiaoguang2024-11-2211-142/+105
| | | | This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
* Add line-through for deleted branch on pull request view page (#32500)Lunny Xiao2024-11-211-0/+1
| | | | | | | | | | | | | Base branch deleted ![图片](https://github.com/user-attachments/assets/bc45aa33-d514-47c8-885a-de9732f2f3d5) branch deleted comment ![图片](https://github.com/user-attachments/assets/83729bbb-2ee8-4bd3-b6f1-780d2daad3d4) Head branch deleted ![图片](https://github.com/user-attachments/assets/90120b22-34a9-4387-aae9-5c882e8d421a)
* Refactor push mirror find and add check for updating push mirror (#32539)Lunny Xiao2024-11-181-36/+15
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor markup render system (#32533)wxiaoguang2024-11-181-1/+1
| | | | | Remove unmaintainable sanitizer rules. No need to add special "class" regexp rules anymore, use RenderInternal.SafeAttr instead, more details (and examples) are in the tests
* Refactor find forks and fix possible bugs that weak permissions check (#32528)Lunny Xiao2024-11-181-12/+11
| | | | | | | | | | | - Move models/GetForks to services/FindForks - Add doer as a parameter of FindForks to check permissions - Slight performance optimization for get forks API with batch loading of repository units - Add tests for forking repository to organizations --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix and refactor markdown rendering (#32522)wxiaoguang2024-11-161-3/+2
|
* Refactor render system (#32492)wxiaoguang2024-11-142-12/+6
| | | | | | | | | | | | | | | | | | | There were too many patches to the Render system, it's really difficult to make further improvements. This PR clears the legacy problems and fix TODOs. 1. Rename `RenderContext.Type` to `RenderContext.MarkupType` to clarify its usage. 2. Use `ContentMode` to replace `meta["mode"]` and `IsWiki`, to clarify the rendering behaviors. 3. Use "wiki" mode instead of "mode=gfm + wiki=true" 4. Merge `renderByType` and `renderByFile` 5. Add more comments ---- The problem of "mode=document": in many cases it is not set, so many non-comment places use comment's hard line break incorrectly
* Move some functions from issue.go to standalone files (#32468)Lunny Xiao2024-11-118-3146/+3298
| | | | | | | Just functions move, no code change. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor sidebar assignee&milestone&project selectors (#32465)wxiaoguang2024-11-113-260/+228
| | | | | | | | | | | | | | | | | | | Follow #32460 Now the code could be much clearer than before and easier to maintain. A lot of legacy code is removed. Manually tested. This PR is large enough, that fine tunes could be deferred to the future if there is no bug found or design problem. Screenshots: <details> ![image](https://github.com/user-attachments/assets/35f4ab7b-1bc0-4bad-a73c-a4569328303c) </details>
* Refactor sidebar label selector (#32460)wxiaoguang2024-11-104-92/+112
| | | Introduce `issueSidebarLabelsData` to handle all sidebar labels related data.
* Add reviewers selection to new pull request (#32403)Calvin K2024-11-093-66/+141
| | | | | | | | | | Users could add reviewers when creating new PRs. --------- Co-authored-by: splitt3r <splitt3r@users.noreply.github.com> Co-authored-by: Sebastian Sauer <sauer.sebastian@gmail.com> Co-authored-by: bb-ben <70356237+bboerben@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor issue page info (#32445)wxiaoguang2024-11-081-3/+3
| | | Fix a longstanding TODO since 2021 (#14826) / 2018 (#2531)
* Move AddCollabrator and CreateRepositoryByExample to service layer (#32419)Lunny Xiao2024-11-071-3/+2
| | | | | | - [x] Move `CreateRepositoryByExample` to service layer - [x] Move `AddCollabrator` to service layer - [x] Add a new parameter for `AddCollabrator` so that changing mode immediately after that will become unnecessary.
* Fix milestone deadline and date related problems (#32339)Lunny Xiao2024-11-052-27/+9
| | | | | | | | | Use zero instead of 9999-12-31 for deadline Fix #32291 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor template ctx and render utils (#32422)wxiaoguang2024-11-051-1/+1
| | | Clean up the templates
* Refactor DateUtils and merge TimeSince (#32409)wxiaoguang2024-11-042-5/+3
| | | Follow #32383 and #32402
* Fix git error handling (#32401)wxiaoguang2024-11-021-1/+1
|
* Replace DateTime with DateUtils (#32383)wxiaoguang2024-11-021-2/+2
|
* improve performance of diffs (#32393)Rowan Bohde2024-11-023-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | This has two major changes that significantly reduce the amount of work done for large diffs: * Kill a running git process when reaching the maximum number of files in a diff, preventing it from processing the entire diff. * When loading a diff with the URL param `file-only=true`, skip loading stats. This speeds up loading both hidden files of a diff and sections of a diff when clicking the "Show More" button. A couple of minor things from profiling are also included: * Reuse existing repo in `PrepareViewPullInfo` if head and base are the same. The performance impact is going to depend heavily on the individual diff and the hardware it runs on, but when testing locally on a diff changing 100k+ lines over hundreds of files, I'm seeing a roughly 75% reduction in time to load the result of "Show More" --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix `missing signature key` error when pulling Docker images with ↵Zettat1232024-10-314-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `SERVE_DIRECT` enabled (#32365) Fix #28121 I did some tests and found that the `missing signature key` error is caused by an incorrect `Content-Type` header. Gitea correctly sets the `Content-Type` header when serving files. https://github.com/go-gitea/gitea/blob/348d1d0f322ca57c459acd902f54821d687ca804/routers/api/packages/container/container.go#L712-L717 However, when `SERVE_DIRECT` is enabled, the `Content-Type` header may be set to an incorrect value by the storage service. To fix this issue, we can use query parameters to override response header values. https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html <img width="600px" src="https://github.com/user-attachments/assets/f2ff90f0-f1df-46f9-9680-b8120222c555" /> In this PR, I introduced a new parameter to the `URL` method to support additional parameters. ``` URL(path, name string, reqParams url.Values) (*url.URL, error) ``` --- Most S3-like services support specifying the content type when storing objects. However, Gitea always use `application/octet-stream`. Therefore, I believe we also need to improve the `Save` method to support storing objects with the correct content type. https://github.com/go-gitea/gitea/blob/b7fb20e73e63b8edc9b90c52073e248bef428fcc/modules/storage/minio.go#L214-L221