Commit Graph

19192 Commits (657239b4801bd0f633fd2e40b3e95b59606a4bc4)
 

Author SHA1 Message Date
wxiaoguang 657239b480
Fix material icon & diff highlight (#33844) 4 days ago
wxiaoguang c102492e5a
Fix LFS URL (#33840)
Fix #33839
4 days ago
wxiaoguang 34e5df6d30
Add material icons for file list (#33837) 4 days ago
Lunny Xiao ae63568ce3
Move notifywatch to service layer (#33825)
No logic change.
4 days ago
GiteaBot 31ddbe1444 [skip ci] Updated translations via Crowdin 4 days ago
wxiaoguang 7290bfaccb
Only keep popular licenses (#33832)
Fix #33467
5 days ago
Vinoth Kumar 3e53b01143
Removing unwanted ui container (#33833)
when the passkey auth and register was disabled
the unwanted ui container was show

Co-authored-by: Vinoth414 <103478407+Vinoth414@users.noreply.github.com>
5 days ago
Dustin Firebaugh 3f1f808b9e
Full-file syntax highlighting for diff pages (#33766)
Fix #33358, fix #21970

This adds a step in the `GitDiffForRender` that does syntax highlighting for the
entire file and then only references lines from that syntax highlighted
code. This allows things like multi-line comments to be syntax
highlighted correctly.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 days ago
wxiaoguang 6f13331754
Improve theme display (#30671)
Document: https://gitea.com/gitea/docs/pulls/180

![image](https://github.com/go-gitea/gitea/assets/2114189/68e38573-b911-45d9-b7aa-40d96d836ecb)
6 days ago
TheFox0x7 4c4c56c7cd
Decouple context from repository related structs (#33823)
Calls that required context implicitly are made to pass it as argument
6 days ago
wxiaoguang 4ed71eb754
Improve log format (#33814) 6 days ago
wxiaoguang 6422f05a4e
Decouple diff stats query from actual diffing (#33810)
The diff stats are no longer part of the diff generation.
Use `GetDiffShortStat` instead to get the total number of changed files,
added lines, and deleted lines.
As such, `gitdiff.GetDiff` can be simplified:
It should not do more than expected.

And do not run "git diff --shortstat" for pull list. Fix #31492
6 days ago
Lunny Xiao 1b2dffff8e
Add global lock for migrations to make upgrade more safe with multiple replications (#33706) 7 days ago
wxiaoguang b8c2afdc5f
Do not show passkey on http sites (#33820)
Fix #33615
7 days ago
Alexander McRae 582ad338d7
Use correct start and end commits for GetDiffTree (#33816)
Fixes
https://github.com/go-gitea/gitea/pull/33514#issuecomment-2702814099

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 week ago
wxiaoguang ef18655215
Try to fix ACME (3rd) (#33807)
Fix #33802, fix #32191
1 week ago
TheFox0x7 e7cf62f2f7
remove context from mail struct (#33811)
it can be passed by argument instead
1 week ago
GiteaBot b0ee340969 [skip ci] Updated translations via Crowdin 1 week ago
Lunny Xiao 0453177b61
Refactor: move part of updating protected branch logic to service layer (#33742) 1 week ago
Lunny Xiao df7b61ce9a
Update changelog for v1.23.5 (#33797)
frontport from #33780
1 week ago
sommerf-lf 7cdde20c73
Email option to embed images as base64 instead of link (#32061)
ref: #15081
ref: #14037

Documentation: https://gitea.com/gitea/docs/pulls/69

# Example
Content:

![image](https://github.com/user-attachments/assets/e73ebfbe-e329-40f6-9c4a-f73832bbb181)
Result in Email:

![image](https://github.com/user-attachments/assets/55b7019f-e17a-46c3-a374-3b4769d5c2d6)
Result with source code:
(first image is external image, 2nd is now embedded)

![image](https://github.com/user-attachments/assets/8e2804a1-580f-4a69-adcb-cc5d16f7da81)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 week ago
Kerwin Bryant f0f10413ae
Update TypeScript types (#33799)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 week ago
silverwind 95efc7b35b
Disable vet=off again (#33794)
Ref: https://github.com/go-gitea/gitea/issues/33792

To avoid slowing unit-test down.
1 week ago
GiteaBot b9913d9568 [skip ci] Updated translations via Crowdin 1 week ago
Lunny Xiao 65bb837fa2
Upgrade golang net from 0.35.0 -> 0.36.0 (#33795) 1 week ago
TheFox0x7 ae3a18e01a
Remove context from git struct (#33793)
Argument is moved from struct init in command run, which lets us remove
context from struct.
1 week ago
Lunny Xiao 6c8fb8d455
Small refactor to reduce unnecessary database queries and remove duplicated functions (#33779) 1 week ago
wxiaoguang 75e85c25c1
Refactor repo-issue.ts (#33784)
And remove jQuery
1 week ago
wxiaoguang ca0ce003ab
Refactor repo-settings.ts (#33785)
and remove jQuery
1 week ago
wxiaoguang 163bbca0eb
Refactor admin/common.ts (#33788)
Only remove jQuery
1 week ago
Denys Konovalov ffb276578f
Adjust appearence of commit status webhook (#33778)
Some visual improvement for the commit status webhook message introduced
by #33320

- use short commit SHA as already done in e. g. commit webhook
- fix spacing, link text
- do not set user link for internal gitea-actions user

Before: 

![grafik](https://github.com/user-attachments/assets/9c460846-c350-444c-89b5-8a0d5e26cb86)

After:

![grafik](https://github.com/user-attachments/assets/05519cd8-6d8f-432b-bd9d-082de558a55a)
2 weeks ago
Kerwin Bryant 14be462646
Refactor initRepoBranchTagSelector to use new init framework (#33776)
Make "initRepoBranchTagSelector" to use new init framework and fix the
abused "js-branch-tag-selector" styles

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
Kerwin Bryant ad204f9c5a
Refactor buttons to use new init framework (#33774)
Make buttons to use new init framework
* "js-toggle-commit-body"
* "show-panel/hide-panel/show-modal"
* "copy-content"

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
Kerwin Bryant f0f1737d4d
Refactor markup and pdf-viewer to use new init framework (#33772)
1. Add some "render-content" classes to "markup" elements when the
content is rendered
2. Use correct "markup" wrapper for "preview" (but not set that class on
the tab)
3. Remove incorrect "markup" class from LFS file view, because there is
no markup content
    * "edit-diff" is also removed because it does nothing
5. Use "initPdfViewer" for PDF viewer
6. Remove incorrect "content" class from milestone markup
7. Init all ".markup" elements by new init framework

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
silverwind 43c8d85f19
Disable `vet` as part of `go test` (#33662)
`go vet` implicitely runs as part of `go test`, but we already have
`make lint-go-vet`, so we were essentially running it twice. This should
hopefully make `go test` slightly faster.

Ref: https://pkg.go.dev/cmd/go#hdr-Test_packages

> As part of building a test binary, go test runs go vet
2 weeks ago
wxiaoguang 216243eee2
Refactor error system (#33771)
It should not expose `util.SilentWrap` or construct it manually.
2 weeks ago
Lunny Xiao dbed39d632
Add migrations and doctor fixes (#33556)
Fix #33535
2 weeks ago
wxiaoguang 02657e85a4
Refactor mail code (#33768)
`mail.go` contains various different functions, it's time to split it.
2 weeks ago
wxiaoguang 27bf63ad20
Refactor global init code and add more comments (#33755)
Follow up #33748

Now there are 3 "global" functions:

* registerGlobalSelectorFunc: for all elements matching the selector, eg: `.ui.dropdown`
* registerGlobalInitFunc: for `data-global-init="initInputAutoFocusEnd"`
* registerGlobalEventFunc: for `data-global-click="onCommentReactionButtonClick"`


And introduce `initGlobalInput` to replace old `initAutoFocusEnd` and
`attachDirAuto`, use `data-global-init` to replace fragile
`.js-autofocus-end` selector.

Another benefit is that by the new approach, no matter how many times
`registerGlobalInitFunc` is called, we only need to do one
"querySelectorAll" in the last step, it could slightly improve the
performance.
2 weeks ago
Lunny Xiao 5cbdf83f70
Use pullrequestlist instead of []*pullrequest (#33765)
Just renames no code changed.
2 weeks ago
Lunny Xiao 2c8bdd2233
Upgrade act to 0.261.4 and actions-proto-go to v0.4.1 (#33760)
Include https://gitea.com/gitea/act/pulls/129 Fix #33657 
And https://gitea.com/gitea/actions-proto-def/pulls/14
2 weeks ago
ChristopherHX b684f51d20
Webhook add X-Gitea-Hook-Installation-Target-Type Header (#33752)
This is a X-GitHub Header port

* repository for repository webhooks (matches GitHub)
* organization for organization webhooks (matches GitHub)
* user for user webhooks (Gitea specific)
* system for system webhooks  (Gitea specific)
* default for default hooks needs testing (Gitea specific)

- `X-Gitea-Hook-Installation-Target-Type`
- `X-GitHub-Hook-Installation-Target-Type`
2 weeks ago
wxiaoguang 698ae7aa5b
Fix dynamic content loading init problem (#33748)
1. Rewrite `dirauto.ts` to `observer.ts`. 
* We have been using MutationObserver for long time, it's proven that it
is quite performant.
    * Now we extend its ability to handle more "init" works.
2. Use `observeAddedElement` to init all non-custom "dropdown".
3. Use `data-global-click` to handle click events from dynamically
loaded elements.
* By this new approach, the old fragile selector-based
(`.comment-reaction-button`) mechanism is removed.
4. By the way, remove unused `.diff-box` selector, it was abused and
never really used.

A lot of FIXMEs in "repo-diff.ts" are completely fixed, newly loaded
contents could work as expected.
2 weeks ago
GiteaBot f3ada61097 [skip ci] Updated translations via Crowdin 2 weeks ago
Lunny Xiao aca21549f2
Add composor source field (#33502)
Fix #33066
2 weeks ago
Lunny Xiao ae4a3d7708
upgrade go-crypto from 1.1.5 to 1.1.6 (#33745)
Fix #33296

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
silverwind 6e475dc7e0
Disable go license generation as part of `make tidy` (#33747)
It seems something broken `google/go-licenses` (maybe related to go
1.24), and my findings are in
https://github.com/google/go-licenses/issues/128#issuecomment-2689753365.
I think it's best we disable this generation for now until a better
solution is found.

Also, enable showing stderr output so we can actually debug this thing.
For reference, these are the errors that currently apparently break the
tool:

```
E0228 05:15:27.005759   13158 library.go:117] Package text/tabwriter does not have module info. Non go modules projects are no longer supported. For feedback, refer to https://github.com/google/go-licenses/issues/128.
E0228 05:15:27.005776   13158 library.go:117] Package net/http/fcgi does not have module info. Non go modules projects are no longer supported. For feedback, refer to https://github.com/google/go-licenses/issues/128.
F0228 05:15:27.028122   13158 main.go:77] some errors occurred when loading direct and transitive dependency packages
```
2 weeks ago
wxiaoguang 4e56d5f39f
Refactor repo-diff.ts (#33746)
Remove jQuery
2 weeks ago
Alexander McRae aba96f65cd
Use `git diff-tree` for `DiffFileTree` on diff pages (#33514)
Modify Diff View FileTree to show all files

## Changes

* removes Show Status button on diff
* uses `git diff-tree` to generate the file tree for the diff
* doesn't reload the diff tree each time we load more files in the
preview
* selecting and unloaded file will keep loading until that file is
loaded
* removes `DiffFileList.vue` and "Show Stats" in diff options

## Open Questions

* selecting and unloaded file will keep loading until that file is
loaded. Is this behaviour okay? It matches what github does.

### Demo

In this demo I set `git.MAX_GIT_DIFF_FILES=1` in my `app.ini` to
demonstrate a worst case example. In most cases the behaviour isn't
nearly as jarring as we load a bunch of files at a time.


https://github.com/user-attachments/assets/72f29663-d6fc-472d-94fa-7fb5950c2836

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
GiteaBot 7a8eed13b9 [skip ci] Updated translations via Crowdin 2 weeks ago