]> source.dussan.org Git - gitea.git/log
gitea.git
12 months agoDocument the line-number counting behavior (#27386)
wxiaoguang [Mon, 2 Oct 2023 07:23:18 +0000 (15:23 +0800)]
Document the line-number counting behavior (#27386)

Ref #27377

12 months agoRemove upgrade from Gogs doc because the diverse has been 7 years and the code base...
Lunny Xiao [Mon, 2 Oct 2023 06:53:55 +0000 (14:53 +0800)]
Remove upgrade from Gogs doc because the diverse has been 7 years and the code base changed totally (#27387)

The documentation becomes no help since that but make people confusing.

12 months agoFix incorrect Chinese translation of linked-references.zh-cn.md (#27382)
Ayaka [Mon, 2 Oct 2023 06:13:08 +0000 (14:13 +0800)]
Fix incorrect Chinese translation of linked-references.zh-cn.md (#27382)

---

The original text "To address this" should be translated to "为了解决这个问题".
"工单" looks like corresponds to "issue".

12 months agolink to file from its history (#27354)
Denys Konovalov [Mon, 2 Oct 2023 04:04:32 +0000 (06:04 +0200)]
link to file from its history (#27354)

Fixes #3852
Fixes https://github.com/go-gitea/gitea/issues/26707

Add a button on file history which directs you to the file at the
selected commit.

Co-authored-by: silverwind <me@silverwind.io>
12 months agosimplify issue deletion query (#27312)
Earl Warren [Mon, 2 Oct 2023 02:30:10 +0000 (04:30 +0200)]
simplify issue deletion query (#27312)

- There's no need for `In` to be used, as it's a single parameter that's
being passed.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1521

(cherry picked from commit 4a4955f43ae7fc50cfe3b48409a0a10c82625a19)

Co-authored-by: Gusted <postmaster@gusted.xyz>
12 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 2 Oct 2023 00:23:46 +0000 (00:23 +0000)]
[skip ci] Updated licenses and gitignores

12 months agoCargo package - Fix missing domain in cargo sparse url (#27370)
merlleu [Sun, 1 Oct 2023 13:43:15 +0000 (15:43 +0200)]
Cargo package - Fix missing domain in cargo sparse url (#27370)

Hello, it seems that one my previous PR (adding the sparse index to the
cargo package content page), did not worked as expected: the
gitea-origin-url does not add the AppURL because of the `sparse+` prefix
in the url.
Currently the rendered page gives the following:
```toml
[registry]
default = "gitea"

[registries.gitea]
index = "sparse+/api/packages/ownername/cargo/" # Sparse index
# index = "https://git.example.com/ownername/_cargo-index.git" # Git

[net]
git-fetch-with-cli = true
```

12 months agoHide archived labels when filtering by labels on the issue list (#27115)
puni9869 [Sun, 1 Oct 2023 13:04:39 +0000 (18:34 +0530)]
Hide archived labels when filtering by labels on the issue list (#27115)

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: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoFix unexpected context canceled when migrating repository (#27368)
CaiCandong [Sun, 1 Oct 2023 12:04:35 +0000 (20:04 +0800)]
Fix unexpected context canceled when migrating repository (#27368)

Fix #27363

Regression of #27089

12 months agoFix ldap admin privileges update bug (#27051)
CaiCandong [Sun, 1 Oct 2023 11:32:12 +0000 (19:32 +0800)]
Fix ldap admin privileges update bug (#27051)

When the user does not set a username lookup condition, LDAP will get an
empty string `""` for the user, hence the following code
```
if isExist, err := user_model.IsUserExist(db.DefaultContext, 0, sr.Username)
```
The user presence determination will always be nonexistent, so updates
to user information will never be performed.

Fix #27049

12 months agoAllow get release download files and lfs files with oauth2 token format (#26430)
Lunny Xiao [Sun, 1 Oct 2023 10:41:52 +0000 (18:41 +0800)]
Allow get release download files and lfs files with oauth2 token format (#26430)

Fix #26165
Fix #25257

12 months agoFix missing ctx for GetRepoLink in dashboard (#27372)
CaiCandong [Sun, 1 Oct 2023 09:26:28 +0000 (17:26 +0800)]
Fix missing ctx for GetRepoLink in dashboard (#27372)

As title
Fix #27369
Regression of #27265

12 months agohighlight user details link (#26998)
Denys Konovalov [Sun, 1 Oct 2023 03:58:24 +0000 (05:58 +0200)]
highlight user details link (#26998)

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>
12 months agoFeed UI Improvements (#27356)
silverwind [Sat, 30 Sep 2023 15:48:34 +0000 (17:48 +0200)]
Feed UI Improvements (#27356)

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

12 months agoAbsolute positioned checkboxes overlay floated elements (#26870)
Rafael Heard [Sat, 30 Sep 2023 09:30:44 +0000 (05:30 -0400)]
Absolute positioned checkboxes  overlay floated elements (#26870)

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: rafh <rafaelheard@gmail.com>
12 months agoFix template bug (#27362)
Lunny Xiao [Sat, 30 Sep 2023 09:03:04 +0000 (17:03 +0800)]
Fix template bug (#27362)

Fix #27361

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 30 Sep 2023 00:22:01 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoFix repo count in org action settings (#27245)
yp05327 [Fri, 29 Sep 2023 15:46:07 +0000 (00:46 +0900)]
Fix repo count in org action settings (#27245)

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)

12 months agoIntroduce fixes and more rigorous tests for 'Show on a map' feature (#26803)
Panagiotis "Ivory" Vasilopoulos [Fri, 29 Sep 2023 14:57:06 +0000 (14:57 +0000)]
Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803)

This change introduces a fix for the PR #26214 to set the UserLocationMapURL correctly.

12 months agoAdd protected branch name description (#27257)
Lunny Xiao [Fri, 29 Sep 2023 14:02:35 +0000 (22:02 +0800)]
Add protected branch name description (#27257)

Co-authored-by: delvh <dev.lh@web.de>
12 months agorename TotalTimes() to TotalTimesForEachUser() (#27261)
6543 [Fri, 29 Sep 2023 13:04:14 +0000 (14:04 +0100)]
rename TotalTimes() to TotalTimesForEachUser() (#27261)

make function name more descriptive as it would otherwise imply it could
be used for e.g. #26672 too ...

---
*Sponsored by Kithara Software GmbH*

12 months agoMore `db.DefaultContext` refactor (#27265)
JakobDev [Fri, 29 Sep 2023 12:12:54 +0000 (14:12 +0200)]
More `db.DefaultContext` refactor (#27265)

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.

12 months agoImprove tree not found page (#26570)
yp05327 [Fri, 29 Sep 2023 07:42:39 +0000 (16:42 +0900)]
Improve tree not found page (#26570)

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: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoUpdate comparison page with RhodeCode CE & EE (#27329)
Marcin Kuźmiński [Fri, 29 Sep 2023 05:31:54 +0000 (07:31 +0200)]
Update comparison page with RhodeCode CE & EE (#27329)

Update RhodeCode features and add EE version

12 months agoAdd logs for data broken of comment review (#27326)
Lunny Xiao [Fri, 29 Sep 2023 02:31:36 +0000 (10:31 +0800)]
Add logs for data broken of comment review (#27326)

Fix #27306

12 months agoAdd support for forking single branch (#25821)
Dmitry Sharshakov [Fri, 29 Sep 2023 01:48:39 +0000 (04:48 +0300)]
Add support for forking single branch (#25821)

Fixes #25117

Add UI for choosing branch to fork

Change default branch on single-branch forks

![image](https://github.com/go-gitea/gitea/assets/19504461/28505f69-a9a2-43a8-8b19-a0cdac3ddc5a)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 29 Sep 2023 00:23:01 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoFix the approval count of PR when there is no protection branch rule (#27272)
Nanguan Lin [Thu, 28 Sep 2023 23:24:36 +0000 (07:24 +0800)]
Fix the approval count of PR when there is no protection branch rule (#27272)

As title

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

12 months agoAdd Index to `comment.dependent_issue_id` (#27325)
JakobDev [Thu, 28 Sep 2023 20:58:35 +0000 (22:58 +0200)]
Add Index to `comment.dependent_issue_id` (#27325)

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: Giteabot <teabot@gitea.io>
12 months agoImprovements of releases list and tags list (#25859)
Zettat123 [Thu, 28 Sep 2023 13:21:47 +0000 (21:21 +0800)]
Improvements of releases list and tags list (#25859)

Follow #23465 and #25624

This PR introduces the following improvements:
- We do not need to call `GetTags` to get tags because tags have been
loaded by `RepoAssignment`

https://github.com/go-gitea/gitea/blob/ef90fdbd1d7e1f62ed5bf18757e00e97817eb602/modules/context/repo.go#L663-L668
- Similarly, the number of tags and releases also have been loaded by
`RepoAssignment`, so the related code has been removed from the
handlers. The query condition of `GetReleaseCountByRepoID` in
`RepoAssignment` has been changed to include draft releases.

https://github.com/go-gitea/gitea/blob/ef90fdbd1d7e1f62ed5bf18757e00e97817eb602/modules/context/repo.go#L538-L551
- `releasesOrTags` function has been removed. The code for rendering
releases list and tags list moved to `Releases` and `TagList`
respectively.

12 months agoFix Bug in Issue Config when only contact links are set (#26521)
JakobDev [Thu, 28 Sep 2023 12:16:40 +0000 (14:16 +0200)]
Fix Bug in Issue Config when only contact links are set (#26521)

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.

12 months agoFix review UI (#27322)
wxiaoguang [Thu, 28 Sep 2023 10:00:26 +0000 (18:00 +0800)]
Fix review UI (#27322)

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)

12 months agoImprove issue history dialog and make poster can delete their own history (#27323)
wxiaoguang [Thu, 28 Sep 2023 08:43:20 +0000 (16:43 +0800)]
Improve issue history dialog and make poster can delete their own history (#27323)

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)

12 months agoImprove branch list UI (#27319)
wxiaoguang [Thu, 28 Sep 2023 04:04:32 +0000 (12:04 +0800)]
Improve branch list UI (#27319)

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)

12 months agodoctor: delete action entries without existing user (#27292)
6543 [Thu, 28 Sep 2023 03:03:08 +0000 (04:03 +0100)]
doctor: delete action entries without existing user (#27292)

just extend doctor with a usefully check :)

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
12 months agofix orphan check for deleted branch (#27310)
Earl Warren [Thu, 28 Sep 2023 02:07:33 +0000 (04:07 +0200)]
fix orphan check for deleted branch (#27310)

- 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: Gusted <postmaster@gusted.xyz>
12 months agomake writing main test easier (#27270)
Lunny Xiao [Thu, 28 Sep 2023 01:38:53 +0000 (09:38 +0800)]
make writing main test easier (#27270)

This PR removed `unittest.MainTest` the second parameter
`TestOptions.GiteaRoot`. Now it detects the root directory by current
working directory.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 28 Sep 2023 00:22:57 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoFix protected branch icon location (#26576)
yp05327 [Wed, 27 Sep 2023 22:21:31 +0000 (07:21 +0900)]
Fix protected branch icon location (#26576)

12 months agomove the `gitea admin` subcommands into separate files (#27307)
Nanguan Lin [Wed, 27 Sep 2023 12:25:38 +0000 (20:25 +0800)]
move the `gitea admin` subcommands into separate files (#27307)

As title.
Probably it's better to put those sub cmd to different dirs. Will do
that in the future.

12 months agoFix chinese translation (#27296)
Lunny Xiao [Wed, 27 Sep 2023 08:15:12 +0000 (16:15 +0800)]
Fix chinese translation (#27296)

Fix translation from #27291
Source Map will be kept as English in Chinese usage habit.

12 months agobump bleve (#27300)
techknowlogick [Wed, 27 Sep 2023 07:10:58 +0000 (03:10 -0400)]
bump bleve (#27300)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoRedefine the meaning of column is_active to make Actions Registration Token generatio...
Lunny Xiao [Wed, 27 Sep 2023 05:37:48 +0000 (13:37 +0800)]
Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143)

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.

12 months agoUse vitest globals (#27102)
silverwind [Wed, 27 Sep 2023 04:37:13 +0000 (06:37 +0200)]
Use vitest globals (#27102)

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

12 months agoFix divider in subscription page (#27298)
yp05327 [Wed, 27 Sep 2023 04:00:57 +0000 (13:00 +0900)]
Fix divider in subscription page (#27298)

the divider should always display in the subscription page.

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
12 months agoFix yaml test (#27297)
Lunny Xiao [Wed, 27 Sep 2023 03:30:03 +0000 (11:30 +0800)]
Fix yaml test (#27297)

12 months agoEnable production source maps for index.js, fix CSS sourcemaps (#27291)
silverwind [Wed, 27 Sep 2023 02:05:49 +0000 (04:05 +0200)]
Enable production source maps for index.js, fix CSS sourcemaps (#27291)

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.

12 months agoFix some animation bugs (#27287)
wxiaoguang [Wed, 27 Sep 2023 01:15:58 +0000 (09:15 +0800)]
Fix some animation bugs (#27287)

Fix #27286
Replace #27279

12 months agoAdd missed return to actions view fetch (#27289)
silverwind [Wed, 27 Sep 2023 00:34:52 +0000 (02:34 +0200)]
Add missed return to actions view fetch (#27289)

Should fix: #27213

12 months agoFix more yaml lint errors (#27284)
Lunny Xiao [Tue, 26 Sep 2023 16:56:42 +0000 (00:56 +0800)]
Fix more yaml lint errors (#27284)

Fix #27268

12 months agoFix incorrect change from #27231 (#27275)
delvh [Tue, 26 Sep 2023 13:10:29 +0000 (15:10 +0200)]
Fix incorrect change from #27231 (#27275)

12 months agoAdd missing IconHTML size (#27269)
wxiaoguang [Tue, 26 Sep 2023 11:59:04 +0000 (19:59 +0800)]
Add missing IconHTML size (#27269)

Fix #27223

Regression of #27122

12 months agoDocument the queue item's marshaling behavior (#27271)
wxiaoguang [Tue, 26 Sep 2023 05:58:57 +0000 (13:58 +0800)]
Document the queue item's marshaling behavior (#27271)

Close #26843

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 26 Sep 2023 00:23:08 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoAnother round of `db.DefaultContext` refactor (#27103)
JakobDev [Mon, 25 Sep 2023 13:17:37 +0000 (15:17 +0200)]
Another round of `db.DefaultContext` refactor (#27103)

Part of #27065

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
12 months agoFix more "locale" usages (#27259)
wxiaoguang [Mon, 25 Sep 2023 12:42:40 +0000 (20:42 +0800)]
Fix more "locale" usages (#27259)

12 months agoAlways use `ctx.Locale.Tr` inside templates (#27231)
delvh [Mon, 25 Sep 2023 08:56:50 +0000 (10:56 +0200)]
Always use `ctx.Locale.Tr` inside templates (#27231)

12 months agoDisable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211)
Yarden Shoham [Mon, 25 Sep 2023 07:33:00 +0000 (10:33 +0300)]
Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211)

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>
12 months agoAdd missing public user visibility in user details page (#27246)
yp05327 [Mon, 25 Sep 2023 06:27:03 +0000 (15:27 +0900)]
Add missing public user visibility in user details page (#27246)

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)

12 months agoUse mask-based fade-out effect for `.new-menu` (#27181)
silverwind [Mon, 25 Sep 2023 01:03:00 +0000 (03:03 +0200)]
Use mask-based fade-out effect for `.new-menu` (#27181)

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/)

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 25 Sep 2023 00:24:48 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoFix z-index on markdown completion (#27237)
silverwind [Sun, 24 Sep 2023 23:29:36 +0000 (01:29 +0200)]
Fix z-index on markdown completion (#27237)

Fixes: https://github.com/go-gitea/gitea/issues/27230
12 months agoUpdate database-preparation and add note re: MariaDB (#27232)
techknowlogick [Sun, 24 Sep 2023 21:24:17 +0000 (17:24 -0400)]
Update database-preparation and add note re: MariaDB (#27232)

update DB docs per feedback.
https://gitea.com/gitea/gitea-docusaurus/issues/69

12 months agocleanup locale function usage (#27227)
Denys Konovalov [Sun, 24 Sep 2023 20:31:58 +0000 (22:31 +0200)]
cleanup locale function usage (#27227)

12 months agoFix EOL handling in web editor (#27141)
silverwind [Sun, 24 Sep 2023 19:51:02 +0000 (21:51 +0200)]
Fix EOL handling in web editor (#27141)

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

This does the following for Monaco's EOL setting:

1. Use editorconfig setting if present
2. Use the file's dominant line ending as detected by monaco, which uses
LF for empty file

12 months agoFix PushEvent NullPointerException jenkinsci/github-plugin (#27203)
Nabapadma-sarker [Sun, 24 Sep 2023 19:02:47 +0000 (04:02 +0900)]
Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203)

Fixes #27202

12 months agofix issues on action runners page (#27226)
Denys Konovalov [Sun, 24 Sep 2023 18:12:21 +0000 (20:12 +0200)]
fix issues on action runners page (#27226)

- switch from some weird status badge to label
- translate untranslated `Reset registration token` string
- change documentation link from act_runner README to Gitea Docs site
- fix "No runners available" message width
- use `ctx.Locale.Tr` where possible

![grafik](https://github.com/go-gitea/gitea/assets/47871822/65547228-f9ed-4f80-9cfd-df5e55513a44)

12 months agoFix Fomantic UI dropdown icon bug when there is a search input in menu (#27225)
wxiaoguang [Sun, 24 Sep 2023 13:07:57 +0000 (21:07 +0800)]
Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225)

Fix #27224

And add the case to the devtest page.

12 months agoUpdate go-enry to 2.8.5 (#27215)
delvh [Sat, 23 Sep 2023 17:09:01 +0000 (19:09 +0200)]
Update go-enry to 2.8.5 (#27215)

Fixes #27214

12 months agoUpdate nodejs installation method in release container (#27207)
silverwind [Sat, 23 Sep 2023 13:18:47 +0000 (15:18 +0200)]
Update nodejs installation method in release container (#27207)

12 months agoQuote table `release` in sql queries (#27205)
KN4CK3R [Sat, 23 Sep 2023 12:57:39 +0000 (14:57 +0200)]
Quote table `release` in sql queries (#27205)

Fixes #27174

`release` is a reserved keyword in MySql. I can't reproduce the issue on
my setup and we have a test for that code but it seems there can be
setups where it fails.

https://github.com/go-gitea/gitea/blob/a101dbaa7952e359843c6d8303ca24a0e63c865c/tests/integration/repo_activity_test.go#L45-L46

12 months agoFix push mirror, wrong timestamp format (#27153)
Daniel Kilimnik [Sat, 23 Sep 2023 12:15:05 +0000 (14:15 +0200)]
Fix push mirror, wrong timestamp format (#27153)

I noticed, that the push mirrors endpoint, is the only endpoint which
returns the times in long format rather than as time.Time().

I think the behavior should be consistent across the project.

----

## ⚠️ BREAKING ⚠️

This PR changes the time format used in API responses for all
push_mirror endpoints which return a push mirror.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoAllow copying issue comment link on archived repos and when not logged in (#27193)
JakobDev [Sat, 23 Sep 2023 11:31:54 +0000 (13:31 +0200)]
Allow copying issue comment link on archived repos and when not logged in (#27193)

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

12 months agofix: text decorator on issue sidebar menu label (#27206)
metiftikci [Sat, 23 Sep 2023 10:51:23 +0000 (13:51 +0300)]
fix: text decorator on issue sidebar menu label (#27206)

fix underline for label on issue sidebar

12 months agoUpdate JS and Poetry dependencies and eslint (#27200)
silverwind [Fri, 22 Sep 2023 20:51:48 +0000 (22:51 +0200)]
Update JS and Poetry dependencies and eslint (#27200)

- Update all JS and Poetry dependencies
- Remove deprecated `eslint-plugin-custom-elements` and replace it with
rules from `eslint-plugin-wc`
- Add a convenience `make update` to update both js and py dependencies
- Tested markdown toolbar, swagger and citation

12 months agoRemove some dead code (#27196)
wxiaoguang [Fri, 22 Sep 2023 15:30:31 +0000 (23:30 +0800)]
Remove some dead code (#27196)

Some code is not in use any more, remove them.

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 22 Sep 2023 00:22:57 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoUpdates to the API for archived repos (#27149)
JakobDev [Thu, 21 Sep 2023 23:43:29 +0000 (01:43 +0200)]
Updates to the API for archived repos (#27149)

12 months agoFix release URL in webhooks (#27182)
John Olheiser [Thu, 21 Sep 2023 22:55:09 +0000 (17:55 -0500)]
Fix release URL in webhooks (#27182)

12 months agoFix dropdown icon position (#27175)
wxiaoguang [Thu, 21 Sep 2023 15:54:26 +0000 (23:54 +0800)]
Fix dropdown icon position (#27175)

According to https://fomantic-ui.com/modules/dropdown.html and our
"devtest" page, many dropdown elements has incorrect "icon" position.

This PR fixes all of them. Fix #27173

12 months agoFix repo sub menu (#27169)
wxiaoguang [Thu, 21 Sep 2023 13:16:14 +0000 (21:16 +0800)]
Fix repo sub menu (#27169)

Fix #27166

12 months agoFix review request number and add more tests (#27104)
Nanguan Lin [Thu, 21 Sep 2023 11:59:50 +0000 (19:59 +0800)]
Fix review request number and add more tests (#27104)

fix #27019
## testfixture yml
1. add issue20(a pr issue) in repo 23, org 17
2. add user15 to team 9
3. add four reviews about issue20
## test case
add two tests that are described with code comments
the code before pr #26784 failed the first test
<img width="479" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/1d9b5787-11b4-4c4d-931f-6a9869547f35">
current code failed the second test(as mentioned in #27019)
<img width="484" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/05608055-7587-43d1-bae1-92c688270819">
Any advice is appreciated.

---------

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoFix the variable regexp pattern on web page (#27161)
Nanguan Lin [Thu, 21 Sep 2023 09:03:13 +0000 (17:03 +0800)]
Fix the variable regexp pattern on web page (#27161)

same as (https://github.com/go-gitea/gitea/pull/26910)

12 months agoFix organization field being null in POST /orgs/{orgid}/teams (#27150)
Dionysios Kakouris [Thu, 21 Sep 2023 08:09:59 +0000 (10:09 +0200)]
Fix organization field being null in POST /orgs/{orgid}/teams (#27150)

Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694,
this addresses the team creation not returning the organization
information in the response.

This fix is connected to the
[issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27)
discovered in the terraform provider.
Moreover, the
[documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam)
suggests that the response body should include the `organization` field
(currently being `null`).

12 months agoAdd index to `issue_user.issue_id` (#27154)
JakobDev [Thu, 21 Sep 2023 01:30:48 +0000 (03:30 +0200)]
Add index to `issue_user.issue_id` (#27154)

This fixes a performance bottleneck. It was discovered by Codeberg.
Every where query on that table (which has grown big over time) uses
this column, but there is no index on it.

See this part of the log which was posted on Matrix:
```
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1446:ViewIssue() [W] [Slow SQL Query] UPDATE `issue_user` SET is_read=? WHERE uid=? AND issue_id=? [true x y] - 51.395434887s
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1447:ViewIssue() [E] ReadBy: Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
2023/09/10 00:52:01 ...eb/routing/logger.go:102:func1() [I] router: completed GET /Codeberg/Community/issues/1201 for [::ffff:xxx]:0, 500 Internal Server Error in 52384.2ms @ repo/issue.go:1256(repo.ViewIssue)
```

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 21 Sep 2023 00:22:27 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoStart development on Gitea 1.22 (#27155) v1.22.0-dev
delvh [Wed, 20 Sep 2023 21:18:53 +0000 (23:18 +0200)]
Start development on Gitea 1.22 (#27155)

12 months agoFix successful return value for `SyncAndGetUserSpecificDiff` (#27152) v1.21.0-rc0
delvh [Wed, 20 Sep 2023 20:28:17 +0000 (22:28 +0200)]
Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152)

A function should not return an error when it is successful.
Otherwise, things like https://discord.com/channels/322538954119184384/322538954119184384/1153705341620600833 happen…

12 months agoImprove actions docs related to `pull_request` event (#27126)
Zettat123 [Wed, 20 Sep 2023 06:28:35 +0000 (14:28 +0800)]
Improve actions docs related to `pull_request` event (#27126)

Related to #27039

The `ref` property in Gitea Actions is different from GitHub Actions.
This PR improves the documentation to explain the difference.

12 months agoRemove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)
delvh [Wed, 20 Sep 2023 03:02:58 +0000 (05:02 +0200)]
Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)

No backport needed as this new state only applies to 1.21+

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoFix: treat tab "overview" as "repositories" in user profiles without readme (#27124)
hazy [Wed, 20 Sep 2023 01:48:44 +0000 (20:48 -0500)]
Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124)

Beginning since 2af30f715e64dbb0a3900168e3768ffb36c06392, Gitea has a
500 error when visiting a user profile with `?tab=overview` in the URL
when the user doesn't have a `.profile/README.md`, because the backend
code assumes that if the tab is overview a profile repository must
exist, and checks that the repository is nil aren't done.

In this PR I treat `?tab=overview` the same as if no tab is set in the
URL, which corrects this behaviour- Now, when visiting `?tab=overview`,
if `.profile/README.md` exists on that user's profile it'll show that as
it should, otherwise it'll show the repositories tab.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoFix incorrect test code for error handling (#27139)
wxiaoguang [Wed, 20 Sep 2023 00:51:36 +0000 (08:51 +0800)]
Fix incorrect test code for error handling (#27139)

If `assert.NoError` fails, it should return. Otherwise the code could
still execute even if the error occurs.

12 months agoIncrease auth provider icon size on login page (#27122)
silverwind [Tue, 19 Sep 2023 21:47:13 +0000 (23:47 +0200)]
Increase auth provider icon size on login page (#27122)

Before, 20px:
<img width="474" alt="Screenshot 2023-09-19 at 00 10 05"
src="https://github.com/go-gitea/gitea/assets/115237/4bed4edb-219d-4844-9d3c-0d747033b09f">

After, 28px:
<img width="576" alt="Screenshot 2023-09-19 at 00 20 40"
src="https://github.com/go-gitea/gitea/assets/115237/f482ac09-38ae-4c84-80d9-0bd39b7f9772">

Dropdown in account settings is unchanged at 20px:
<img width="157" alt="Screenshot 2023-09-19 at 00 09 11"
src="https://github.com/go-gitea/gitea/assets/115237/9c998cdf-eeed-4118-9262-664faaa56092">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
12 months agofix pagination for followers and following (#27127)
Earl Warren [Tue, 19 Sep 2023 15:24:54 +0000 (17:24 +0200)]
fix pagination for followers and following (#27127)

- Use the correct total amount for pagination. Thereby correctly show
the pagination bare when there's more than one page of
followers/followings.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1477

(cherry picked from commit c1a136318be3bf72511bed108f2d67f2cf34e1b8)

Co-authored-by: Gusted <postmaster@gusted.xyz>
12 months agoservices/wiki: Close() after error handling (#27129)
Earl Warren [Tue, 19 Sep 2023 14:45:44 +0000 (16:45 +0200)]
services/wiki: Close() after error handling (#27129)

Refs: https://codeberg.org/forgejo/forgejo/pulls/1385

Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
(cherry picked from commit 589e7d346f51de4a0e2c461b220c8cad34133b2f)

Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
13 months agoUse fetch helpers instead of fetch (#27026)
silverwind [Tue, 19 Sep 2023 00:50:30 +0000 (02:50 +0200)]
Use fetch helpers instead of fetch (#27026)

WIP because:

- [x] Some calls set a `content-type` but send no body, can likely
remove the header
- [x] Need to check whether `charset=utf-8` has any significance on the
webauthn calls, I assume not as it is the default for json content.
- [x] Maybe `no-restricted-globals` is better for eslint, but will
require a lot of duplication in the yaml or moving eslint config to a
`.js` extension.
- [x] Maybe export `request` as `fetch`, shadowing the global.

13 months agoChange green buttons to primary color (#27099)
silverwind [Mon, 18 Sep 2023 22:05:31 +0000 (00:05 +0200)]
Change green buttons to primary color (#27099)

I think it's better if the primary actions have primary color instead of
green which fits better into the overall single-color UI design. This PR
currently replaces every green button with primary:

<img width="141" alt="Screenshot 2023-09-16 at 14 07 59"
src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe">
<img width="161" alt="Screenshot 2023-09-16 at 14 07 51"
src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1">

Modal actions now use uncolored/primary instead of previous green/red
colors. I also removed the box-shadow on all basic buttons:

<img width="259" alt="Screenshot 2023-09-16 at 14 16 39"
src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490">
<img width="261" alt="Screenshot 2023-09-16 at 14 17 42"
src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88">

The change currently includes the "Merge PR" button, for which we might
want to make an exception to match the icon color there:

<img width="442" alt="Screenshot 2023-09-16 at 14 33 53"
src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">

13 months agoFix wrong xorm get usage on migration (#27111)
Lunny Xiao [Mon, 18 Sep 2023 19:59:19 +0000 (03:59 +0800)]
Fix wrong xorm get usage on migration (#27111)

Fix the bug on try.gitea.io

```log
2023/09/18 01:48:41 ...ations/migrations.go:635:Migrate() [I] Migration[276]: Add RemoteAddress to mirrors
2023/09/18 01:48:41 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: migrate: migration[276]: Add RemoteAddress to mirrors failed: exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
```

Caused by #26952

---------

Co-authored-by: Jason Song <i@wolfogre.com>
13 months agoFix the incorrect route path in the user edit page. (#27007)
CaiCandong [Mon, 18 Sep 2023 12:08:09 +0000 (20:08 +0800)]
Fix the incorrect route path in the user edit page. (#27007)

Regression of #26713

After #26713 , the base path of user edit has been changed to
`/admin/users/{userid}/edit`
## Before

https://github.com/go-gitea/gitea/assets/50507092/5f4a3f64-fe2b-4499-b110-e01c9d87ea19

13 months agoRefactor lfs requests (#26783)
Chongyi Zheng [Mon, 18 Sep 2023 08:40:50 +0000 (04:40 -0400)]
Refactor lfs requests (#26783)

- Refactor lfs request code
- The original code uses `performRequest` function to create the
request, uses a callback to modify the request, and then send the
request.
- Now it's replaced with `createRequest` that only creates request and
`performRequest` that only sends the request.
- Reuse `createRequest` and `performRequest` in `http_client.go` and
`transferadapter.go`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>