]> source.dussan.org Git - gitea.git/log
gitea.git
11 months agofix labeler config on release/v1.21 (#27738)
Denys Konovalov [Sun, 22 Oct 2023 13:53:34 +0000 (15:53 +0200)]
fix labeler config on release/v1.21 (#27738)

Manual backport of #27525

11 months agoEnable followCursor for language stats bar (#27713) (#27739)
Giteabot [Sun, 22 Oct 2023 13:35:58 +0000 (21:35 +0800)]
Enable followCursor for language stats bar (#27713) (#27739)

Backport #27713 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/27600
![](https://github.com/go-gitea/gitea/assets/115237/96743d90-0712-4f13-84ec-66f84e6ed2d7)

Also tested together with https://github.com/go-gitea/gitea/pull/27704,
works well.

Co-authored-by: silverwind <me@silverwind.io>
11 months agoAdd doctor dbconsistency fix to delete repos with no owner (#27290) (#27693)
6543 [Sun, 22 Oct 2023 00:21:41 +0000 (02:21 +0200)]
Add doctor dbconsistency fix to delete repos with no owner (#27290) (#27693)

Backport #27290

11 months agoFix org team endpoint (#27721) (#27727)
Giteabot [Sun, 22 Oct 2023 00:07:28 +0000 (08:07 +0800)]
Fix org team endpoint (#27721) (#27727)

Backport #27721 by @lng2020

Fix #27711

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
11 months agoFeed UI Improvements (#27356) (#27717)
Giteabot [Sat, 21 Oct 2023 11:13:15 +0000 (19:13 +0800)]
Feed UI Improvements (#27356) (#27717)

Backport #27356 by @silverwind

Various improvements related to feeds:

- Fix markdown rendering
- Increase font size from 13px to default 14px via `flex-item`
- Add style to hashes
- Move the timestamp to title line. I realize it's not optimal for
translation, we may need to change all these translations

Before:
<img width="768" alt="Screenshot 2023-09-29 at 22 52 58"
src="https://github.com/go-gitea/gitea/assets/115237/edda8b84-23cf-4a43-90ad-a892798f4e6c">

After:
<img width="781" alt="Screenshot 2023-09-29 at 22 58 09"
src="https://github.com/go-gitea/gitea/assets/115237/7097474d-efcf-4f22-a2ab-834a4e25c4e8">

Co-authored-by: silverwind <me@silverwind.io>
11 months agoImprove diff tree spacing (#27714) (#27719)
Giteabot [Sat, 21 Oct 2023 10:44:58 +0000 (18:44 +0800)]
Improve diff tree spacing (#27714) (#27719)

Backport #27714 by @silverwind

1. Un-indent top-level items, matching GitHub rendering
2. Increase item padding and add 1px gap between items

Before and After:

<img width="247" alt="Screenshot 2023-10-20 at 18 37 32"
src="https://github.com/go-gitea/gitea/assets/115237/43c1ce86-1814-4a8a-9dd2-0c4a82a2be7c">
<img width="241" alt="Screenshot 2023-10-20 at 18 40 46"
src="https://github.com/go-gitea/gitea/assets/115237/b541b85b-c428-4903-becd-773ae5807495">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <m.huber@kithara.com>
11 months agoImprove feed icons and feed merge text color (#27498) (#27716)
Giteabot [Sat, 21 Oct 2023 10:29:06 +0000 (18:29 +0800)]
Improve feed icons and feed merge text color (#27498) (#27716)

Backport #27498 by @silverwind

1. Improve various feed icons
2. Fix merge message color

<img width="763" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3f5bcb23-6d90-4c63-85f2-46bd7e1c96d6">
<img width="769" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/466c37b4-e2f4-42bb-922d-b86596cdc6d0">

Fixes: https://github.com/go-gitea/gitea/issues/27495
Continues: https://github.com/go-gitea/gitea/pull/27356

Co-authored-by: silverwind <me@silverwind.io>
11 months ago[FIX] resolve confusing colors in languages stats by insert a gap (#27704) (#27715)
Giteabot [Fri, 20 Oct 2023 18:04:44 +0000 (02:04 +0800)]
[FIX] resolve confusing colors in languages stats by insert a gap (#27704) (#27715)

Backport #27704 by @RightFS

The current language stats are too obsessed with color matching. Similar
colors are always next to each other. It is a bit troublesome to find
the place where the color matching is generated, so just follow the
example of github and add a gap.

## before

<img width="883" alt="image"
src="https://github.com/go-gitea/gitea/assets/12915306/cf54430c-616c-4b37-b561-5a37c20b2d94">

## after

<img width="877" alt="image"
src="https://github.com/go-gitea/gitea/assets/12915306/e518ea36-2b8f-4f11-a867-a58dc393db85">

Co-authored-by: MrDevil <Right.Sun@outlook.com>
11 months agoFix sticky diff header background (#27697) (#27712)
Giteabot [Fri, 20 Oct 2023 15:44:46 +0000 (23:44 +0800)]
Fix sticky diff header background (#27697) (#27712)

Backport #27697 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/27604
Add negative margins so the header covers any shadow of active elements.
No rendering change of the content of the header because the padding
counteracts the effect.

<img width="128" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3d0f55b6-9351-4985-a290-da9a92d15b4e">

Co-authored-by: silverwind <me@silverwind.io>
11 months agoAdapt `.changelog.yml` to new labeling system (#27701) (#27702)
Giteabot [Thu, 19 Oct 2023 22:29:50 +0000 (06:29 +0800)]
Adapt `.changelog.yml` to new labeling system (#27701) (#27702)

Backport #27701 by @delvh

Otherwise, it is not possible anymore to generate changelogs.

Co-authored-by: delvh <dev.lh@web.de>
11 months agocleanup repo details icons/labels (#27644) (#27654) v1.21.0-rc2
Giteabot [Thu, 19 Oct 2023 20:04:24 +0000 (04:04 +0800)]
cleanup repo details icons/labels (#27644) (#27654)

Backport #27644 by @denyskon

Fix #27596

Change confusing behavior when showing information about a repo via labels and icons.
Implement changes proposed by @lng2020 in
https://github.com/go-gitea/gitea/pull/27627#pullrequestreview-1678787673.

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
11 months agoFix required checkboxes in issue forms (#27592) (#27692)
Giteabot [Thu, 19 Oct 2023 13:35:29 +0000 (21:35 +0800)]
Fix required checkboxes in issue forms (#27592) (#27692)

Backport #27592 by @JakobDev

If you set a checkbox as required in a issue form at the moment, the
checkbox is checked and read only, what does not make much sense. With
this PR, the Checkbox actually needs to be checked. The label supports
now also Markdown. This matches GitHub's behaviour.

And yes, I know the CSS is a ugly workaround. It looks like the given
CSS code is part Fomantic and I don't know how to change that. The
Maintainers are free to change that.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/3f35be75-b0b4-42a7-9048-a4970384a035)

Co-authored-by: JakobDev <jakobdev@gmx.de>
11 months agoUpgrade xorm (#27673) (#27691)
Giteabot [Thu, 19 Oct 2023 10:56:39 +0000 (18:56 +0800)]
Upgrade xorm (#27673) (#27691)

Backport #27673 by @lng2020

Related to https://gitea.com/xorm/xorm/pulls/2341

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
11 months agoAlways delete existing scheduled action tasks (#27662) (#27688)
Giteabot [Thu, 19 Oct 2023 07:37:20 +0000 (15:37 +0800)]
Always delete existing scheduled action tasks (#27662) (#27688)

Backport #27662 by @KN4CK3R

Fixes #27650

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
11 months agoClipboard copy enhancements (#27669) (#27681)
Giteabot [Wed, 18 Oct 2023 16:23:28 +0000 (00:23 +0800)]
Clipboard copy enhancements (#27669) (#27681)

Backport #27669 by @silverwind

1. Do not show temporary tooltips that are triggered from within
dropdowns. Previously this resulted in the tooltip being stuck to
top-left of the page like seen on issue comment URL copy. I could not
figure out any tippy options that prevent this, so I think it's better
to just not show it.
1. Refactor `initGlobalCopyToClipboardListener` so that it does not run
a often useless `document.querySelector` on every click, make
`data-clipboard-text-type` work with `data-clipboard-target`. No use in
current code base but still good to have. Finally some minor code
cleanup in the function.

Point 1 is for this copy button:

<img width="229" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/81f34746-8ea5-43d9-8c6f-f6f417a9e4ad">

Co-authored-by: silverwind <me@silverwind.io>
11 months agoSupport allowed hosts for webhook to work with proxy (#27655) (#27675)
Giteabot [Wed, 18 Oct 2023 13:07:52 +0000 (21:07 +0800)]
Support allowed hosts for webhook to work with proxy (#27655) (#27675)

Backport #27655 by @wolfogre

When `webhook.PROXY_URL` has been set, the old code will check if the
proxy host is in `ALLOWED_HOST_LIST` or reject requests through the
proxy. It requires users to add the proxy host to `ALLOWED_HOST_LIST`.
However, it actually allows all requests to any port on the host, when
the proxy host is probably an internal address.

But things may be even worse. `ALLOWED_HOST_LIST` doesn't really work
when requests are sent to the allowed proxy, and the proxy could forward
them to any hosts.

This PR fixes it by:

- If the proxy has been set, always allow connectioins to the host and
port.
- Check `ALLOWED_HOST_LIST` before forwarding.

Co-authored-by: Jason Song <i@wolfogre.com>
12 months agoFix poster is not loaded in get default merge message (#27657) (#27666)
Giteabot [Tue, 17 Oct 2023 16:20:35 +0000 (00:20 +0800)]
Fix poster is not loaded in get default merge message (#27657) (#27666)

Backport #27657 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoHide archived labels by default from the suggestions when assigning labels for an...
Giteabot [Tue, 17 Oct 2023 14:46:35 +0000 (22:46 +0800)]
Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661)

Backport #27451 by @puni9869

Followup of #27115
Finally closes #25237

## Screenshots
### Issue Sidebar
<img width="513" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9f7fda2f-5a03-4684-8619-fd3498a95b41">

### PR sidebar
<img width="367" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/53db9b64-faec-4a67-91d6-76945596a469">

### PR sidebar with archived labels shown
<img width="352" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9dc5050f-4e69-4f76-bb83-582480a2281e">

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
12 months agoImprove dropdown button alignment and fix hover bug (#27632) (#27637)
Giteabot [Mon, 16 Oct 2023 08:15:15 +0000 (16:15 +0800)]
Improve dropdown button alignment and fix hover bug (#27632) (#27637)

Backport #27632 by @wxiaoguang

1. fix #27631 , and add samples to devtest page
2. fix incorrect color for "ui dropdown button" when hover

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoImprove retrying index issues (#27554) (#27634)
Giteabot [Mon, 16 Oct 2023 01:55:53 +0000 (09:55 +0800)]
Improve retrying index issues (#27554) (#27634)

Backport #27554 by @wolfogre

Fix #27540

Co-authored-by: Jason Song <i@wolfogre.com>
12 months agoFix 404 when deleting Docker package with an internal version (#27615) (#27630)
Giteabot [Sun, 15 Oct 2023 10:08:04 +0000 (18:08 +0800)]
Fix 404 when deleting Docker package with an internal version (#27615) (#27630)

Backport #27615 by @lng2020

close #27601
The Docker registry has an internal version, which leads to 404

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
12 months agoChange the default branch in the agit docs (#27621) (#27623)
Giteabot [Sun, 15 Oct 2023 01:16:15 +0000 (09:16 +0800)]
Change the default branch in the agit docs (#27621) (#27623)

Backport #27621 by @lng2020

It's main now.
relevant #27579

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
12 months agoBackport manually for a tmpl issue in v1.21 (#27612)
Nanguan Lin [Sat, 14 Oct 2023 11:51:58 +0000 (19:51 +0800)]
Backport manually for a tmpl issue in v1.21 (#27612)

backport #27514
close #27607

12 months agoFix build errors on BSD (in BSDMakefile) (#27594) (#27608)
Giteabot [Sat, 14 Oct 2023 07:29:55 +0000 (15:29 +0800)]
Fix build errors on BSD (in BSDMakefile) (#27594) (#27608)

Backport #27594 by @sryze

1. `make build` fails because `||` and `&&` have the same precedence in
sh/bash, so the `false` command always evaluated (leading to an error).

   ```
   + which gmake /usr/local/bin/gmake
   + false

   *** Failed target:  .BEGIN
*** Failed command: which "gmake" || printf "Error: GNU Make is
required!\n\n" 1>&2 && false
   *** Error code 1
   ```

2. When `GPREFIX` is set to an empty string with quotation marks,
`gmake` mistakenly thinks that it's a file name:

   ``` gmake: *** empty string invalid as file name.  Stop. ```

Co-authored-by: Sergey Zolotarev <sryze@protonmail.com>
12 months agoUpgrade go dependencies (#27599) (#27609)
Chongyi Zheng [Fri, 13 Oct 2023 17:23:17 +0000 (13:23 -0400)]
Upgrade go dependencies (#27599) (#27609)

Backport #27599

Upgrade all dependencies in `go.mod`

`golang.org/x/net` v0.17.0 also fixes
[CVE-2023-39325](https://github.com/advisories/GHSA-4374-p667-p6c8)

Co-authored-by: delvh <dev.lh@web.de>
12 months agoKeep filter when showing unfiltered results on explore page (#27192) (#27589)
Giteabot [Thu, 12 Oct 2023 00:56:21 +0000 (08:56 +0800)]
Keep filter when showing unfiltered results on explore page (#27192) (#27589)

Backport #27192 by @JakobDev

Fixes https://codeberg.org/Codeberg/Community/issues/1302

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoDon't show Link to TOTP if not set up (#27585) (#27588)
Giteabot [Wed, 11 Oct 2023 20:59:21 +0000 (04:59 +0800)]
Don't show Link to TOTP if not set up (#27585) (#27588)

Backport #27585 by @JakobDev

Fixes https://codeberg.org/forgejo/forgejo/issues/1592

When login in with WebAuth, the page has a link to use TOTP instead.
This link is always displayed, no matter if the User has set up TOTP or
not, which do of cause not work for those who have not.

Co-authored-by: JakobDev <jakobdev@gmx.de>
12 months agoFix data-race bug when accessing task.LastRun (#27584) (#27586)
Giteabot [Wed, 11 Oct 2023 15:27:38 +0000 (23:27 +0800)]
Fix data-race bug when accessing task.LastRun (#27584) (#27586)

Backport #27584 by @wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoReplace ajax with fetch, improve image diff (#27267) (#27583)
Giteabot [Wed, 11 Oct 2023 14:12:31 +0000 (22:12 +0800)]
Replace ajax with fetch, improve image diff (#27267) (#27583)

Backport #27267 by @silverwind

1. Dropzone attachment removal, pretty simple replacement
2. Image diff: The previous code fetched every image twice, once via
`img[src]` and once via `$.ajax`. Now it's only fetched once and a
second time only when necessary. The image diff code was partially
rewritten.

Co-authored-by: silverwind <me@silverwind.io>
12 months agofully replace drone with actions (#27556) (#27575)
Giteabot [Wed, 11 Oct 2023 12:03:06 +0000 (20:03 +0800)]
fully replace drone with actions (#27556) (#27575)

Backport #27556 by @techknowlogick

this builds binaries and docker images for tags

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
12 months agoshow manual cron run's last time (#27544) (#27577)
Giteabot [Wed, 11 Oct 2023 11:26:34 +0000 (19:26 +0800)]
show manual cron run's last time (#27544) (#27577)

Backport #27544 by @earl-warren

- Currently in the cron tasks, the 'Previous Time' only displays the
previous time of when the cron library executes the function, but not
any of the manual executions of the task.
- Store the last run's time in memory in the Task struct and use that,
when that time is later than time that the cron library has executed
this task.
- This ensures that if an instance admin manually starts a task, there's
feedback that this task is/has been run, because the task might be run
that quick, that the status icon already has been changed to an
checkmark,
- Tasks that are executed at startup now reflect this as well, as the
time of the execution of that task on startup is now being shown as
'Previous Time'.
- Added integration tests for the API part, which is easier to test
because querying the HTML table of cron tasks is non-trivial.
- Resolves https://codeberg.org/forgejo/forgejo/issues/949

(cherry picked from commit fd34fdac1408ece6b7d9fe6a76501ed9a45d06fa)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: silverwind <me@silverwind.io>
12 months agoRevert "Fix pr template (#27436)" (#27567)
Nanguan Lin [Wed, 11 Oct 2023 03:11:04 +0000 (11:11 +0800)]
Revert "Fix pr template (#27436)" (#27567)

Reverts backport go-gitea/gitea#27440
Fix #27564

12 months agoFix attachment download bug (#27486) (#27571)
Giteabot [Wed, 11 Oct 2023 02:39:12 +0000 (10:39 +0800)]
Fix attachment download bug (#27486) (#27571)

Backport #27486 by @lunny

Fix #27204

This PR allows `/<username>/<reponame>/attachments/<uuid>` access with
personal access token and also changed attachments API download url to
it so it can be download correctly.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoIncrease queue length (#27555) (#27562)
Giteabot [Tue, 10 Oct 2023 12:22:26 +0000 (20:22 +0800)]
Increase queue length (#27555) (#27562)

Backport #27555 by @wolfogre

It should be OK to increase the default queue length since the default
type is "level".

IMO, the old default length (100) is a little too small. See
https://github.com/go-gitea/gitea/issues/27540#issuecomment-1754269491

IIRC, a larger length could lead to more memory usage only when the type
is "channel," but it's an obscure case. Otherwise, it's just a limit
(for "level" or "redis").

Co-authored-by: Jason Song <i@wolfogre.com>
12 months agoRespect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551)
Giteabot [Tue, 10 Oct 2023 07:37:58 +0000 (15:37 +0800)]
Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551)

Backport #27536 by @picsel2

Fixes #27535

Co-authored-by: Sebastian Grabowski <sebastian@grabel.de>
12 months agoAvoid run change title process when the title is same (#27467) (#27558)
yp05327 [Tue, 10 Oct 2023 07:01:46 +0000 (16:01 +0900)]
Avoid run change title process when the title is same (#27467) (#27558)

Backport #27467 manually.

12 months agoRemove max-width and add hide text overflow (#27359) (#27550)
Giteabot [Tue, 10 Oct 2023 02:02:26 +0000 (10:02 +0800)]
Remove max-width and add hide text overflow (#27359) (#27550)

Backport #27359 by @kdumontnu

Closes https://github.com/go-gitea/gitea/issues/27358

Co-authored-by: Kyle D <kdumontnu@gmail.com>
12 months agouse hosted runners for nightly actions (#27485) (#27488)
Giteabot [Mon, 9 Oct 2023 18:10:42 +0000 (02:10 +0800)]
use hosted runners for nightly actions (#27485) (#27488)

Backport #27485 by @techknowlogick

I'm temporarily unable to properly evaluate actuated runners, and so I'm
switching back to hosted runners until I am able to focus on that again.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
12 months agoswitch to using official AWS step in release nightly (#27532) (#27547)
Giteabot [Mon, 9 Oct 2023 17:53:45 +0000 (01:53 +0800)]
switch to using official AWS step in release nightly (#27532) (#27547)

Backport #27532 by @techknowlogick

`jakejarvis/s3-sync-action@master` is out of date, and using official
actions is always recommended

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
12 months agoFix `environment-to-ini` inherited key bug (#27543) (#27546)
Giteabot [Mon, 9 Oct 2023 17:46:58 +0000 (01:46 +0800)]
Fix `environment-to-ini` inherited key bug (#27543) (#27546)

Backport #27543 by @wxiaoguang

Fix  #27541

The INI package has a quirk: by default, the keys are inherited.
When maintaining the keys, the newly added sub key should not be
affected by the parent key.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoapi: GetPullRequestCommits: return file list (#27483) (#27539)
Giteabot [Mon, 9 Oct 2023 12:21:35 +0000 (20:21 +0800)]
api: GetPullRequestCommits: return file list (#27483) (#27539)

Backport #27483 by @msantos

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

---
Patch tested:

```json
[
  {
    "url": "http://100.115.92.198:9292/api/v1/repos/msantos/test/git/commits/7664dcb44167e0f9efd994e4ca6a9164694adc27",
    "sha": "7664dcb44167e0f9efd994e4ca6a9164694adc27",
    "created": "2023-10-06T09:57:08-04:00",
    "html_url": "http://100.115.92.198:9292/msantos/test/commit/7664dcb44167e0f9efd994e4ca6a9164694adc27",
...
    "files": [
      {
        "filename": "README.md",
        "status": "modified"
      }
    ],
    "stats": {
      "total": 2,
      "additions": 2,
      "deletions": 0
    }
  }
]
```

Co-authored-by: Michael Santos <michael.santos@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoImprove dropdown's behavior when there is a search input in menu (#27526) (#27534)
Giteabot [Mon, 9 Oct 2023 07:15:18 +0000 (15:15 +0800)]
Improve dropdown's behavior when there is a search input in menu (#27526) (#27534)

Backport #27526 by @wxiaoguang

Follow #27225

The change in #27225 is not ideal, this should be the complete fix:
support the layout which Fomantic doesn't support.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoRestore warning commit status (#27504) (#27529)
Giteabot [Mon, 9 Oct 2023 03:56:02 +0000 (11:56 +0800)]
Restore warning commit status (#27504) (#27529)

Backport #27504 by @silverwind

Partial revert of https://github.com/go-gitea/gitea/pull/25839. This
commit status is used by a number of external integrations, so I think
we should not remove it (See
https://github.com/go-gitea/gitea/pull/25839#issuecomment-1729002077).
This is a rare case where an existing migration needed to be alterted to
avoid data loss.

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
12 months agoUpdate JS and PY dependencies (#27501) (#27518)
silverwind [Sun, 8 Oct 2023 17:31:33 +0000 (19:31 +0200)]
Update JS and PY dependencies (#27501) (#27518)

Backport https://github.com/go-gitea/gitea/pull/27501 to 1.21

- Update all JS and PY dependencies
- Enable eslint `prefer-object-has-own` and autofix issue
- Fix styling on citation buttons
- Tested citation, mermaid, monaco, swagger, katex

Citation button issue was that these buttons were not filled:

<img width="136" alt="Screenshot 2023-10-07 at 14 05 08"
src="https://github.com/go-gitea/gitea/assets/115237/435f0c91-28ac-46b3-bae4-dad768b29c05">

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoAdd hover background to wiki list page (#27507) (#27521)
Giteabot [Sun, 8 Oct 2023 13:48:51 +0000 (21:48 +0800)]
Add hover background to wiki list page (#27507) (#27521)

Backport #27507 by @BLumia

This patch adds a hover background for the wiki row in wiki list page,
which make its behavior more close to repo's file list page.

This patch also make the wiki-git-entry visible on the row is hovered
instead of the cel, so users won't be confused since the 'grid' is not
visible from the web page.

After the patch: (when the wiki named 'Home' is hovered)

![image](https://github.com/go-gitea/gitea/assets/10095765/f6c67c41-ad54-4ce4-a3b1-8c7551396ce0)

Co-authored-by: Gary Wang <git@blumia.net>
12 months agoFix mermaid flowchart margin issue (#27503) (#27516)
silverwind [Sun, 8 Oct 2023 13:31:47 +0000 (15:31 +0200)]
Fix mermaid flowchart margin issue (#27503) (#27516)

Backport https://github.com/go-gitea/gitea/pull/27503 to 1.21

Fixes: https://github.com/go-gitea/gitea/issues/27435
Related: https://github.com/mermaid-js/mermaid/issues/4907

<img width="924" alt="image"

src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">

12 months agobump go-deps (#27489) (#27493)
Giteabot [Sun, 8 Oct 2023 00:07:09 +0000 (08:07 +0800)]
bump go-deps (#27489) (#27493)

Backport #27489 by @techknowlogick

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
12 months agoEnable markdownlint `no-duplicate-header` (#27500) (#27506)
Giteabot [Sat, 7 Oct 2023 13:41:41 +0000 (21:41 +0800)]
Enable markdownlint `no-duplicate-header` (#27500) (#27506)

Backport #27500 by @silverwind

Duplicate headers in a single Markdown document are problemlematic
because the auto-generated links won't be stable. Enable this rule with
no exceptions which is also the default of `markdownlint`. For example:

```md
# A
## Example
# B
## Example
```
Docasaurus will generated `example` and `example-1` links for this. If
the first heading is altered, the link `example` will unexpectedly move
to the second example heading.

Ref: https://github.com/go-gitea/gitea/pull/27461#discussion_r1347987659

Co-authored-by: silverwind <me@silverwind.io>
12 months agoFix panic in storageHandler (#27446) (#27479) v1.21.0-rc1
Giteabot [Fri, 6 Oct 2023 14:51:26 +0000 (22:51 +0800)]
Fix panic in storageHandler (#27446) (#27479)

Backport #27446 by @sryze

storageHandler() is written as a middleware but is used as an endpoint
handler, and thus `next` is actually `nil`, which causes a null pointer
dereference when a request URL does not match the pattern (where it
calls `next.ServerHTTP()`).

Example CURL command to trigger the panic:

```
curl -I "http://yourhost/gitea//avatars/a"
```

Fixes #27409

---

Note: the diff looks big but it's actually a small change - all I did
was to remove the outer closure (and one level of indentation) ~and
removed the HTTP method and pattern checks as they seem redundant
because go-chi already does those checks~. You might want to check "Hide
whitespace" when reviewing it.

Alternative solution (a bit simpler): append `, misc.DummyOK` to the
route declarations that utilize `storageHandler()` - this makes it
return an empty response when the URL is invalid. I've tested this one
and it works too. Or maybe it would be better to return a 400 error in
that case (?)

Co-authored-by: Sergey Zolotarev <sryze@outlook.com>
12 months agoRevert #27426 (#27474)
delvh [Fri, 6 Oct 2023 12:47:45 +0000 (14:47 +0200)]
Revert #27426 (#27474)

Apparently, we didn't backport one of the refactoring PRs which caused
the fixup we backported to fail.

Fixes: https://github.com/go-gitea/gitea/issues/27473
12 months agoDon't let API add 2 exclusive labels from same scope (#27433) (#27460)
Giteabot [Thu, 5 Oct 2023 21:06:31 +0000 (05:06 +0800)]
Don't let API add 2 exclusive labels from same scope (#27433) (#27460)

Backport #27433 by @JakobDev

Fixes #27380

Co-authored-by: JakobDev <jakobdev@gmx.de>
12 months agoRefactor system setting (#27000) (#27452)
Giteabot [Thu, 5 Oct 2023 10:37:59 +0000 (18:37 +0800)]
Refactor system setting (#27000) (#27452)

Backport #27000 by @wxiaoguang

This PR reduces the complexity of the system setting system.

It only needs one line to introduce a new option, and the option can be
used anywhere out-of-box.

It is still high-performant (and more performant) because the config
values are cached in the config system.

![image](https://github.com/go-gitea/gitea/assets/2114189/f8cdd743-1145-41ab-9f8f-3996aa97d440)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoWhen comparing with an non-exist repository, return 404 but 500 (#27437) (#27442)
Giteabot [Wed, 4 Oct 2023 14:41:57 +0000 (22:41 +0800)]
When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442)

Backport #27437 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoFix pr template (#27436) (#27440)
Giteabot [Wed, 4 Oct 2023 12:56:02 +0000 (20:56 +0800)]
Fix pr template (#27436) (#27440)

Backport #27436 by @lunny

Fix #27431

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoFix missing `ctx` in new_form.tmpl (#27434) (#27438)
Giteabot [Wed, 4 Oct 2023 12:12:06 +0000 (20:12 +0800)]
Fix  missing `ctx`  in new_form.tmpl  (#27434) (#27438)

Backport #27434 by @CaiCandong

Fix  #27432
Regression of #27265

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
12 months agoFix yet another `ctx` template bug (#27417) (#27426)
Giteabot [Wed, 4 Oct 2023 07:52:57 +0000 (15:52 +0800)]
Fix yet another `ctx` template bug (#27417) (#27426)

Backport #27417 by @delvh

Fixes #27416

Co-authored-by: delvh <dev.lh@web.de>
12 months agoUse flex-container for repo and org settings (#27418) (#27430)
Giteabot [Wed, 4 Oct 2023 07:20:43 +0000 (15:20 +0800)]
Use flex-container for repo and org settings (#27418) (#27430)

Backport #27418 by @silverwind

Same as https://github.com/go-gitea/gitea/pull/26046 but for repo and
org settings pages, reducing the margins between the boxes:

<img width="1247" alt="Screenshot 2023-10-03 at 23 25 19"
src="https://github.com/go-gitea/gitea/assets/115237/4e68ad5e-5fdc-4466-aefb-ec71bf411d45">
<img width="1255" alt="Screenshot 2023-10-03 at 23 27 12"
src="https://github.com/go-gitea/gitea/assets/115237/9068369b-a75d-401e-8b8d-3bd4bbe097dc">

Co-authored-by: silverwind <me@silverwind.io>
12 months agoAdd Index to `action.user_id` (#27403) (#27425)
Giteabot [Wed, 4 Oct 2023 06:53:00 +0000 (14:53 +0800)]
Add Index to `action.user_id` (#27403) (#27425)

Backport #27403 by @JakobDev

Another Column that needs a Index. Found at
https://codeberg.org/forgejo/discussions/issues/61#issuecomment-1258744.

Co-authored-by: JakobDev <jakobdev@gmx.de>
12 months agoAdd 1.20.5 changelog (#27404) (#27412)
Lunny Xiao [Tue, 3 Oct 2023 14:21:19 +0000 (22:21 +0800)]
Add 1.20.5 changelog (#27404) (#27412)

frontend #27404

12 months agoDon't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408)
Giteabot [Tue, 3 Oct 2023 09:59:45 +0000 (17:59 +0800)]
Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408)

Backport #27332 by @JakobDev

Part of https://codeberg.org/forgejo/discussions/issues/61

This is workaround for a bug in MariaDB

Co-authored-by: JakobDev <jakobdev@gmx.de>
12 months agoAdd support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)
Giteabot [Tue, 3 Oct 2023 08:13:49 +0000 (16:13 +0800)]
Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)

Backport #27384 by @rbhz

Add support for HEAD in paths:
```
/src/branch/HEAD/README.md
/src/commit/HEAD/README.md
```

Closes #26920

Co-authored-by: Kirill Sorokin <48334247+rbhz@users.noreply.github.com>
12 months agoMake Actions tasks/jobs timeouts configurable by the user (#27400) (#27402)
Giteabot [Tue, 3 Oct 2023 02:26:35 +0000 (10:26 +0800)]
Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402)

Backport #27400 by @fantognazza

With this PR we added the possibility to configure the Actions timeouts
values for killing tasks/jobs.
Particularly this enhancement is closely related to the `act_runner`
configuration reported below:
```
# The timeout for a job to be finished.
# Please note that the Gitea instance also has a timeout (3h by default) for the job.
# So the job could be stopped by the Gitea instance if it's timeout is shorter than this.
timeout: 3h
```

---

Setting the corresponding key in the INI configuration file, it is
possible to let jobs run for more than 3 hours.

Signed-off-by: Francesco Antognazza <francesco.antognazza@gmail.com>
12 months agoFix git 2.11 error when checking IsEmpty (#27393) (#27397)
Giteabot [Mon, 2 Oct 2023 20:36:18 +0000 (04:36 +0800)]
Fix git 2.11 error when checking IsEmpty (#27393) (#27397)

Backport #27393 by @wxiaoguang

Fix #27389

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoHide archived labels when filtering by labels on the issue list (#27115) (#27381)
Giteabot [Mon, 2 Oct 2023 02:56:48 +0000 (10:56 +0800)]
Hide archived labels when filtering by labels on the issue list (#27115) (#27381)

Backport #27115 by @puni9869

Followup  https://github.com/go-gitea/gitea/pull/26820
## Archived labels UI for issue filter and issue filter actions for
issues/pull request pages.

Changed:
* Enhanced the Issue filter and Issue filter actions UI page to
seamlessly incorporate a list of archived labels.
* Pagination functionality is same as before. If archived label checkbox
is checked then we are adding a query string`archived=true` in the url
to save the state of page.
* Issue filter actions menu is separated into different template.
* Adding the archived flag in issue url labels.
* Pull Request page is also work the same.

Outsourced:
* Defer the implementation of specialized handling for archived labels
to upcoming pull requests. This step will be undertaken subsequent to
the successful merge of this pull request.

Screenshots
### Issue page
<img width="1360" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/d7efb2ef-5b2b-449d-83f0-d430a32ec432">

### Issue page with label filter on archived label checkbox when not
checked --> No archived label is there in list
<img width="1249" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/ceea68ef-91f2-4693-910f-2e25e236bfc9">

### Issue page with label filter on archived label checkbox when checked
--> Show archived label in the list.
<img width="710" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2414d26b-2079-4c3c-bd9e-f2f5411bcabf">

### Issue page with label filter on issue action menu on archived label
checkbox when checked --> Show archived label in the list.
<img width="409" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/259cac87-3e21-4778-99a2-a6a0b8c81178">

### Applied the archived=true in Issue labels when archived checkbox is
checked.
<img width="984" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/657ce3db-c0ae-402e-b12d-3b580d3c2ed0">

---

Part of https://github.com/go-gitea/gitea/issues/25237

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
Co-authored-by: delvh <dev.lh@web.de>
12 months agoAllow get release download files and lfs files with oauth2 token format (#26430)...
Giteabot [Sun, 1 Oct 2023 11:54:11 +0000 (19:54 +0800)]
Allow get release download files and lfs files with oauth2 token format (#26430) (#27379)

Backport #26430 by @lunny

Fix #26165
Fix #25257

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agohighlight user details link (#26998) (#27376)
Giteabot [Sun, 1 Oct 2023 10:23:42 +0000 (18:23 +0800)]
highlight user details link (#26998) (#27376)

Backport #26998 by @denyskon

This PR adds a separated column in the users table for operations. The
username link now redirects back to user page.

![grafik](https://github.com/go-gitea/gitea/assets/47871822/df8c8b30-3da6-443c-ae0f-6e3cac7dd9bb)

Resolves
https://github.com/go-gitea/gitea/pull/26713#pullrequestreview-1603001285

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: silverwind <me@silverwind.io>
12 months agoFix missing ctx for GetRepoLink in dashboard (#27372) (#27375)
Giteabot [Sun, 1 Oct 2023 09:54:58 +0000 (17:54 +0800)]
Fix missing ctx for GetRepoLink in dashboard (#27372) (#27375)

Backport #27372 by @CaiCandong

As title
Fix #27369
Regression of #27265

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
12 months agoIntroduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365)
Giteabot [Sat, 30 Sep 2023 15:58:35 +0000 (23:58 +0800)]
Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365)

Backport #26803 by @n0toose

This change introduces some fixes for my original PR
(https://github.com/go-gitea/gitea/pull/26214) and introduces some
additional tests so that such a regression does not happen again in the
future.

Co-authored-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
12 months agoAbsolute positioned checkboxes overlay floated elements (#26870) (#27366)
Giteabot [Sat, 30 Sep 2023 15:10:48 +0000 (23:10 +0800)]
Absolute positioned checkboxes  overlay floated elements (#26870) (#27366)

Backport #26870 by @rafh

Currently, checkboxes are positioned as absolute. This positioning
causes the input to overlay an element that has been floated within the
editor. Floated elements are useful if you want your text to wrap around
this element. This PR fixes the overlaying of checkboxes by removing the
absolute positioning, updating the `ul` padding, and
displaying`.task-list-item` `flex` to ensure inputs and the associated
label are on the same line.

Screenshots:

Before:
<img width="762" alt="Screenshot 2023-09-01 at 3 40 59 PM"
src="https://github.com/go-gitea/gitea/assets/6152817/570247c7-7f5c-4697-bfc9-ad4655e37991">

After:
<img width="762" alt="Screenshot 2023-09-01 at 3 42 20 PM"
src="https://github.com/go-gitea/gitea/assets/6152817/db53df45-1294-4eee-84c0-b21ac4fdf805">

Co-authored-by: Rafael Heard <rafael.heard@gmail.com>
Co-authored-by: rafh <rafaelheard@gmail.com>
12 months agoFix template bug (#27362) (#27364)
Giteabot [Sat, 30 Sep 2023 09:30:30 +0000 (17:30 +0800)]
Fix template bug (#27362) (#27364)

Backport #27362 by @lunny

Fix #27361

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoFix repo count in org action settings (#27245) (#27353)
Giteabot [Fri, 29 Sep 2023 18:00:24 +0000 (02:00 +0800)]
Fix repo count in org action settings (#27245) (#27353)

Backport #27245 by @yp05327

Only in org action settings, repo count is missing

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/4a74c090-c55f-4f06-810a-c390337efa9d)

![image](https://github.com/go-gitea/gitea/assets/18380374/e234f7e7-178c-4186-bbc0-0f291192b011)

![image](https://github.com/go-gitea/gitea/assets/18380374/c1db70cd-973b-40d5-ba17-1f354aed9149)
In other setting page:

![image](https://github.com/go-gitea/gitea/assets/18380374/43bfec6b-a1a4-48a9-8280-ab6f967b7ec4)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/9a697bd8-ce9f-40e2-8749-b46726d68d84)

![image](https://github.com/go-gitea/gitea/assets/18380374/3b6d1e59-64dd-4655-953b-064718e6aa7a)

![image](https://github.com/go-gitea/gitea/assets/18380374/5604c063-556c-4252-8778-4e5a5e23b7e1)

Co-authored-by: yp05327 <576951401@qq.com>
12 months agoAdd protected branch name description (#27257) (#27351)
Giteabot [Fri, 29 Sep 2023 14:38:11 +0000 (22:38 +0800)]
Add protected branch name description (#27257) (#27351)

Backport #27257 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
12 months agoMore `db.DefaultContext` refactor (#27265) (#27347)
Giteabot [Fri, 29 Sep 2023 13:35:01 +0000 (21:35 +0800)]
More `db.DefaultContext` refactor (#27265) (#27347)

Backport #27265 by @JakobDev

Part of #27065

This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.

Co-authored-by: JakobDev <jakobdev@gmx.de>
12 months agoImprove tree not found page (#26570) (#27346)
Giteabot [Fri, 29 Sep 2023 10:35:11 +0000 (18:35 +0800)]
Improve tree not found page (#26570) (#27346)

Backport #26570 by @yp05327

Before:

![before](https://github.com/go-gitea/gitea/assets/18380374/383822d5-7d77-4ec3-b49b-4ab1e8b167ce)

After:

![after](https://github.com/go-gitea/gitea/assets/18380374/32afa0a3-fa05-4087-b96e-7d067f0ed756)

In Github:
https://github.com/yp05327/test/blob/main/test.drawio

Updated:
UI changed

![image](https://github.com/go-gitea/gitea/assets/18380374/41ed07ff-b815-4b4e-9779-5ab36b5f3980)

![image](https://github.com/go-gitea/gitea/assets/18380374/5d7b28d6-a2fc-4d4c-8d6d-d93f9c9a270b)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoAdd logs for data broken of comment review (#27326) (#27345)
Giteabot [Fri, 29 Sep 2023 05:31:13 +0000 (13:31 +0800)]
Add logs for data broken of comment review (#27326) (#27345)

Backport #27326 by @lunny

Fix #27306

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoAdd Index to `comment.dependent_issue_id` (#27325) (#27340)
Giteabot [Fri, 29 Sep 2023 02:00:14 +0000 (10:00 +0800)]
Add Index to `comment.dependent_issue_id` (#27325) (#27340)

Backport #27325 by @JakobDev

This Column is missing index. It is used by
[issue_service.deleteIssue](https://github.com/go-gitea/gitea/blob/7ea2a910cebaf51cfd13c0941029c404e408ae54/services/issue/issue.go#L300).

Co-authored-by: JakobDev <jakobdev@gmx.de>
12 months agoFix the approval count of PR when there is no protection branch rule (#27272) (#27343)
Giteabot [Fri, 29 Sep 2023 01:31:35 +0000 (09:31 +0800)]
Fix the approval count of PR when there is no protection branch rule (#27272) (#27343)

Backport #27272 by @lng2020

As title

![ksnip_20230926-115158](https://github.com/go-gitea/gitea/assets/70063547/a60be44a-06ad-421e-ba27-e4e0adfa5db7)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
12 months agoFix review UI (#27322) (#27331)
Giteabot [Thu, 28 Sep 2023 13:27:13 +0000 (21:27 +0800)]
Fix review UI (#27322) (#27331)

Backport #27322 by @wxiaoguang

Close #26730

1. The `diff-detail-box` was abused, it shouldn't be used for
"DiffFileList/DiffFileTree".
2. Fix the sticky position for various screens.

![image](https://github.com/go-gitea/gitea/assets/2114189/558a5c06-c94c-4e5c-8395-d38473dd21c2)

![image](https://github.com/go-gitea/gitea/assets/2114189/3390fb0e-7dc7-457f-bd0c-398fdb6d24c0)

![image](https://github.com/go-gitea/gitea/assets/2114189/d19dd350-aecf-4909-8ef9-73b09d94560e)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoFix Bug in Issue Config when only contact links are set (#26521) (#27334)
Giteabot [Thu, 28 Sep 2023 12:55:45 +0000 (20:55 +0800)]
Fix Bug in Issue Config when only contact links are set (#26521) (#27334)

Backport #26521 by @JakobDev

Blank Issues should be enabled if they are not explicit disabled through
the `blank_issues_enabled` field of the Issue Config. The Implementation
has currently a Bug: If you create a Issue Config file with only
`contact_links` and without a `blank_issues_enabled` field,
`blank_issues_enabled` is set to false by default.

The fix is only one line, but I decided to also improve the tests to
make sure there are no other problems with the Implementation.

This is a bugfix, so it should be backported to 1.20.

Co-authored-by: JakobDev <jakobdev@gmx.de>
12 months agoFix divider in subscription page (#27298) (#27301)
Giteabot [Thu, 28 Sep 2023 10:37:33 +0000 (18:37 +0800)]
Fix divider in subscription page (#27298) (#27301)

Backport #27298 by @yp05327

divider should always display in subscription page.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/5a5c948c-8e45-4faa-827e-a05356f3a714)

![image](https://github.com/go-gitea/gitea/assets/18380374/8f6a6747-5414-45cc-8b4c-aa99ea869038)

After:
(no changes when there's no subscriptions)

![image](https://github.com/go-gitea/gitea/assets/18380374/261faf8d-97e2-4d79-a255-5077a42979d2)

![image](https://github.com/go-gitea/gitea/assets/18380374/fc73c837-2efb-40b2-a8f8-2b5c77c32f3b)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
12 months agoImprove issue history dialog and make poster can delete their own history (#27323...
Giteabot [Thu, 28 Sep 2023 09:46:46 +0000 (17:46 +0800)]
Improve issue history dialog and make poster can delete their own history (#27323) (#27327)

Backport #27323 by @wxiaoguang

Fix #27313 (see the comment)

And some UI improvements:

### Before

![image](https://github.com/go-gitea/gitea/assets/2114189/420a314d-8f34-4e30-a557-f41cf4f0d2f2)

![image](https://github.com/go-gitea/gitea/assets/2114189/60ca0be4-b55e-4e65-be73-fd53e0d4fc36)

### After

![image](https://github.com/go-gitea/gitea/assets/2114189/d354f815-5a0c-4e63-8d59-d03ed344dbea)

![image](https://github.com/go-gitea/gitea/assets/2114189/6ef437a4-aa6f-4917-a260-00625ee71e79)

![image](https://github.com/go-gitea/gitea/assets/2114189/9d88a36c-616b-4dc9-8c6b-76adaad8acf6)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoImprove branch list UI (#27319) (#27324)
Giteabot [Thu, 28 Sep 2023 06:14:34 +0000 (14:14 +0800)]
Improve branch list UI (#27319) (#27324)

Backport #27319 by @wxiaoguang

1. Put the `"octicon-shield-lock"` into the flex container, then it
doesn't need a separate flex box
2. Remove some unnecessary `gt-df` helpers
3. Make `btn` button has the same flex behavior as `ui button`

![image](https://github.com/go-gitea/gitea/assets/2114189/60ce75f7-7fac-4157-9c42-91c7dee9300e)

![image](https://github.com/go-gitea/gitea/assets/2114189/ea606baf-6f52-41e1-b964-c4840d3b1529)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoRedefine the meaning of column is_active to make Actions Registration Token generatio...
Giteabot [Thu, 28 Sep 2023 04:15:53 +0000 (12:15 +0800)]
Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143) (#27304)

Backport #27143 by @lunny

Partially Fix #25041

This PR redefined the meaning of column `is_active` in table
`action_runner_token`.
Before this PR, `is_active` means whether it has been used by any
runner. If it's true, other runner cannot use it to register again.

In this PR, `is_active` means whether it's validated to be used to
register runner. And if it's true, then it can be used to register
runners until it become false. When creating a new `is_active` register
token, any previous tokens will be set `is_active` to false.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agofix orphan check for deleted branch (#27310) (#27321)
Giteabot [Thu, 28 Sep 2023 02:52:53 +0000 (10:52 +0800)]
fix orphan check for deleted branch (#27310) (#27321)

Backport #27310 by @earl-warren

- Modify the deleted branch orphan check to check for the new table
instead.
- Regression from 6e19484f4d3bf372212f2da462110a1a8c10cbf2
- Resolves https://codeberg.org/forgejo/forgejo/issues/1522

(cherry picked from commit c1d888686fe445e4edecb9d835c5b3893b574b75)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
12 months agoFix protected branch icon location (#26576) (#27317)
Giteabot [Wed, 27 Sep 2023 22:51:01 +0000 (06:51 +0800)]
Fix protected branch icon location (#26576) (#27317)

Backport #26576 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/717c726d-d3ae-4ea3-86bf-36fd8430f1ba)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/f4508428-380a-4b44-9cc2-fa9483971808)

Co-authored-by: yp05327 <576951401@qq.com>
12 months agoUse vitest globals (#27102) (#27311)
Giteabot [Wed, 27 Sep 2023 14:10:08 +0000 (22:10 +0800)]
Use vitest globals (#27102) (#27311)

Backport #27102 by @silverwind

Enable [globals](https://vitest.dev/config/#globals) in vitest, reducing
the noise in test files.

Co-authored-by: silverwind <me@silverwind.io>
12 months agobump bleve (#27300) (#27305)
Giteabot [Wed, 27 Sep 2023 07:47:30 +0000 (15:47 +0800)]
bump bleve (#27300) (#27305)

Backport #27300 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoFix yaml test (#27297) (#27303)
Giteabot [Wed, 27 Sep 2023 07:05:35 +0000 (15:05 +0800)]
Fix yaml test (#27297) (#27303)

Backport #27297 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoEnable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295)
Giteabot [Wed, 27 Sep 2023 02:26:28 +0000 (10:26 +0800)]
Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295)

Backport #27291 by @silverwind

Previously, the production build never output sourcemaps. Now we emit
one file for `index.js` because it is the most likely one where we need
to be able to better debug reported issues like
https://github.com/go-gitea/gitea/issues/27213. This will currently
increase the binary size of gitea by around 700kB which is what the
gzipped source map file has.

Also, I fixed the CSS sourcemap generation which was broken since the
introduction of lightningcss.

The chinese docs are machine-translated, please correct accordingly.

Co-authored-by: silverwind <me@silverwind.io>
12 months agoFix some animation bugs (#27287) (#27294)
Giteabot [Wed, 27 Sep 2023 01:24:25 +0000 (09:24 +0800)]
Fix some animation bugs (#27287) (#27294)

Backport #27287

Fix #27286
Replace #27279

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoAdd missed return to actions view fetch (#27289) (#27293)
Giteabot [Wed, 27 Sep 2023 01:10:21 +0000 (09:10 +0800)]
Add missed return to actions view fetch (#27289) (#27293)

Backport #27289 by @silverwind

Should fix: https://github.com/go-gitea/gitea/issues/27213

@denyskon can you test this? I can not reproduce this error locally.

Co-authored-by: silverwind <me@silverwind.io>
12 months agoFix more yaml lint errors (#27284) (#27288)
Giteabot [Tue, 26 Sep 2023 17:00:12 +0000 (01:00 +0800)]
Fix more yaml lint errors (#27284) (#27288)

Backport #27284 by @lunny

Fix #27268

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoAdd missing IconHTML size (#27269) (#27283)
Giteabot [Tue, 26 Sep 2023 15:10:41 +0000 (23:10 +0800)]
Add missing IconHTML size (#27269) (#27283)

Backport #27269 by @wxiaoguang

Fix #27223

Regression of #27122

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoFix incorrect change from #27231 (#27275) (#27282)
Giteabot [Tue, 26 Sep 2023 13:39:39 +0000 (21:39 +0800)]
Fix incorrect change from #27231 (#27275) (#27282)

Backport #27275 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
12 months agoAnother round of `db.DefaultContext` refactor (#27103) (#27262)
Giteabot [Mon, 25 Sep 2023 17:24:35 +0000 (01:24 +0800)]
Another round of `db.DefaultContext` refactor (#27103) (#27262)

Backport #27103 by @JakobDev

Part of #27065

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
12 months agoBackport ctx locale refactoring manually (#27231) (#27259) (#27260)
wxiaoguang [Mon, 25 Sep 2023 13:15:51 +0000 (21:15 +0800)]
Backport ctx locale refactoring manually (#27231) (#27259) (#27260)

Backport #27231 #27259 manually

---------

Co-authored-by: delvh <dev.lh@web.de>
12 months agoDisable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211...
Giteabot [Mon, 25 Sep 2023 10:21:06 +0000 (18:21 +0800)]
Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211) (#27253)

Backport #27211 by @yardenshoham

These buttons are now disabled when the webhook is not active.

The buttons were always enabled before this change.

- Fixes #26824
- Replaces #26814

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/e783d0d8-b433-440e-b95f-50d7c42613d3)

![image](https://github.com/go-gitea/gitea/assets/20454870/b4886151-9f32-4e83-8001-dd3f20c23d70)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/74b76a72-0818-4143-8548-5d42c4119a05)

![image](https://github.com/go-gitea/gitea/assets/20454870/d5ae4e5c-c1ac-4751-a072-e6f7511b1e07)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
12 months agoFix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251)
Giteabot [Mon, 25 Sep 2023 08:24:50 +0000 (16:24 +0800)]
Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251)

Backport #27203 by @Nabapadma-sarker

Fixes #27202

Co-authored-by: Nabapadma-sarker <nabapadmacse1991@gmail.com>
12 months agoUse mask-based fade-out effect for `.new-menu` (#27181) (#27243)
Giteabot [Mon, 25 Sep 2023 07:52:41 +0000 (15:52 +0800)]
Use mask-based fade-out effect for `.new-menu` (#27181) (#27243)

Backport #27181 by @silverwind

The `.new-menu` was using a pseudo-element based fade-out effect.
Replace this with a more modern mask-based effect which in this case
required a child element to avoid fading out the background as well, so
I applied it to child `new-menu-inner` which was present on all these
menus except explore where I added it.

There is no visual difference except that the items on the explore page
have no `gap` between them any longer, making it consistent with other
menus. Before and after:

<img width="221" alt="Screenshot 2023-09-21 at 21 13 19"
src="https://github.com/go-gitea/gitea/assets/115237/b4a38ce2-cee1-4c54-84a5-e1d0bfd79e29">
<img width="222" alt="Screenshot 2023-09-21 at 21 32 36"
src="https://github.com/go-gitea/gitea/assets/115237/bb6b1335-d935-4ad4-bb85-3b0fc3027c2b">

Also, this cleans up the related CSS vars:

- `--color-header-wrapper-transparent` is removed, no longer needed
- `--color-header-wrapper` is defined in base theme as well, was
previously unset and therefor transparent.

[no whitespace
diff](https://github.com/go-gitea/gitea/pull/27181/files?diff=unified&w=1)
[demo of mask fade](https://jsfiddle.net/silverwind/tsfadb3u/)

Co-authored-by: silverwind <me@silverwind.io>
12 months agoAdd missing public user visibility in user details page (#27246) (#27250)
Giteabot [Mon, 25 Sep 2023 07:03:22 +0000 (15:03 +0800)]
Add missing public user visibility in user details page (#27246) (#27250)

Backport #27246 by @yp05327

It seems that `Public` user visibility is missing in the template.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/a8e7f3e0-1b77-41a0-921a-10adba90211e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/b0bffe13-0ca6-453e-95d7-0794528d5733)

Co-authored-by: yp05327 <576951401@qq.com>