]> source.dussan.org Git - gitea.git/log
gitea.git
7 months agoLazy load object format with command line and don't do it in OpenRepository (#29712)
Lunny Xiao [Tue, 12 Mar 2024 04:21:27 +0000 (12:21 +0800)]
Lazy load object format with command line and don't do it in OpenRepository (#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.

7 months agoremove repetitive words (#29695)
pengqiseven [Mon, 11 Mar 2024 09:24:23 +0000 (17:24 +0800)]
remove repetitive words (#29695)

Signed-off-by: pengqiseven <912170095@qq.com>
7 months agoSync branches first (#29714)
Jason Song [Mon, 11 Mar 2024 06:42:50 +0000 (14:42 +0800)]
Sync branches first (#29714)

Follow #29493.

Sync branches to DB first, then trigger push events.

7 months agoAdd a warning for disallowed email domains (#29658)
Zettat123 [Mon, 11 Mar 2024 06:07:36 +0000 (14:07 +0800)]
Add a warning for disallowed email domains (#29658)

Resolve #29660

Follow #29522 and #29609

Add a warning for disallowed email domains when admins manually add/edit
users.

Thanks @yp05327 for the
[comment](https://github.com/go-gitea/gitea/pull/29605#issuecomment-1980105119)

![image](https://github.com/go-gitea/gitea/assets/15528715/6737b221-a3a2-4180-9ef8-b846c10f96e0)

7 months agoFix inconsistent rendering of block mathematical expressions (#29677)
yp05327 [Mon, 11 Mar 2024 05:00:50 +0000 (14:00 +0900)]
Fix inconsistent rendering of block mathematical expressions (#29677)

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>
7 months agoUse repo object format name instead of detecting from git repository (#29702)
Lunny Xiao [Sun, 10 Mar 2024 21:30:36 +0000 (05:30 +0800)]
Use repo object format name instead of detecting from git repository (#29702)

It's unnecessary to detect the repository object format from git
repository. Just use the repository's object format name.

7 months agoImprove CSV rendering (#29638)
silverwind [Sun, 10 Mar 2024 19:28:59 +0000 (20:28 +0100)]
Improve CSV rendering (#29638)

Before:

<img width="1332" alt="Screenshot 2024-03-06 at 21 42 17"
src="https://github.com/go-gitea/gitea/assets/115237/0ea07eee-31f8-4783-bd56-37bd8396f00d">

After:
<img width="1336" alt="Screenshot 2024-03-06 at 21 41 58"
src="https://github.com/go-gitea/gitea/assets/115237/eb7f9cc9-587f-4e3b-92bd-cc67ca639963">

7 months agoRemove jQuery AJAX from the comment edit history (#29703)
Yarden Shoham [Sun, 10 Mar 2024 19:26:41 +0000 (21:26 +0200)]
Remove jQuery AJAX from the comment edit history (#29703)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the comment edit history list, diff, and delete functionality
and it works as before

# Demo using `fetch` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/e8c557bc-f2b9-4d73-b55e-0850c1b19364)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agofix: rendering internal file links in org (#29669)
Ankit R Gadiya [Sun, 10 Mar 2024 16:30:14 +0000 (22:00 +0530)]
fix: rendering internal file links in org (#29669)

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

7 months agoFix broken webhooks (#29690)
Lunny Xiao [Sun, 10 Mar 2024 01:32:48 +0000 (09:32 +0800)]
Fix broken webhooks (#29690)

Fix #29689

7 months agoSuppress error from monaco-editor (#29684)
silverwind [Sat, 9 Mar 2024 17:37:29 +0000 (18:37 +0100)]
Suppress error from monaco-editor (#29684)

Fixes: https://github.com/go-gitea/gitea/issues/29414
I see no way for us to catch this error, so downgrade it until
https://github.com/microsoft/monaco-editor/issues/4325 is fixed, which
will likely take a few weeks to propagate up from vscode.

The entries in `updates.config.js` will make
[`updates`](https://github.com/silverwind/updates) not upgrade these
anymore and I think it's good documentation as well to have the reasons
why we don't upgrade these dependencies.

7 months agoFix action runner offline label padding (#29691)
Chongyi Zheng [Sat, 9 Mar 2024 13:13:08 +0000 (08:13 -0500)]
Fix action runner offline label padding (#29691)

Before:

The `offline` padding is `calc(.833em - 1px)` from `basic` CSS class,
but `idle` padding is `6px`.

<img width="1035" alt="image"
src="https://github.com/go-gitea/gitea/assets/37034805/ccb42615-20d7-4032-a805-40cd9643012d">

After:

<img width="1035" alt="image"
src="https://github.com/go-gitea/gitea/assets/37034805/d6af99c8-76cb-4850-96d6-5289b06e1ca8">

7 months agoUpdate allowed attachment types (#29688)
silverwind [Sat, 9 Mar 2024 12:41:32 +0000 (13:41 +0100)]
Update allowed attachment types (#29688)

Update to match GitHub's latest.

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoCompletely style the webkit autofill (#29683)
silverwind [Sat, 9 Mar 2024 12:14:42 +0000 (13:14 +0100)]
Completely style the webkit autofill (#29683)

Previously it was only partially styled, e.g. there was black text on
white background even in dark theme caused by fomantic styles.

<img width="195" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/bc5cf516-2aef-45c3-854a-c9f5497aacca">

<img width="195" alt="Screenshot 2024-03-09 at 02 09 29"
src="https://github.com/go-gitea/gitea/assets/115237/ef0af17d-6e0b-402e-b24d-bfa34dc2f4e0">

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoInclude go files in tailwind processing (#29686)
silverwind [Sat, 9 Mar 2024 12:09:22 +0000 (13:09 +0100)]
Include go files in tailwind processing (#29686)

We need to scan `.go` files for tailwind classes. Does not seem to
affect build time much luckily.

Fixes:
https://github.com/go-gitea/gitea/pull/29678#discussion_r1518448600

Verified via `rg tw-object-contain public/assets/css/index.css`.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoFix WebHookEditor regression from jQuery removal (#29692)
Yarden Shoham [Sat, 9 Mar 2024 11:59:16 +0000 (13:59 +0200)]
Fix WebHookEditor regression from jQuery removal (#29692)

Make these calls optional

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoPatch in exact search for meilisearch (#29671)
6543 [Sat, 9 Mar 2024 01:39:27 +0000 (02:39 +0100)]
Patch in exact search for meilisearch (#29671)

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*

7 months agoUse more specific selector for `name` links (#29679)
silverwind [Fri, 8 Mar 2024 23:21:45 +0000 (00:21 +0100)]
Use more specific selector for `name` links (#29679)

Followup https://github.com/go-gitea/gitea/pull/29305. As per discussion
in https://github.com/go-gitea/gitea/pull/29666#discussion_r1517506422,
make this selector only search in the current `.markup` document, as
there can be multiples displayed at the same time.

@DanielMatiasCarvalho maybe you can review.

7 months agoReplace more gt- with tw- (#29678)
silverwind [Fri, 8 Mar 2024 21:02:05 +0000 (22:02 +0100)]
Replace more gt- with tw- (#29678)

This will conclude the trivial class replacements.

7 months agoFix commit_status problem when testing (#29672)
charles [Fri, 8 Mar 2024 15:43:48 +0000 (23:43 +0800)]
Fix commit_status problem when testing (#29672)

Close #29661

fix #29656

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoSupport pasting URLs over markdown text (#29566)
silverwind [Fri, 8 Mar 2024 15:15:58 +0000 (16:15 +0100)]
Support pasting URLs over markdown text (#29566)

Support pasting URLs over selection text in the textarea editor. Does
not work in EasyMDE and I don't intend to support it. Image paste works
as usual in both Textarea and EasyMDE.

The new `replaceTextareaSelection` function changes textarea content via
[`insertText`](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#using_inserttext)
command, which preserves history, e.g. `CTRL-Z` works and is also
demostrated below. We should later refactor the image paste code to use
the same function because it currently destroys history.

Overriding the formatting via `Shift` key is supported as well, e.g.
`Ctrl+Shift+V` will insert the URL as-is, like on GitHub.

![urlpaste](https://github.com/go-gitea/gitea/assets/115237/522b1023-6797-401c-9e4a-498570adfc88)

7 months agobump python version to 3.12 in dev container (#29670)
yp05327 [Fri, 8 Mar 2024 15:10:01 +0000 (00:10 +0900)]
bump python version to 3.12 in dev container (#29670)

![image](https://github.com/go-gitea/gitea/assets/18380374/963dc021-ac9b-4713-8344-654f966c80a4)

The default version is 3.9.2, which is not supported by poetry.

---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoAdd cache for branch divergence on branch list page (#29577)
Lunny Xiao [Fri, 8 Mar 2024 10:21:24 +0000 (18:21 +0800)]
Add cache for branch divergence on branch list page (#29577)

The branch page for blender project will take 6s because calculating
divergence is very slow.
This PR will add a cache for the branch divergence calculation. So when
the second visit the branch list, it will take only less 200ms.

7 months agoFix user-defined markup links targets (#29305)
DC [Fri, 8 Mar 2024 09:53:01 +0000 (09:53 +0000)]
Fix user-defined markup links targets (#29305)

This seeks to fix the bug reported on issue #29196.

Cause:
ID's with custom characters (- , _ , etc.), were not linking correctly
in the Markdown file when rendered in the browser because the ID in the
respective destinies would be different than the one in anchor, while
for IDs with only letters, the ID would be the same.

Fix:
It was suggested that to fix this bug, it should more or less like
GitHub does it. While in gitea the anchors would be put in HTML like
this:
```
<p dir="auto"><a href="#user-content-_toc152597800" rel="nofollow">Review</a></p>
<p dir="auto"><a href="#user-content-_toc152597802" rel="nofollow">Staging</a></p>
<p dir="auto"><a href="#user-content-_toc152597803" rel="nofollow">Development</a></p>
<p dir="auto"><a href="#user-content-_toc152597828" rel="nofollow">Testing</a></p>
<p dir="auto"><a href="#user-content-_toc152597829" rel="nofollow">Unit-tests</a></p>

```
In GitHub, the same anchor's href properties would be the same without
"user-content-" trailing behind.

So my code made sure to change those anchors, so it would not include
"user-content-" and then add respective Event Listeners so it would
scroll into the supposed places.

Fixes: #29196
---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoDon't show AbortErrors on logout (#29639)
silverwind [Fri, 8 Mar 2024 09:47:32 +0000 (10:47 +0100)]
Don't show AbortErrors on logout (#29639)

When logging out of Gitea, a error toast can be seen for a split second.
I don't know why or how it happens but I found it it's an `AbortError`
(related to
[AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)),
so let's hide it.

7 months agoStyle fomantic grey labels (#29458)
silverwind [Fri, 8 Mar 2024 09:42:12 +0000 (10:42 +0100)]
Style fomantic grey labels (#29458)

Fomantic grey labels in the dashboard repo lists were showing original
fomantic colors, fixed that. Also slightly tweaked the light theme
colors so it uses same opacity values as dark theme.

<img width="165" alt="Screenshot 2024-03-07 at 21 06 23"
src="https://github.com/go-gitea/gitea/assets/115237/72744d6f-2ee1-4e5d-8ba0-b482a446f535">
<img width="167" alt="Screenshot 2024-03-07 at 21 06 00"
src="https://github.com/go-gitea/gitea/assets/115237/1ba93775-e5a9-4b28-b90f-59c1e9199687">

7 months agoDon't use `<br />` in alert block (#29650)
Yarden Shoham [Fri, 8 Mar 2024 09:30:41 +0000 (11:30 +0200)]
Don't use `<br />` in alert block (#29650)

- 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>
7 months agoFix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize...
yp05327 [Fri, 8 Mar 2024 08:44:50 +0000 (17:44 +0900)]
Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653)

Fix #29506

7 months agoSet user's 24h preference from their current OS locale (#29651)
silverwind [Fri, 8 Mar 2024 07:57:52 +0000 (08:57 +0100)]
Set user's 24h preference from their current OS locale (#29651)

Fixes: https://github.com/go-gitea/gitea/issues/28371
Fixed by using a JS solution that formats according to `lang`, but alters the 24h format setting as per user's locale. This will work for all tooltips:

<img width="243" alt="Screenshot 2024-03-07 at 23 03 35" src="https://github.com/go-gitea/gitea/assets/115237/6d16c71c-6786-4eda-8cdc-50ec68ba62c6">
<img width="250" alt="Screenshot 2024-03-07 at 23 03 17" src="https://github.com/go-gitea/gitea/assets/115237/4e26bbb7-12df-4b81-bd37-14705e87e8f7">
<img width="310" alt="Screenshot 2024-03-07 at 23 14 34" src="https://github.com/go-gitea/gitea/assets/115237/1ef599f0-6401-4e19-b1da-59cdfc09b0f6">

I think there is only one other place in the UI where we render such absolute dates, which is in the actions view and which I've also fixed:

<img width="275" alt="Screenshot 2024-03-07 at 23 04 00" src="https://github.com/go-gitea/gitea/assets/115237/df0fbe1f-96ee-4338-ab5e-2b10e215005d">

7 months agoMove get/set default branch from git package to gitrepo package to hide repopath...
Lunny Xiao [Fri, 8 Mar 2024 07:30:10 +0000 (15:30 +0800)]
Move get/set default branch from git package to gitrepo package to hide repopath (#29126)

7 months agoMake runs-on support variable expression (#29468)
sillyguodong [Fri, 8 Mar 2024 06:14:35 +0000 (14:14 +0800)]
Make runs-on support variable expression (#29468)

As title.
Close issue: https://gitea.com/gitea/act_runner/issues/445
Follow: https://gitea.com/gitea/act/pulls/91

Move `getSecretsOfTask` and `getVariablesOfTask` under `models` because
of circular dependency issues.

7 months agoFilter for default-branch selection (#29388)
Tim-Niclas Oelschläger [Fri, 8 Mar 2024 05:36:27 +0000 (06:36 +0100)]
Filter for default-branch selection (#29388)

Filter for default-branch selection (fixes #4751)

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/dcae266d-2e04-41bf-8739-64a85c9007f6)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/5f27c0a7-1d30-4ccd-b4bb-6c34fff1b79f)

---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFixing the issue when status check per rule matches multiple actions (#29631)
charles [Fri, 8 Mar 2024 05:02:13 +0000 (13:02 +0800)]
Fixing the issue when status check per rule matches multiple actions (#29631)

Close #29628
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
7 months agoFix 500 when deleting account with incorrect password or unsupported login type ...
Lunny Xiao [Fri, 8 Mar 2024 04:28:21 +0000 (12:28 +0800)]
Fix 500 when deleting account with incorrect password or unsupported login type (#29579)

Fix #26210

---------

Co-authored-by: Jason Song <i@wolfogre.com>
7 months agoPartially enable MSSQL case-sensitive collation support (#29238)
wxiaoguang [Fri, 8 Mar 2024 03:19:35 +0000 (11:19 +0800)]
Partially enable MSSQL case-sensitive collation support (#29238)

Follow #28662

7 months agoStore webhook event in database (#29145)
oliverpool [Thu, 7 Mar 2024 22:18:38 +0000 (23:18 +0100)]
Store webhook event in database (#29145)

Refactor the webhook logic, to have the type-dependent processing happen
only in one place.

---

## Current webhook flow

1. An event happens
2. It is pre-processed (depending on the webhook type) and its body is
added to a task queue
3. When the task is processed, some more logic (depending on the webhook
type as well) is applied to make an HTTP request

This means that webhook-type dependant logic is needed in step 2 and 3.
This is cumbersome and brittle to maintain.

Updated webhook flow with this PR:
1. An event happens
2. It is stored as-is and added to a task queue
3. When the task is processed, the event is processed (depending on the
webhook type) to make an HTTP request

So the only webhook-type dependent logic happens in one place (step 3)
which should be much more robust.

## Consequences of the refactor

- the raw event must be stored in the hooktask (until now, the
pre-processed body was stored)
- to ensure that previous hooktasks are correctly sent, a
`payload_version` is added (version 1: the body has already been
pre-process / version 2: the body is the raw event)

So future webhook additions will only have to deal with creating an
http.Request based on the raw event (no need to adjust the code in
multiple places, like currently).

Moreover since this processing happens when fetching from the task
queue, it ensures that the queuing of new events (upon a `git push` for
instance) does not get slowed down by a slow webhook.

As a concrete example, the PR #19307 for custom webhooks, should be
substantially smaller:
- no need to change `services/webhook/deliver.go`
- minimal change in `services/webhook/webhook.go` (add the new webhook
to the map)
- no need to change all the individual webhook files (since with this
refactor the `*webhook_model.Webhook` is provided as argument)

7 months agoFix bug hidden on CI and make ci failed if tests failure (#29254)
Lunny Xiao [Thu, 7 Mar 2024 16:43:32 +0000 (00:43 +0800)]
Fix bug hidden on CI and make ci failed if tests failure (#29254)

The tests on migration tests failed but CI reports successfully

https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141

This PR will fix the bug on migration v283 and also the CI hidden
behaviour.

The reason is on the Makefile

`GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will
return the error exit code.

But

`for pkg in $(shell $(GO) list
code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
done`

will not work.

This also fix #29602

7 months agoRemove jQuery AJAX from the repo editor (#29636)
Yarden Shoham [Thu, 7 Mar 2024 07:28:33 +0000 (09:28 +0200)]
Remove jQuery AJAX from the repo editor (#29636)

# Preview Tab
- Removed the jQuery AJAX call and replaced with our fetch wrapper
- Tested the preview tab functionality and it works as before

# Diff Tab
- Removed the jQuery AJAX call and replaced with htmx
- Tested the diff tab functionality and it works as before

## htmx Attributes
- `hx-post="{{.RepoLink}}..."`: make a POST request to the endpoint
- `hx-indicator=".tab[data-tab='diff']"`: attach the loading indicator
to the tab body
- `hx-target=".tab[data-tab='diff']"`: target the tab body for swapping
with the response
- `hx-swap="innerHTML"`: swap the target's inner HTML
- `hx-include="#edit_area"`: include the value of the textarea (content)
in the request body
- `hx-vals='{"context":"{{.BranchLink}}"}'`: include the context in the
request body
- `hx-params="context,content"`: include only these keys in the request
body

# Demo using `fetch` and `htmx` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/585cd6e8-f329-4c9e-ab53-a540acbd7988)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoUse strict protocol check when redirect (#29642)
wxiaoguang [Thu, 7 Mar 2024 02:03:41 +0000 (10:03 +0800)]
Use strict protocol check when redirect (#29642)

7 months agoUpdate various logos and unify their filenames (#29637)
silverwind [Wed, 6 Mar 2024 22:20:05 +0000 (23:20 +0100)]
Update various logos and unify their filenames (#29637)

1. Checked all logos, updated 3 of them to newer versions.
2. Remove `open-with-` infix on the editor logos to be consistent with
other files.

<img width="626" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3b2d9486-6e0a-45c6-b0e4-d38dc4c0b118">

7 months agoTweak actions color and borders (#29640)
silverwind [Wed, 6 Mar 2024 21:44:24 +0000 (22:44 +0100)]
Tweak actions color and borders (#29640)

- Increase contrast overall
- Unalias the ansi color in dark theme and copy them to light
- Add outer border
- Add border radius

<img width="1337" alt="Screenshot 2024-03-06 at 22 30 03"
src="https://github.com/go-gitea/gitea/assets/115237/11407c0f-0bb2-435e-a034-22b1f106d9b0">
<img width="1335" alt="Screenshot 2024-03-06 at 22 36 59"
src="https://github.com/go-gitea/gitea/assets/115237/267db442-0979-4acc-a79e-8579b4cb0262">

7 months agoAdd download URL for executable files (#28260)
Earl Warren [Wed, 6 Mar 2024 16:10:06 +0000 (00:10 +0800)]
Add download URL for executable files (#28260)

Consider executable files as a valid case when returning a DownloadURL for them.
They are just regular files with the difference being the executable permission bit being set.

Co-authored-by: Gusted <postmaster@gusted.xyz>
7 months agoMove all login and account creation page labels to be above inputs (#29432)
Rafael Heard [Wed, 6 Mar 2024 14:20:26 +0000 (09:20 -0500)]
Move all login and account creation page labels to be above inputs (#29432)

There are a few inconsistencies within Gitea and this PR addresses one
of them. This PR updates the sign-in page layout, including the register
and openID tabs, to match the layout of the settings pages
(/user/settings) for more consistency.

This PR updates the following routes:
`/user/login`
`/user/sign_up`
`/user/login/openid`
`/user/forgot_password`
`/user/link_account`
`/user/recover_account`

**Before**
<img width="968" alt="Screenshot 2024-02-05 at 8 27 24 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/fb0cb517-57c0-4eed-be1d-56f36bd1960d">

**After**
<img width="968" alt="Screenshot 2024-02-05 at 8 26 39 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/428d691d-0a42-4a67-a646-05527f2a7b41">

This PR addresses a revert of the original PR due to this
[comment](https://github.com/go-gitea/gitea/pull/28753#issuecomment-1956596817).

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
7 months agoAvoid issue info panic (#29625)
wxiaoguang [Wed, 6 Mar 2024 13:12:44 +0000 (21:12 +0800)]
Avoid issue info panic (#29625)

Fix #29624

7 months agoCache repository default branch commit status to reduce query on commit status table...
Lunny Xiao [Wed, 6 Mar 2024 12:17:19 +0000 (20:17 +0800)]
Cache repository default branch commit status to reduce query on commit status table (#29444)

After repository commit status has been introduced on dashaboard, the
most top SQL comes from `GetLatestCommitStatusForPairs`.

This PR adds a cache for the repository's default branch's latest
combined commit status. When a new commit status updated, the cache will
be marked as invalid.

<img width="998" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/76759de7-3a83-4d54-8571-278f5422aed3">

7 months agoAvoid unexpected panic in graceful manager (#29629)
wxiaoguang [Wed, 6 Mar 2024 11:50:39 +0000 (19:50 +0800)]
Avoid unexpected panic in graceful manager (#29629)

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.

7 months agoAdd a link for the recently pushed branch notification (#29627)
wxiaoguang [Wed, 6 Mar 2024 11:25:00 +0000 (19:25 +0800)]
Add a link for the recently pushed branch notification (#29627)

7 months agoFix wrong header of org project view page (#29626)
yp05327 [Wed, 6 Mar 2024 10:23:27 +0000 (19:23 +0900)]
Fix wrong header of org project view page (#29626)

Follow #29248

The project view page still using `user/overview/header.tmpl`

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/9cb638a3-7cc6-4efa-979a-e2592007fd12)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/62b0b2ea-8cb0-459f-b27a-bad3908eb1c0)

7 months agoDetect broken git hooks (#29494)
Jason Song [Wed, 6 Mar 2024 09:56:04 +0000 (17:56 +0800)]
Detect broken git hooks (#29494)

Detect broken git hooks by checking if the commit id of branches in DB
is the same with the git repo.

It can help #29338 #28277 and maybe more issues.

Users could complain about actions, webhooks, and activities not
working, but they were not aware that it is caused by broken git hooks
unless they could see a warning.

<img width="1348" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2b92a46d-7f1d-4115-bef4-9f970bd695da">

It should be merged after #29493. Otherwise, users could see a ephemeral
warning after committing and opening the repo home page immediately.

And it also waits for #29495, since the doc link (the anchor part) will
be updated.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoSync branches to DB immediately when handle git hook calling (#29493)
Jason Song [Wed, 6 Mar 2024 08:47:52 +0000 (16:47 +0800)]
Sync branches to DB immediately when handle git hook calling (#29493)

Unlike other async processing in the queue, we should sync branches to
the DB immediately when handling git hook calling. If it fails, users
can see the error message in the output of the git command.

It can avoid potential inconsistency issues, and help #29494.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoFix wrong line number in code search result (#29260)
yp05327 [Wed, 6 Mar 2024 07:24:43 +0000 (16:24 +0900)]
Fix wrong line number in code search result (#29260)

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>
7 months agoMake wiki default branch name changable (#29603)
wxiaoguang [Wed, 6 Mar 2024 06:26:32 +0000 (14:26 +0800)]
Make wiki default branch name changable (#29603)

Fix #29000
Fix #28685
Fix #18568

Related: #27497

And by the way fix #24036, add a Cancel button there (one line)

7 months agoA small refactor for agit implementation (#29614)
Lunny Xiao [Wed, 6 Mar 2024 05:52:48 +0000 (13:52 +0800)]
A small refactor for agit implementation (#29614)

This PR made the code simpler, reduced unnecessary database queries and
fixed some warnning for the errors.New .

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoUpdate Twitter Logo (#29621)
silverwind [Wed, 6 Mar 2024 05:21:39 +0000 (06:21 +0100)]
Update Twitter Logo (#29621)

<img width="430" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9cf7b0a3-406b-4dd6-ab3d-d31a96b9335a">

7 months agoFix 500 error when adding PR comment (#29622)
wxiaoguang [Wed, 6 Mar 2024 05:09:38 +0000 (13:09 +0800)]
Fix 500 error when adding PR comment (#29622)

7 months agoRun editorconfig-checker on `locale_en-US.ini` (#29608)
silverwind [Wed, 6 Mar 2024 01:48:14 +0000 (02:48 +0100)]
Run editorconfig-checker on `locale_en-US.ini` (#29608)

Will prevent trailing whitespace etc being introduced in this file.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agobump protobuf module (#29617)
techknowlogick [Wed, 6 Mar 2024 01:35:29 +0000 (20:35 -0500)]
bump protobuf module (#29617)

7 months agoAdd ac claim for old docker/build-push-action@v3 / current buildx gha cache (#29584)
ChristopherHX [Tue, 5 Mar 2024 17:34:42 +0000 (18:34 +0100)]
Add ac claim for old docker/build-push-action@v3 / current buildx gha cache (#29584)

Also resolves a warning for current releases

```
| ##[group]GitHub Actions runtime token ACs
| ##[warning]Cannot parse GitHub Actions Runtime Token ACs: "undefined" is not valid JSON
| ##[endgroup]
====>
| ##[group]GitHub Actions runtime token ACs
| ##[endgroup]
```
\* this is an error in v3

References in the docker org:
-
https://github.com/docker/build-push-action/blob/831ca179d3cf91cf0c90ca465a408fa61e2129a2/src/main.ts#L24
-
https://github.com/docker/actions-toolkit/blob/7d8b4dc6694df35a06fae786427672ce27a8c18d/src/github.ts#L61

No known official action of GitHub makes use of this claim.

Current releases throw an error when configure to use actions cache
```
| ERROR: failed to solve: failed to configure gha cache exporter: invalid token without access controls
| ##[error]buildx failed with: ERROR: failed to solve: failed to configure gha cache exporter: invalid token without access controls
```

7 months agoSkip email domain check when admins edit user emails (#29609)
Zettat123 [Tue, 5 Mar 2024 16:51:56 +0000 (00:51 +0800)]
Skip email domain check when admins edit user emails (#29609)

Follow #29522

Administrators should be able to set a user's email address even if the
email address is not in `EMAIL_DOMAIN_ALLOWLIST`

7 months agoImprove natural sort (#29611)
wxiaoguang [Tue, 5 Mar 2024 15:13:35 +0000 (23:13 +0800)]
Improve natural sort (#29611)

Hugely simplify the code, and add more tests (only new approach could
pass)

7 months agoAdd empty repo check in `DetectAndHandleSchedules` (#29606)
yp05327 [Tue, 5 Mar 2024 14:47:07 +0000 (23:47 +0900)]
Add empty repo check in `DetectAndHandleSchedules` (#29606)

![image](https://github.com/go-gitea/gitea/assets/18380374/e6081301-bd3e-4cf6-ba4e-e574348dffb4)

7 months agoFix contributor graphs mobile layout and responsiveness (#29597)
silverwind [Tue, 5 Mar 2024 14:21:52 +0000 (15:21 +0100)]
Fix contributor graphs mobile layout and responsiveness (#29597)

Also removed a unneeded and actually conflicting class name
`stats-table`.

Fixes: https://github.com/go-gitea/gitea/issues/29192
<img width="445" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/787804ed-6ba4-437f-b314-f23cbe2edf7a">

7 months agoSkip email domain check when admin users adds user manually (#29522)
Zettat123 [Tue, 5 Mar 2024 05:55:47 +0000 (13:55 +0800)]
Skip email domain check when admin users adds user manually (#29522)

Fix #27457

Administrators should be able to manually create any user even if the
user's email address is not in `EMAIL_DOMAIN_ALLOWLIST`.

7 months agoReplace more `gt-` with `tw-`, update frontend docs (#29595)
silverwind [Tue, 5 Mar 2024 05:29:32 +0000 (06:29 +0100)]
Replace more `gt-` with `tw-`, update frontend docs (#29595)

Tested a few things, all working fine. Not sure if the chinese machine
translation is good.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove unnecessary ctxData for "attachments" template (#29600)
wxiaoguang [Tue, 5 Mar 2024 04:59:16 +0000 (12:59 +0800)]
Remove unnecessary ctxData for "attachments" template (#29600)

The "attachments" template never uses it

7 months agoAdjust tailwind content globs (#29596)
silverwind [Tue, 5 Mar 2024 04:31:29 +0000 (05:31 +0100)]
Adjust tailwind content globs (#29596)

Tailwind content is not going to appear in `web_src/css`,
`web_src/fomantic` or `web_src/svg` or the JSON templates, so we don't
need to have tailwind scan these directories which will speed up the
build.

---------

Co-authored-by: delvh <dev.lh@web.de>
7 months agoUse flex wrap to layout the PR update button (#29590)
wxiaoguang [Tue, 5 Mar 2024 03:03:14 +0000 (11:03 +0800)]
Use flex wrap to layout the PR update button (#29590)

Follow #29418

I think using "flex-wrap: wrap" here is better than hard-coding the screen width.

By using "flex-wrap: wrap", the UI layouts automatically for various
widths (even if in some languages, the sentence might be pretty long)

7 months agoMake "/user/login" page redirect if the current user has signed in (#29583)
wxiaoguang [Tue, 5 Mar 2024 02:12:03 +0000 (10:12 +0800)]
Make "/user/login" page redirect if the current user has signed in (#29583)

Fix #29582 and maybe more.
Maybe fix #29116

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 5 Mar 2024 00:23:19 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoFix projects mode bugs (#29593)
Denys Konovalov [Mon, 4 Mar 2024 20:49:21 +0000 (21:49 +0100)]
Fix projects mode bugs (#29593)

Fix for regressions introduced by #28805

Enabled projects on repos created before the PR weren't detected. Also,
the way projects mode was detected in settings didn't match the way it
was detected on permission check, which leads to confusion.

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRegenerate fomantic lockfile and build it with our browserslist (#29560)
silverwind [Mon, 4 Mar 2024 20:24:12 +0000 (21:24 +0100)]
Regenerate fomantic lockfile and build it with our browserslist (#29560)

1. Make fomantic build use [our
browserslist](https://github.com/go-gitea/gitea/blob/e3524c63d6d42865ea8288af89b372544d35474b/package.json#L99).
I found no other way than to sed-replace into it's js, the normal
browserlist config files do not work. The effect of this change is the
removal of some uneeded CSS vendor prefixes.
2. Regenerate `web_src/fomantic/package-lock.json`, this might shut up
some security scanners.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoDo not exceed display for the PR page buttons on smaller screens (#29418)
charles [Mon, 4 Mar 2024 14:41:53 +0000 (22:41 +0800)]
Do not exceed display for the PR page buttons on smaller screens (#29418)

Fixes #29189.

This is the result after the fix at a width of 768 pixels.

![圖片](https://github.com/go-gitea/gitea/assets/30816317/626d06b3-fd5b-4392-84e1-1191c965aff5)

7 months agoAdd aria-label to the navbar menu button (#29587)
wxiaoguang [Mon, 4 Mar 2024 14:31:59 +0000 (22:31 +0800)]
Add aria-label to the navbar menu button (#29587)

7 months agoDocument that all unmerged feature PRs will be moved to next milestone when the featu...
Lunny Xiao [Mon, 4 Mar 2024 13:51:12 +0000 (21:51 +0800)]
Document that all unmerged feature PRs will be moved to next milestone when the feature freeze time comes (#29578)

Some contributors may be surprised when moving the feature PRs to the
next release when the feature freeze time comes. So this PR documents
the habits we have done for feature freeze so people expect the
maintainers' behaviors. We are sorry for disturbing you with the
milestones changes.

A feature freeze announcement should be published 2 or 3 weeks before
the feature freeze by maintainers.

7 months agoMake admin pages wider because of left sidebar added and some tables become too narro...
Lunny Xiao [Mon, 4 Mar 2024 13:48:59 +0000 (21:48 +0800)]
Make admin pages wider because of left sidebar added and some tables become too narrow (#29581)

Fix #25939

screenshots

<img width="1895" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/937eb28d-bb7d-4765-b580-bc991d61f467">

7 months agoRefactor star/watch button (#29576)
wxiaoguang [Mon, 4 Mar 2024 12:56:34 +0000 (20:56 +0800)]
Refactor star/watch button (#29576)

1. Use "star/unstart", but not `{{if}}un{{}}star{{}}` (the same to "watch/unwatch")
2. Use "not-mobile" for hiding the elements on mobile

7 months agoRemove unnecessary SanitizeHTML from code (#29575)
wxiaoguang [Mon, 4 Mar 2024 12:02:45 +0000 (20:02 +0800)]
Remove unnecessary SanitizeHTML from code (#29575)

* "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

7 months agoAdd missing database transaction for new issue (#29490)
Lunny Xiao [Mon, 4 Mar 2024 11:24:02 +0000 (19:24 +0800)]
Add missing database transaction for new issue (#29490)

When creating an issue, inserting issue, assign users and set project
should be in the same transaction.

7 months agoFix incorrect package link method calls in templates (#29580)
wxiaoguang [Mon, 4 Mar 2024 10:57:30 +0000 (18:57 +0800)]
Fix incorrect package link method calls in templates (#29580)

Fix #29562
Follow  #29531

7 months agoMove some asymkey functions to service layer (#28894)
Lunny Xiao [Mon, 4 Mar 2024 08:57:39 +0000 (16:57 +0800)]
Move some asymkey functions to service layer (#28894)

After the moving, all models will not depend on `util.Rename` so that I
can do next step refactoring.

7 months agoAdd user blocking (#29028)
KN4CK3R [Mon, 4 Mar 2024 08:16:03 +0000 (09:16 +0100)]
Add user blocking (#29028)

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>
7 months agoAllow options to disable user ssh keys configuration from the interface on app.ini...
Lunny Xiao [Mon, 4 Mar 2024 07:50:21 +0000 (15:50 +0800)]
Allow options to disable user ssh keys configuration from the interface on app.ini (#29447)

Follow #29275
Extract from #20549
Fix #24716

---------

Co-authored-by: delvh <dev.lh@web.de>
7 months agoInline the `css-variables-parser` dependency (#29571)
silverwind [Mon, 4 Mar 2024 05:55:17 +0000 (06:55 +0100)]
Inline the `css-variables-parser` dependency (#29571)

Get rid of the `postcss@7` dependency by inlining this simple function.

7 months agoReplace some `gt-` classes with `tw-` (#29570)
silverwind [Mon, 4 Mar 2024 03:33:20 +0000 (04:33 +0100)]
Replace some `gt-` classes with `tw-` (#29570)

Replace 18 `gt-` prefixes with `tw-` with perl replacement. I manually
checked them all with `rg` afterwards.

7 months agoEnable/disable owner and repo projects independently (#28805)
Denys Konovalov [Mon, 4 Mar 2024 02:56:52 +0000 (03:56 +0100)]
Enable/disable owner and repo projects independently (#28805)

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>
7 months agoAdd an trailing slash to dashboard links (#29555)
wxiaoguang [Mon, 4 Mar 2024 01:02:51 +0000 (09:02 +0800)]
Add an trailing slash to dashboard links (#29555)

Fix #29533, and add some tests for "base/paginate.tmpl"

7 months agoExtend issue template yaml engine (#29274)
6543 [Mon, 4 Mar 2024 00:37:00 +0000 (01:37 +0100)]
Extend issue template yaml engine (#29274)

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>
7 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 4 Mar 2024 00:24:22 +0000 (00:24 +0000)]
[skip ci] Updated licenses and gitignores

7 months agoFix workflow trigger event IssueChangeXXX bug (#29559)
yp05327 [Sun, 3 Mar 2024 18:37:41 +0000 (03:37 +0900)]
Fix workflow trigger event IssueChangeXXX bug (#29559)

Bugs from #29308
Follow #29467

partly fix #29558

7 months agoFix 500 when pushing release to an empty repo (#29554)
Nanguan Lin [Sun, 3 Mar 2024 16:49:05 +0000 (00:49 +0800)]
Fix 500 when pushing release to an empty repo (#29554)

As title.
The former code directly used `ctx.Repo.GitRepo`, causing 500.

https://github.com/go-gitea/gitea/blob/22b4f0c09f1de5e581929bd10f39833d30d2c482/routers/api/v1/repo/release.go#L241

7 months agoUpdate js and py dependencies, bump python (#29561)
silverwind [Sun, 3 Mar 2024 16:23:14 +0000 (17:23 +0100)]
Update js and py dependencies, bump python (#29561)

- Update js and py dependencies excluding `@mcaptcha/vanilla-glue`,
`eslint-plugin-array-func`
- Update stylelint config
- Require python 3.10 and use 3.12 on CI, bump setup-python as well
- Tested markdown toolbar, charts, clipboard, swagger ui, vue

7 months agoFilter Repositories by type (#29231)
Tim-Niclas Oelschläger [Sun, 3 Mar 2024 10:18:34 +0000 (11:18 +0100)]
Filter Repositories by type (#29231)

Filter Repositories by type (resolves #1170, #1318)

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/74e6be62-9010-4ab4-8f9b-bd8afbebb8fb)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/e4d85ed6-7864-4150-8d72-5194dac1293f)

7 months agoBreaking summary for template refactoring (#29395)
wxiaoguang [Sun, 3 Mar 2024 04:57:22 +0000 (12:57 +0800)]
Breaking summary for template refactoring (#29395)

https://github.com/go-gitea/gitea/pull/29395

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 3 Mar 2024 00:25:22 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoFix incorrect cookie path for AppSubURL (#29534)
wxiaoguang [Sun, 3 Mar 2024 00:14:12 +0000 (08:14 +0800)]
Fix incorrect cookie path for AppSubURL (#29534)

Regression of #24107

7 months agogitea.service: Remove syslog.target (#29550)
Martin [Sat, 2 Mar 2024 23:44:43 +0000 (00:44 +0100)]
gitea.service: Remove syslog.target (#29550)

Remove syslog.target from service file, this target hasn't existed for
over a decade.

https://github.com/systemd/systemd/blob/6aa8d43ade72e24c9426e604f7fc4b7582b9db7c/NEWS#L72-L73

7 months agoAdd option to set language in admin user view (#28449)
6543 [Sat, 2 Mar 2024 21:55:02 +0000 (22:55 +0100)]
Add option to set language in admin user view (#28449)

![image](https://github.com/go-gitea/gitea/assets/24977596/be7e3f92-af3f-4628-b4ed-abf6439687f3)
`/admin/users/<UserID>/edit`

![image](https://github.com/go-gitea/gitea/assets/24977596/906af0dd-cceb-4ed9-9cd9-32c71ae1bf71)
`/admin/users/<UserID>`

---
*Sponsored by Kithara Software GmbH*

7 months agoFix elipsis button not working if the last commit loading is deferred (#29544)
Yarden Shoham [Sat, 2 Mar 2024 19:31:59 +0000 (21:31 +0200)]
Fix elipsis button not working if the last commit loading is deferred (#29544)

Before this change, if we had more than 200 entries being deferred in
loading, the entire table would get replaced thus losing any event
listeners attached to the elements within the table, such as the elipsis
button and commit list with tippy.

With this change we remove the previous javascript code that replaced
the table and use htmx to replace the table.

htmx attributes added:
- `hx-indicator="tr.notready td.message span"`: attach the loading
spinner to the files whose last commit is still being loaded
- `hx-trigger="load"` trigger the request-replace behavior as soon as
possible
- `hx-swap="morph"`: use the idiomorph morphing algorithm, this is the
thing that makes it so the elipsis button event listener is kept during
the replacement, fixing the bug because we don't actually replace the
table, only modifying it
- `hx-post="{{.LastCommitLoaderURL}}"`: make a post request to this url
to get the table with all of the commit information

As part of this change I removed the handling of partial replacement in
the case we have less than 200 "not ready" files. The first reason is
that I couldn't make htmx replace only a subset of returned elements,
the second reason is that we have a cache implemented in the backend
already so the only cost added is that we query the cache a few times
(which is sure to be populated due to the initial request), and the last
reason is that since the last refactor of this functionality that
removed jQuery we don't properly send the "not ready" entries as the
backend expects `FormData` with `f[]` and we send a JSON with `f` so we
always query for all rows anyway.

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/482ebfec-66c5-40cc-9c1e-e3b3bfe1bbc1)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/454c517e-3a4e-4006-a49f-99cc56e0fd60)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix incorrect relative/absolute URL usages (#29531)
wxiaoguang [Sat, 2 Mar 2024 17:38:38 +0000 (01:38 +0800)]
Fix incorrect relative/absolute URL usages (#29531)

Add two "HTMLURL" methods for PackageDescriptor.
And rename "FullWebLink" to "VersionWebLink"

7 months agoAdd support for API blob upload of release attachments (#29507)
KN4CK3R [Sat, 2 Mar 2024 17:02:01 +0000 (18:02 +0100)]
Add support for API blob upload of release attachments (#29507)

Fixes #29502

Our endpoint is not Github compatible.

https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset

---------

Co-authored-by: Giteabot <teabot@gitea.io>