]> source.dussan.org Git - gitea.git/log
gitea.git
5 months agoFix repo home UI when there is no repo description (#30552)
wxiaoguang [Sun, 21 Apr 2024 23:47:31 +0000 (07:47 +0800)]
Fix repo home UI when there is no repo description (#30552)

Fix #30502 by a new approach.

![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76)

5 months agoFix dropdown text ellipsis (#30628)
wxiaoguang [Sun, 21 Apr 2024 23:14:33 +0000 (07:14 +0800)]
Fix dropdown text ellipsis (#30628)

Follow
https://github.com/go-gitea/gitea/pull/30547#discussion_r1573866519

Fix #30624

The Fomantic UI Dropdown wasn't designed to work that way, its "text"
element might contain images. So the "overflow" shouldn't be added to
any general dropdown text.

![image](https://github.com/go-gitea/gitea/assets/2114189/f6ceaabd-bc89-4bf2-baa2-a6f0324c1962)

5 months agofix(api): refactor branch and tag existence checks (#30618)
Bo-Yi Wu [Sun, 21 Apr 2024 22:19:59 +0000 (06:19 +0800)]
fix(api): refactor branch and tag existence checks (#30618)

- Update branch existence check to also include tag existence check
- Adjust error message for branch/tag existence check

ref: https://github.com/go-gitea/gitea/pull/30349

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoAdd --skip-db option to dump command (#30613)
Kemal Zebari [Sun, 21 Apr 2024 21:32:12 +0000 (14:32 -0700)]
Add --skip-db option to dump command (#30613)

Attempts to resolve #28720.

---

Note that I am not a Gitea administrator so I don't normally use the
gitea CLI. Just saw this issue and wanted an opportunity to understand
how this subcommand works and see if I can add this feature :^)

I tested both with `--skip-db` and without and it appears to not add any
database-specific files to the generated archive i.e. I don't see a
`gitea-db.sql` or `gitea.db` file:
```console
$ TAGS="bindata sqlite sqlite_unlock_notify" make backend
Running go generate...
bindata for migration already up-to-date
bindata for options already up-to-date
bindata for public already up-to-date
bindata for templates already up-to-date
$ ./gitea dump --skip-db
2024/04/20 01:16:11 ...s/setting/session.go:77:loadSessionFrom() [I] Session Service Enabled
2024/04/20 01:16:11 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/attachments
2024/04/20 01:16:11 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/avatars
2024/04/20 01:16:11 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-avatars
2024/04/20 01:16:11 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/lfs
2024/04/20 01:16:11 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-archive
2024/04/20 01:16:11 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/packages
2024/04/20 01:16:11 ...s/storage/storage.go:219:initActions() [I] Initialising Actions storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_log
2024/04/20 01:16:11 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_artifacts
2024/04/20 01:16:11 cmd/dump.go:172:runDump() [I] Dumping local repositories... /workspaces/gitea/data/gitea-repositories
2024/04/20 01:16:11 cmd/dump.go:195:runDump() [I] Skipping database
2024/04/20 01:16:11 cmd/dump.go:229:runDump() [I] Adding custom configuration file from /workspaces/gitea/custom/conf/app.ini
2024/04/20 01:16:11 cmd/dump.go:256:runDump() [I] Packing data directory.../workspaces/gitea/data
2024/04/20 01:16:11 cmd/dump.go:335:runDump() [I] Finish dumping in file /workspaces/gitea/gitea-dump-1713575771.zip
$ unzip /workspaces/gitea/gitea-dump-1713575771.zip -d example
Archive:  /workspaces/gitea/gitea-dump-1713575771.zip
. . .
$ ls example/
app.ini  custom  data  repos
$ ls example/data/
actions_artifacts  actions_log  avatars  home  indexers  jwt  queues  repo-archive  repo-avatars  tmp
```

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix flash on dashboard (#30572)
silverwind [Sun, 21 Apr 2024 20:24:56 +0000 (22:24 +0200)]
Fix flash on dashboard (#30572)

Fixes https://github.com/go-gitea/gitea/issues/30566, regression from
https://github.com/go-gitea/gitea/pull/30214.

5 months agochore: use errors.New to replace fmt.Errorf with no parameters will much better ...
Cheng [Sun, 21 Apr 2024 19:44:03 +0000 (03:44 +0800)]
chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621)

use errors.New to replace fmt.Errorf with no parameters will much better

5 months agoFix issue comment form and quick-submit (#30623)
wxiaoguang [Sun, 21 Apr 2024 17:00:04 +0000 (01:00 +0800)]
Fix issue comment form and quick-submit (#30623)

1. Rewrite initGlobalEnterQuickSubmit (by the way, remove jQuery)
2. Fix issue comment form layout

5 months agoUse maintained gziphandler (#30592)
Lunny Xiao [Sun, 21 Apr 2024 00:53:45 +0000 (08:53 +0800)]
Use maintained gziphandler (#30592)

Replace #27894

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 21 Apr 2024 00:26:57 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoFix package list performance (#30520)
KN4CK3R [Sat, 20 Apr 2024 11:07:00 +0000 (13:07 +0200)]
Fix package list performance (#30520)

Fixes #28255

The new query uses the id field to sort by "newer". This most not be
correct (usually it is) but it's faster (see #28255).
If someone has a better idea, please propose changes.

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoClarify permission "HasAccess" behavior (#30585)
wxiaoguang [Sat, 20 Apr 2024 03:15:04 +0000 (11:15 +0800)]
Clarify permission "HasAccess" behavior (#30585)

Follow #30495

"HasAccess" behavior wasn't clear, to make it clear:

* Use a new name `HasAnyUnitAccess`, it will be easier to review related
code and permission problems.
* Separate everyone access mode to a separate field, then all calls to
HasAccess are reverted to old behavior before #30495.
* Add new tests.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix links in PyPI Simple Repository API page (#30594)
wxiaoguang [Sat, 20 Apr 2024 01:15:14 +0000 (09:15 +0800)]
Fix links in PyPI Simple Repository API page (#30594)

Thanks to @Zottelchen for looking into problem and proposing the fix.

Ref: https://github.com/astral-sh/uv/issues/3017 ,
https://peps.python.org/pep-0503/

This PR's change is from Zottelchen's work.

And I by the way rename the `$p` to `$pd` because `p` is used as
"package" in code, while `pd` is used as "package description".

----

Co-authored-by: Zottelchen
5 months agoUse action user as the trigger user of schedules (#30581)
yp05327 [Sat, 20 Apr 2024 00:35:29 +0000 (09:35 +0900)]
Use action user as the trigger user of schedules (#30581)

Follow https://github.com/go-gitea/gitea/pull/30357

When user push to default branch, the schedule trigger user will be the
user.
When disable then enable action units in settings, the schedule trigger
user will be action user.
When repo is a mirror, the schedule trigger user will be action user. (
before it will return error, fixed by #30357)

As scheduled job is a cron, the trigger user should be action user from
Gitea, not a real user.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix commit file status parser (#30602)
wxiaoguang [Fri, 19 Apr 2024 14:41:03 +0000 (22:41 +0800)]
Fix commit file status parser (#30602)

Try to fix  #30492

5 months agoFix HEAD method for robots.txt (#30603)
wxiaoguang [Fri, 19 Apr 2024 13:43:56 +0000 (21:43 +0800)]
Fix HEAD method for robots.txt (#30603)

Fix #30601

5 months agoFix project description rendering for org (#30587)
wxiaoguang [Fri, 19 Apr 2024 07:58:56 +0000 (15:58 +0800)]
Fix project description rendering for org (#30587)

Fix #30263

![image](https://github.com/go-gitea/gitea/assets/2114189/41cabe6c-f94a-4874-a26f-d01bb89bb28c)

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix changelog (main) (#30582)
wxiaoguang [Fri, 19 Apr 2024 06:08:30 +0000 (14:08 +0800)]
Fix changelog (main) (#30582)

1. The 1.21.11 changelog is missing
2. Split the old content to CHANGELOG-archived.md, to reduce the size of
CHANGELOG.md

5 months agoAvoid importing `modules/web/middleware` in `modules/session` (#30584)
Jason Song [Fri, 19 Apr 2024 04:03:53 +0000 (12:03 +0800)]
Avoid importing `modules/web/middleware` in `modules/session` (#30584)

Related to #30375.

It doesn't make sense to import `modules/web/middleware` and
`modules/setting` in `modules/web/session` since the last one is more
low-level.

And it looks like a workaround to call `DeleteLegacySiteCookie` in
`RegenerateSession`, so maybe we could reverse the importing by
registering hook functions.

5 months agoEnable npm cache on `setup-node` action (#30577)
silverwind [Fri, 19 Apr 2024 03:29:08 +0000 (05:29 +0200)]
Enable npm cache on `setup-node` action (#30577)

Enable npm dependency cache in
[setup-node](https://github.com/actions/setup-node). This should work
reliably and across branches as well.

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 19 Apr 2024 00:24:35 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoMock queue backoff duration (#30553)
wxiaoguang [Thu, 18 Apr 2024 20:00:59 +0000 (04:00 +0800)]
Mock queue backoff duration (#30553)

During testing, the backoff duration shouldn't be longer than other
durations

5 months agoImprove "Reference in new issue" modal (#30547)
silverwind [Thu, 18 Apr 2024 19:31:53 +0000 (21:31 +0200)]
Improve "Reference in new issue" modal (#30547)

Fixes: https://github.com/go-gitea/gitea/issues/29994
Also some misc enhancements done to the form in the modal.

<img width="840" alt="Screenshot 2024-04-17 at 23 02 55"
src="https://github.com/go-gitea/gitea/assets/115237/e71fba55-55cd-4e48-a497-6b1025c36a43">

5 months agoAdd a few root files to lint-spell (#30530)
silverwind [Thu, 18 Apr 2024 18:54:40 +0000 (20:54 +0200)]
Add a few root files to lint-spell (#30530)

Files in root were not linted, add them. No new violations.

5 months agoRefactor and fix archive link bug (#30535)
wxiaoguang [Thu, 18 Apr 2024 16:45:50 +0000 (00:45 +0800)]
Refactor and fix archive link bug (#30535)

Regression of #29920
Fixes: #30569
Also this is a rewriting to eliminate the remaining jQuery usages from code.

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFixup app.example.ini for task section, which is now queue.task (#30555)
Jerry Jacobs [Thu, 18 Apr 2024 11:22:06 +0000 (13:22 +0200)]
Fixup app.example.ini for task section, which is now queue.task (#30555)

Config section `[task]` has been deprecated in favor of `[queue.task]`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoSome following up changes for routes (#30550)
wxiaoguang [Thu, 18 Apr 2024 09:36:19 +0000 (17:36 +0800)]
Some following up changes for routes (#30550)

1. Switch back to the old order for `reqRepoAdmin, context.RepoRef()`
2. Add a routing function info for global NotFound

5 months agoAdd form field id generation, remove duplicated ids (#30546)
silverwind [Thu, 18 Apr 2024 09:01:06 +0000 (11:01 +0200)]
Add form field id generation, remove duplicated ids (#30546)

Fixes: https://github.com/go-gitea/gitea/issues/30384
On repo settings page, there id `repo_name` was used 5 times on the same
page, some in modal and such. I think we are better off just
auto-generating these IDs in the future so that labels link up with
their form element.

Ideally this id generation would be done in backend in a subtemplate,
but seeing that we already have similar JS patches for checkboxes, I
took the easy path for now.

I also checked that these `#repo_name` were not in use in JS and the
only case where this id appears in JS is on the migration page where
it's still there.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix border-radius on view, blame and code search (#30545)
silverwind [Thu, 18 Apr 2024 08:34:23 +0000 (10:34 +0200)]
Fix border-radius on view, blame and code search (#30545)

Fixes: https://github.com/go-gitea/gitea/issues/30540
1. Fix all these boxes by adding `bottom attached` and removing a
problematic CSS rule:

<img width="1319" alt="Screenshot 2024-04-17 at 22 25 31"
src="https://github.com/go-gitea/gitea/assets/115237/346445a4-4944-4003-a1ef-6f5b0eda624e">
<img width="643" alt="Screenshot 2024-04-17 at 22 21 18"
src="https://github.com/go-gitea/gitea/assets/115237/10f17ed3-9ad6-48de-92fa-bac6621815b9">

2. Change the "last commit" box to `ui segment` which has correct
border-radius. Also included is a tiny tweak to make author name ellipse
instead of wrap.

<img width="1331" alt="Screenshot 2024-04-17 at 22 23 23"
src="https://github.com/go-gitea/gitea/assets/115237/285fbd45-ced0-4d33-abe3-7384ffa03188">

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoDisable enter key for accepting code completion in Monaco (#30548)
silverwind [Thu, 18 Apr 2024 08:06:56 +0000 (10:06 +0200)]
Disable enter key for accepting code completion in Monaco (#30548)

Fixes https://github.com/go-gitea/gitea/issues/28114 and behaviour
matches vscode on desktop as well.

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoAdd an api test for updating user (#30539)
Lunny Xiao [Thu, 18 Apr 2024 03:16:20 +0000 (11:16 +0800)]
Add an api test for updating user (#30539)

Fix #30518

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 18 Apr 2024 00:26:04 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoExpose fuzzy search for issues/pulls (#29701)
6543 [Thu, 18 Apr 2024 00:16:52 +0000 (02:16 +0200)]
Expose fuzzy search for issues/pulls (#29701)

close  #29685

---------

Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
5 months agoAllow everyone to read or write a wiki by a repo unit setting (#30495)
wxiaoguang [Wed, 17 Apr 2024 15:58:37 +0000 (23:58 +0800)]
Allow everyone to read or write a wiki by a repo unit setting (#30495)

Replace #6312
Help #5833
Wiki solution for #639

5 months agoSupport nuspec manifest download for nuget packages (#28921)
Michael Kriese [Wed, 17 Apr 2024 15:30:41 +0000 (17:30 +0200)]
Support nuspec manifest download for nuget packages (#28921)

Support downloading nuget nuspec manifest[^1]. This is useful for
renovate because it uses this api to find the corresponding repository

- Store nuspec along with nupkg on upload
- allow downloading nuspec
- add doctor command to add missing nuspec files

[^1]:
https://learn.microsoft.com/en-us/nuget/api/package-base-address-resource#download-package-manifest-nuspec

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
5 months agoFix branch_protection api shows users/teams who has no readAccess (#30291)
Edward Zhang [Wed, 17 Apr 2024 13:24:07 +0000 (21:24 +0800)]
Fix branch_protection api shows users/teams who has no readAccess (#30291)

Add some logic in `convert.ToBranchProtection` to return only the names
associated with readAccess instead of returning all names. This will
ensure consistency in behavior between the frontend and backend.
Fixes: #27694
---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: wenzhuo.zhang <wenzhuo.zhang@geely.com>
Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoCorrect locale string rendering (#30522)
wxiaoguang [Wed, 17 Apr 2024 10:24:08 +0000 (18:24 +0800)]
Correct locale string rendering (#30522)

Since #29165, the translations are rendered as HTML in templates, so:

1. if the translation does contain `<>`, use `TrString`
2. use `{dummy}` instead of `<dummy>` as much as possible

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoRun `go generate` and `go vet` on all packages (#30529)
silverwind [Wed, 17 Apr 2024 09:40:35 +0000 (11:40 +0200)]
Run `go generate` and `go vet` on all packages (#30529)

Fixes: https://github.com/go-gitea/gitea/issues/30512
I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?

5 months agoFix and tweak pull request commit list (#30528)
silverwind [Wed, 17 Apr 2024 08:58:08 +0000 (10:58 +0200)]
Fix and tweak pull request commit list (#30528)

Fixes https://github.com/go-gitea/gitea/issues/30493, regression from
https://github.com/go-gitea/gitea/pull/30374.

Also did the flexbox convertion as suggested by the existing comment.

<img width="850" alt="Screenshot 2024-04-16 at 22 28 48"
src="https://github.com/go-gitea/gitea/assets/115237/e8905944-620a-4211-b5c5-53ed3b3ee23e">

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoRefactor web routes (#30519)
wxiaoguang [Wed, 17 Apr 2024 08:31:37 +0000 (16:31 +0800)]
Refactor web routes (#30519)

Re-organize the routes in web.go and use ctx constants instead of `context.UnitTypes()`

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoFix install page checkboxes and dropdown width (#30526)
silverwind [Wed, 17 Apr 2024 07:30:46 +0000 (09:30 +0200)]
Fix install page checkboxes and dropdown width (#30526)

Fixes: https://github.com/go-gitea/gitea/issues/30523
1. Fix checkbox rendering
2. Fix width of selection dropdowns (was too small)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoReduce unnecessary database queries on actions table (#30509)
Lunny Xiao [Wed, 17 Apr 2024 01:25:03 +0000 (09:25 +0800)]
Reduce unnecessary database queries on actions table (#30509)

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 17 Apr 2024 00:24:47 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoTweak and fix toggle checkboxes (#30527)
silverwind [Tue, 16 Apr 2024 22:39:19 +0000 (00:39 +0200)]
Tweak and fix toggle checkboxes (#30527)

Fixes: https://github.com/go-gitea/gitea/issues/30524. Slightly restyled
them so that the "knob" is contained inside the background.

<img width="179" alt="Screenshot 2024-04-16 at 21 58 09"
src="https://github.com/go-gitea/gitea/assets/115237/be94517b-9cb7-46e2-ae96-fcf6767ce4ba">
<img width="187" alt="Screenshot 2024-04-16 at 21 58 50"
src="https://github.com/go-gitea/gitea/assets/115237/c13a1959-5c5a-4e88-9225-e5f6fb72e3e0">

6 months agoTweak repo buttons on mobile and labeled button border-radius (#30503)
silverwind [Tue, 16 Apr 2024 15:46:12 +0000 (17:46 +0200)]
Tweak repo buttons on mobile and labeled button border-radius (#30503)

Fixes: https://github.com/go-gitea/gitea/issues/30514
Fixes:
https://github.com/go-gitea/gitea/pull/30288#issuecomment-2057466623

- Fix border-radius regression from
https://github.com/go-gitea/gitea/pull/30475
- Fix and simplify hover state
- Move the modal HTML so it does not interfere with the CSS
- Make the star and unwatch text show on mobile. There is still plenty
of space, below is iPhone 12 viewport size

<img width="696" alt="Screenshot 2024-04-15 at 20 34 03"
src="https://github.com/go-gitea/gitea/assets/115237/af90bb00-4671-4973-a255-8eb44ee6ba8d">
<img width="230" alt="Screenshot 2024-04-15 at 20 31 42"
src="https://github.com/go-gitea/gitea/assets/115237/986ef533-7a01-4bb0-8dcd-fd19e4259e84">
<img width="233" alt="Screenshot 2024-04-15 at 20 31 47"
src="https://github.com/go-gitea/gitea/assets/115237/5b825dd8-0ccc-4d56-9d8f-774abb935b68">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix long branch name overflows (#30345)
silverwind [Tue, 16 Apr 2024 08:52:45 +0000 (10:52 +0200)]
Fix long branch name overflows (#30345)

Fixes: https://github.com/go-gitea/gitea/issues/27971
Fixes: https://github.com/go-gitea/gitea/pull/28010
<img width="689" alt="Screenshot 2024-04-09 at 00 19 57"
src="https://github.com/go-gitea/gitea/assets/115237/7c895a47-274f-40a6-a126-290658f1982d">

Also fixes a similar issue in issue list where CSS was there but not
active because of missing `display: block`.

<img width="372" alt="Screenshot 2024-04-09 at 00 18 25"
src="https://github.com/go-gitea/gitea/assets/115237/cfbee7cd-2e15-4ac7-96ce-020816f48798">

6 months agoUpdate API to return 'source_id' for users (#29718)
Tobias Balle-Petersen [Tue, 16 Apr 2024 06:08:48 +0000 (08:08 +0200)]
Update API to return 'source_id' for users (#29718)

Using the API, a user's _source_id_ can be set in the _CreateUserOption_
model, but the field is not returned in the _User_ model.

This PR updates the _User_ model to include the field _source_id_ (The
ID of the Authentication Source).

6 months agoAllow `preferred_username` as username source for OIDC (#30454)
SimonErm [Tue, 16 Apr 2024 05:41:39 +0000 (07:41 +0200)]
Allow `preferred_username` as username source for OIDC (#30454)

This PR adds the preferred_username claim as a possible username source
for the oauth2_client.

Closes #21518

6 months agoFix empty field `login_name` in API response JSON when creating user (#30511)
yp05327 [Tue, 16 Apr 2024 05:13:00 +0000 (14:13 +0900)]
Fix empty field `login_name` in API response JSON when creating user (#30511)

Fix #30508

ps: if `sourceID` is not set, `LoginName` will be ignored

6 months agofeat(api): implement branch/commit comparison API (#30349)
Bo-Yi Wu [Tue, 16 Apr 2024 03:45:04 +0000 (11:45 +0800)]
feat(api): implement branch/commit comparison API (#30349)

- Add new `Compare` struct to represent comparison between two commits
- Introduce new API endpoint `/compare/*` to get commit comparison
information
- Create new file `repo_compare.go` with the `Compare` struct definition
- Add new file `compare.go` in `routers/api/v1/repo` to handle
comparison logic
- Add new file `compare.go` in `routers/common` to define `CompareInfo`
struct
- Refactor `ParseCompareInfo` function to use `common.CompareInfo`
struct
- Update Swagger documentation to include the new API endpoint for
commit comparison
- Remove duplicate `CompareInfo` struct from
`routers/web/repo/compare.go`
- Adjust base path in Swagger template to be relative (`/api/v1`)

GitHub API
https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 16 Apr 2024 00:23:51 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoFix various overflows on actions view (#30344)
silverwind [Mon, 15 Apr 2024 19:46:52 +0000 (21:46 +0200)]
Fix various overflows on actions view (#30344)

Fix a number of text overflow issues in actions view and run list. Also
improve mobile view of run list.

Fixes: https://github.com/go-gitea/gitea/issues/30328
<img width="782" alt="Screenshot 2024-04-08 at 23 10 16"
src="https://github.com/go-gitea/gitea/assets/115237/3d9f9f88-3eab-44a0-8144-30c2b58b24cb">
<img width="935" alt="Screenshot 2024-04-08 at 23 17 46"
src="https://github.com/go-gitea/gitea/assets/115237/581d73ea-a31d-416b-be3a-47313b879b12">
<img width="1008" alt="Screenshot 2024-04-08 at 23 49 05"
src="https://github.com/go-gitea/gitea/assets/115237/c5d10565-f285-477f-8659-1caf94797647">
<img width="397" alt="Screenshot 2024-04-08 at 23 55 30"
src="https://github.com/go-gitea/gitea/assets/115237/368aaa75-1903-4058-9d75-d1fe91c564d6">

6 months agoConvert max file name length to 255 (#30489)
yp05327 [Mon, 15 Apr 2024 19:08:31 +0000 (04:08 +0900)]
Convert max file name length to 255 (#30489)

Quick/Partly fix #29907

In Linux and MacOS, by default the max file name length is 255.
In windows, it depends on the version and settings, and has no file name
length limitation, but has path length limitation.
By default it is 260, considering path length is longer than filename,
so I think it is ok to do this.

For Windows, see
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
For Linux, see
https://github.com/torvalds/linux/blob/master/include/uapi/linux/limits.h#L12-L13
For MacOS, see
https://discussions.apple.com/thread/254788848?sortBy=best

6 months agoRemove active border on pointing menu (#30486)
silverwind [Mon, 15 Apr 2024 18:22:53 +0000 (20:22 +0200)]
Remove active border on pointing menu (#30486)

It looks better when these menus don't flash a border-bottom on click.

6 months agoFix button color on red and green buttons (#30500)
silverwind [Mon, 15 Apr 2024 17:20:32 +0000 (19:20 +0200)]
Fix button color on red and green buttons (#30500)

Previously these colors were provided by fomantic css. I missed them.

Fixes: https://github.com/go-gitea/gitea/issues/30499
Regressed by: https://github.com/go-gitea/gitea/pull/30475

6 months agoFix code owners will not be mentioned when a pull request comes from a forked reposit...
Lunny Xiao [Mon, 15 Apr 2024 14:11:07 +0000 (22:11 +0800)]
Fix code owners will not be mentioned when a pull request comes from a forked repository (#30476)

Fix #30277
Caused by #29783

6 months agoFix overflow on issue dependency (#30484)
silverwind [Mon, 15 Apr 2024 08:49:48 +0000 (10:49 +0200)]
Fix overflow on issue dependency (#30484)

Small tweak here to prevent this and likely other events from
overflowing in the timeline:

<img width="895" alt="Screenshot 2024-04-14 at 22 53 17"
src="https://github.com/go-gitea/gitea/assets/115237/001b4f6b-f649-44ff-b2f0-c8e0dedeb384">

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoKill all gitea processes before air build (#30477)
silverwind [Mon, 15 Apr 2024 08:24:36 +0000 (10:24 +0200)]
Kill all gitea processes before air build (#30477)

So it happened to me multiple times that air leaves zombie processes
after termination. I think ultimately it's some kind of bug in air, but
we can work around.

The change in the delay is unrelated to the zombie processes but seems
to help a bit with duplicate changes resulting in duplicate `make
generate` as seen here:

<img width="424" alt="Screenshot 2024-04-14 at 17 05 47"
src="https://github.com/go-gitea/gitea/assets/115237/6dd1d787-6be3-4fb2-8b0b-cd711c281793">

---------

Co-authored-by: delvh <dev.lh@web.de>
6 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 15 Apr 2024 02:40:53 +0000 (02:40 +0000)]
[skip ci] Updated licenses and gitignores

6 months agoRevert 100% label max-width (#30481)
silverwind [Mon, 15 Apr 2024 01:04:02 +0000 (03:04 +0200)]
Revert 100% label max-width (#30481)

Partial revert of https://github.com/go-gitea/gitea/pull/30479

It's causing problems at least here:
https://github.com/go-gitea/gitea/pull/30344#discussion_r1564895591

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoImprove flex ellipsis (#30479)
wxiaoguang [Sun, 14 Apr 2024 19:43:30 +0000 (03:43 +0800)]
Improve flex ellipsis (#30479)

![image](https://github.com/go-gitea/gitea/assets/2114189/857794d8-2170-42be-a5bf-47ebacbafebd)

---------

Co-authored-by: silverwind <me@silverwind.io>
6 months agoRemove fomantic button module (#30475)
silverwind [Sun, 14 Apr 2024 17:53:52 +0000 (19:53 +0200)]
Remove fomantic button module (#30475)

CSS-only module. Button colors are reduced to this:

<img width="639" alt="Screenshot 2024-04-14 at 15 36 07"
src="https://github.com/go-gitea/gitea/assets/115237/882d6c02-d1de-44f2-b707-db02a9f5070d">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoImprove "must-change-password" logic and document (#30472)
wxiaoguang [Sun, 14 Apr 2024 17:22:14 +0000 (01:22 +0800)]
Improve "must-change-password" logic and document (#30472)

Unify the behaviors of "user create" and "user change-password".

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
6 months agoFix commitstatus summary (#30431)
Lunny Xiao [Sun, 14 Apr 2024 12:16:54 +0000 (20:16 +0800)]
Fix commitstatus summary (#30431)

The target_url is necessary for the UI, but missed in
commit_status_summary table. This PR fix it.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRemove fomantic menu module (#30325)
silverwind [Sun, 14 Apr 2024 11:43:46 +0000 (13:43 +0200)]
Remove fomantic menu module (#30325)

A lot of variants are in use, so the diff stat isn't so great.

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoUse `flex-container` for dashboard layout (#30214)
silverwind [Sun, 14 Apr 2024 11:39:11 +0000 (13:39 +0200)]
Use `flex-container` for dashboard layout (#30214)

Added new class `flex-container-sidebar` to cover the dashboard sidebar.
Previously this was 37.5% with more padding. Now there is less empty
space between the two columns and this matches other pages like repo or
admin settings page.

Desktop:

<img width="1345" alt="Screenshot 2024-03-31 at 15 11 36"
src="https://github.com/go-gitea/gitea/assets/115237/717389d9-d42c-466e-a8fe-e968f79447fd">

Mobile:
<img width="444" alt="Screenshot 2024-03-31 at 15 11 44"
src="https://github.com/go-gitea/gitea/assets/115237/7faa840b-513a-411b-bf2d-26d52b9b71a0">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoRewrite and restyle reaction selector and enable no-sizzle eslint rule (#30453)
silverwind [Sun, 14 Apr 2024 10:44:11 +0000 (12:44 +0200)]
Rewrite and restyle reaction selector and enable no-sizzle eslint rule (#30453)

Enable `no-sizzle` lint rule, there was only one use in `initCompReactionSelector` and:

- Remove all jQuery except the necessary fomantic dropdown init
- Remove the recursion, instead bind event listeners to common parent container nodes

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoPulse page improvements (#30149)
silverwind [Sun, 14 Apr 2024 09:21:16 +0000 (11:21 +0200)]
Pulse page improvements (#30149)

1. add border-radius and spacing to bars
2. use tailwind background classes
3. Add more space around activity list headers

<img width="983" alt="Screenshot 2024-03-27 at 23 40 54"
src="https://github.com/go-gitea/gitea/assets/115237/70f72c30-e69f-4ecb-882f-32b8bc94d638">
<img width="1020" alt="Screenshot 2024-03-27 at 23 41 02"
src="https://github.com/go-gitea/gitea/assets/115237/a35dbbda-515c-40b0-938a-d759f9686b8e">

6 months agoFix JS error when opening to expanded code comment (#30463)
silverwind [Sun, 14 Apr 2024 07:16:03 +0000 (09:16 +0200)]
Fix JS error when opening to expanded code comment (#30463)

Fix regression from
https://github.com/go-gitea/gitea/commit/e0b018706fa7703ef1759d9a75a1399383715808
where opening to a code comment via hash link would give this error:

<img width="1247" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/f9aaeded-8492-4416-9a73-afa0c56220a7">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agofix: Fix to delete cookie when AppSubURL is non-empty (#30375)
Jonathan Tran [Sun, 14 Apr 2024 04:46:56 +0000 (00:46 -0400)]
fix: Fix to delete cookie when AppSubURL is non-empty (#30375)

Cookies may exist on "/subpath" and "/subpath/" for some legacy reasons (eg: changed CookiePath behavior in code). The legacy cookie should be removed correctly.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Kyle D <kdumontnu@gmail.com>
6 months agoAdd `interface{}` to `any` replacement to `make fmt`, exclude `*.pb.go` (#30461)
silverwind [Sat, 13 Apr 2024 17:32:15 +0000 (19:32 +0200)]
Add `interface{}` to `any` replacement to `make fmt`, exclude `*.pb.go` (#30461)

Since https://github.com/go-gitea/gitea/pull/25686, a few `interface{}`
have sneaked into the codebase. Add this replacement to `make fmt` to
prevent this from happening again.

Ideally a linter would do this, but I haven't found any suitable.

6 months agoFix network error when open/close organization/individual projects and redirect to...
yp05327 [Sat, 13 Apr 2024 16:17:01 +0000 (01:17 +0900)]
Fix network error when open/close organization/individual projects and redirect to project page (#30387)

Follow #27734

![image](https://github.com/go-gitea/gitea/assets/18380374/02ed6b9a-cbb6-4f49-a54a-ca76a0d052a9)

Updated:
Redirect to project page instead of project list page.

6 months agoAvoid losing token when updating mirror settings (#30429)
Jason Song [Sat, 13 Apr 2024 15:41:57 +0000 (23:41 +0800)]
Avoid losing token when updating mirror settings (#30429)

Fix #30416.

Before (it shows as "Unset" while there's a token):

<img width="980" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/d7148e3e-62c9-4d2e-942d-3d795b79515a">

After:

<img width="977" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/24aaa1db-5baa-4204-9081-470b15ea72b5">

The username shows as "oauth2" because of
https://github.com/go-gitea/gitea/blob/f9fdac9809335729b2ac3227b2a5f71a62fc64ad/services/migrations/dump.go#L99

I have checked that all usage of `MirrorRemoteAddress` has been updated.

<img width="1806" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2f042501-2824-4511-9203-c84a6731a02d">

However, it needs to be checked again when backporting.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix label rendering (#30456)
wxiaoguang [Sat, 13 Apr 2024 10:05:33 +0000 (18:05 +0800)]
Fix label rendering (#30456)

1. Check whether the label is for an issue or a pull request.
2. Don't use space to layout
3. Make sure the test strings have trailing spaces explicitly, to avoid
some IDE removing the trailing spaces automatically.

6 months agoAdd comment for ContainsRedirectURI about the exact match (#30457)
wxiaoguang [Sat, 13 Apr 2024 09:31:40 +0000 (17:31 +0800)]
Add comment for ContainsRedirectURI about the exact match (#30457)

Close #26897
Replace #30336

6 months agoUpdate JS and PY deps, lock eslint and related plugins (#30452)
silverwind [Sat, 13 Apr 2024 08:54:36 +0000 (10:54 +0200)]
Update JS and PY deps, lock eslint and related plugins (#30452)

Update all JS dependencies and lock eslint and flat-only plugins. There
is at least the blocker
https://github.com/SonarSource/eslint-plugin-sonarjs/issues/454
preventing us from upgrading to eslint 9.

Tested API spec, charts and absolute dates.

6 months agoRefactor cache and disable go-chi cache (#30417)
wxiaoguang [Sat, 13 Apr 2024 08:38:44 +0000 (16:38 +0800)]
Refactor cache and disable go-chi cache (#30417)

use built-in cache package to wrap external go-chi cache package

6 months agoFix admin notice view-detail (#30450)
silverwind [Sat, 13 Apr 2024 07:46:02 +0000 (09:46 +0200)]
Fix admin notice view-detail (#30450)

Fix https://github.com/go-gitea/gitea/issues/30434, regression from
https://github.com/go-gitea/gitea/pull/30115.

I also removed the date insertion into the modal which was also broken
since that date was switched to `absolute-date` because I see no real
purpose to putting that date into the modal.

Result:

<img width="1038" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/aa2eb8b4-73dc-4d98-9b80-3f276f89d9e5">

6 months agoFix mirror error when mirror repo is empty (#30432)
yp05327 [Sat, 13 Apr 2024 03:01:02 +0000 (12:01 +0900)]
Fix mirror error when mirror repo is empty (#30432)

Fix #30424

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoAdd `/public/assets/img/webpack` to ignore files again (#30451)
silverwind [Sat, 13 Apr 2024 02:28:20 +0000 (04:28 +0200)]
Add `/public/assets/img/webpack` to ignore files again (#30451)

Fixes https://github.com/go-gitea/gitea/issues/30442

It's inconvenient to have new untracked files show up in git when
switching to older branches that had generated them.

Introduce a list of such files and folders to gitignore and
dockerignore.

6 months agoLock a few tool dependencies to major versions (#30439)
silverwind [Fri, 12 Apr 2024 12:52:39 +0000 (14:52 +0200)]
Lock a few tool dependencies to major versions (#30439)

It's better having to update these less often, so unlock a few
dependencies that I trust enough to not break to their latest major
versions. This excludes any tool still at major version 0 and
golangci-lint can't really be unlocked either because new versions
almost always break there.

For the v0 packages, I've opened
https://github.com/golangci/misspell/issues/14 and
https://github.com/mvdan/gofumpt/issues/303.

6 months agoFix commit status cache which missed target_url (#30426)
Lunny Xiao [Fri, 12 Apr 2024 11:02:42 +0000 (19:02 +0800)]
Fix commit status cache which missed target_url (#30426)

Fix #30421

---------

Co-authored-by: Jason Song <i@wolfogre.com>
6 months agoRemove jQuery from the commit graph (except Fomantic) (#30395)
Yarden Shoham [Fri, 12 Apr 2024 10:34:12 +0000 (13:34 +0300)]
Remove jQuery from the commit graph (except Fomantic) (#30395)

- Switched to plain JavaScript
- Tested the commit graph and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/d0755ed6-bb5c-4601-a2b7-ebccaf4abce4)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix rename branch 500 when the target branch is deleted but exist in database (#30430)
Lunny Xiao [Fri, 12 Apr 2024 10:11:16 +0000 (18:11 +0800)]
Fix rename branch 500 when the target branch is deleted but exist in database (#30430)

Fix #30428

6 months agoLimit the max line length when parsing git grep output (#30418)
wxiaoguang [Fri, 12 Apr 2024 03:36:34 +0000 (11:36 +0800)]
Limit the max line length when parsing git grep output (#30418)

6 months agoChange the default maxPerPage for gitbucket (#30392)
Kazushi (Jam) Marukawa [Fri, 12 Apr 2024 02:51:40 +0000 (11:51 +0900)]
Change the default maxPerPage for gitbucket (#30392)

This patch improves the migration from gitbucket to gitea.

The gitbucket uses it's own internal perPage value (= 25) for paging and
ignore per_page arguments in the requested URL. This cause gitea to
migrate only 25 issues and 25 PRs from gitbucket repository. This may
not happens on old gitbucket. But recent gitbucket 4.40 or 4.38.4 has
this problem.

This patch change to use this internally hardcoded perPage of gitbucket
as gitea's maxPerPage numer when migrating from gitbucket. There are
several perPage values in gitbucket like 25 for Isseus/PRs and 10 for
Releases. Some of those API doesn't support paging yet. It sounds
difficult to implement, but using the minimum number among them worked
out very well. So, I use 10 in this patch.

Brief descriptions of problems and this patch are also available in
https://github.com/go-gitea/gitea/issues/30316.

In addition, I'm not sure what kind of test cases are possible to write
here. It's a test for migration, so it requires testing gitbucket server
and gitea server, I guess. Please let me know if it is possible to write
such test cases here. Thanks!

6 months agoFix the spacing issue in the Project view (#30415)
HEREYUA [Fri, 12 Apr 2024 02:08:58 +0000 (10:08 +0800)]
Fix the spacing issue in the Project view (#30415)

**fix**:  [#30388](https://github.com/go-gitea/gitea/issues/30388)

**before**

![image](https://github.com/go-gitea/gitea/assets/37935145/52ca7311-dca4-4430-9a37-3c45b08fe3dd)

**after**

![image](https://github.com/go-gitea/gitea/assets/37935145/6b75ce69-4423-4ea4-99a1-d7234287c5c0)

6 months agoAdd commit status summary table to reduce query from commit status table (#30223)
Lunny Xiao [Fri, 12 Apr 2024 01:41:50 +0000 (09:41 +0800)]
Add commit status summary table to reduce query from commit status table (#30223)

This PR adds a new table named commit status summary to reduce queries
from the commit status table. After this change, commit status summary
table will be used for the final result, commit status table will be for
details.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
6 months agoSplit `issue edit` code from `repo-legacy.js` into its own file (#30419)
wxiaoguang [Thu, 11 Apr 2024 18:22:59 +0000 (02:22 +0800)]
Split `issue edit` code from `repo-legacy.js` into its own file (#30419)

Follow Split `index.js` to separate files (#17315)

It's time to move some code away from the messy "legacy" file.

6 months agoCheck the token's owner and repository when registering a runner (#30406)
Zettat123 [Thu, 11 Apr 2024 08:01:44 +0000 (16:01 +0800)]
Check the token's owner and repository when registering a runner (#30406)

Fix #30378

6 months agoAvoid user does not exist error when detecting schedule actions when the commit autho...
yp05327 [Thu, 11 Apr 2024 07:11:32 +0000 (16:11 +0900)]
Avoid user does not exist error when detecting schedule actions when the commit author is an external user (#30357)

![image](https://github.com/go-gitea/gitea/assets/18380374/ddf6ee84-2242-49b9-b066-bd8429ba4d76)

When repo is a mirror, and commit author is an external user, then
`GetUserByEmail` will return error.

reproduce/test:
- mirror Gitea to your instance
- disable action and enable it again, this will trigger
`DetectAndHandleSchedules`

ps: also follow #24706, it only fixed normal runs, not scheduled runs.

6 months agoUpdate actions variables documents (#30394)
Lunny Xiao [Thu, 11 Apr 2024 03:57:03 +0000 (11:57 +0800)]
Update actions variables documents (#30394)

Fix #30393

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Zettat123 <zettat123@gmail.com>
6 months agoFix author name alignment in commits table (#30396)
silverwind [Thu, 11 Apr 2024 03:16:44 +0000 (05:16 +0200)]
Fix author name alignment in commits table (#30396)

Fixes https://github.com/go-gitea/gitea/issues/30129 by introducing a
wrapper div with flexbox that collapses any inter-tag whitespace within.
View diff with whitespace hidden.

Author names aligned:
<img width="172" alt="Screenshot 2024-04-10 at 19 41 27"
src="https://github.com/go-gitea/gitea/assets/115237/d761e8f2-0e67-4f84-8d37-9ed73850470a">

Vertically centered on expand:
<img width="466" alt="Screenshot 2024-04-10 at 19 43 02"
src="https://github.com/go-gitea/gitea/assets/115237/decd68b3-19b5-4cfa-a505-b358e4a0715b">

Ellipsis works:

<img width="344" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/6f8624a2-f8b6-4f3e-ac98-c44dd0cdfca5">

6 months agoUpgrade golangci-lint to v1.57.2 (#30401)
silverwind [Thu, 11 Apr 2024 02:40:03 +0000 (04:40 +0200)]
Upgrade golangci-lint to v1.57.2 (#30401)

Update and adapt to one setting
[deprecation](https://github.com/golangci/golangci-lint/pull/4509).

6 months agoReplace MSSQL driver with a better maintained version (#30390)
Lunny Xiao [Thu, 11 Apr 2024 01:12:40 +0000 (09:12 +0800)]
Replace MSSQL driver with a better maintained version (#30390)

As the latest tag of `github.com/denisenkom/go-mssqldb` is in 2022, but
as a fork of it, `github.com/microsoft/go-mssqldb` has more activities
than the original repository. We can convert the driver to the fork.

Since the interface of Go database driver are the same, it should have
no any affect for the end users.

6 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 11 Apr 2024 00:24:56 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

6 months agoMinor color tweaks (#30397)
silverwind [Wed, 10 Apr 2024 20:29:05 +0000 (22:29 +0200)]
Minor color tweaks (#30397)

New approach to color shades: Stem all colors off the body color
`#1b1f23` using [this](https://pinetools.com/darken-color) and
[this](https://pinetools.com/lighten-color) tool. The differences are
very subtle, but it will give a more consistent color scheme until
https://github.com/go-gitea/gitea/issues/30160.

<img width="1342" alt="Screenshot 2024-04-10 at 20 44 16"
src="https://github.com/go-gitea/gitea/assets/115237/75b65797-2521-46ea-91d8-d76f77b591b1">

6 months agoUse raw Wiki links for non-renderable Wiki files (#30273)
Rafael [Wed, 10 Apr 2024 17:49:57 +0000 (18:49 +0100)]
Use raw Wiki links for non-renderable Wiki files (#30273)

In Wiki pages, short-links created to local Wiki files were always
expanded as regular Wiki Links. In particular, if a link wanted to point
to a file that Gitea doesn't know how to render (e.g, a .zip file), a
user following the link would be silently redirected to the Wiki's home
page.

This change makes short-links* in Wiki pages be expanded to raw wiki
links, so these local wiki files may be accessed without manually
accessing their URL.

* only short-links ending in a file extension that isn't renderable are
affected.

Closes #27121.

Signed-off-by: Rafael GirĂ£o <rafael.s.girao@tecnico.ulisboa.pt>
Co-authored-by: silverwind <me@silverwind.io>
6 months agoVarious improvements for long file and commit names (#30374)
silverwind [Wed, 10 Apr 2024 06:13:22 +0000 (08:13 +0200)]
Various improvements for long file and commit names (#30374)

Fixes: https://github.com/go-gitea/gitea/issues/29438
This contains numerous enhancements for how large commit messages and
large filenames render. Another notable change is that the file path is
no longer cut off by backend at 30 chars, but rendered in full with
wrapping.

<img width="1329" alt="Screenshot 2024-04-09 at 21 53 57"
src="https://github.com/go-gitea/gitea/assets/115237/5ccbb3d6-643a-4f60-ba79-3572b36d5182">
<hr>
<img width="711" alt="Screenshot 2024-04-09 at 21 44 24"
src="https://github.com/go-gitea/gitea/assets/115237/6ffe8fbb-407c-4aa7-b591-3d80daea7d57">
<hr>
<img width="439" alt="Screenshot 2024-04-09 at 21 19 03"
src="https://github.com/go-gitea/gitea/assets/115237/1ec7f6e9-2fd8-4841-87eb-6ca02ab9cd61">
<hr>
<img width="444" alt="Screenshot 2024-04-09 at 21 18 52"
src="https://github.com/go-gitea/gitea/assets/115237/70931b9e-5841-477e-b3bc-98f8d2662964">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
6 months agoFix line height on inline code preview (#30372)
silverwind [Wed, 10 Apr 2024 05:44:48 +0000 (07:44 +0200)]
Fix line height on inline code preview (#30372)

Fixes https://github.com/go-gitea/gitea/issues/30353.

I don't know what causes `code-inner` to not inherit `line-height` from
its direct parent `.lines-code` but instead from grandparent `.markup`
even thought MDN tells me it's
[inherited](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#formal_definition).
This causes no negative impact on other code views, so I think it's the
best solution.

6 months agoRefactor more filterslice (#30370)
Lunny Xiao [Wed, 10 Apr 2024 04:18:41 +0000 (12:18 +0800)]
Refactor more filterslice (#30370)