]> source.dussan.org Git - gitea.git/log
gitea.git
17 months agoFix form method/class (#24535)
wxiaoguang [Fri, 5 May 2023 05:14:22 +0000 (13:14 +0800)]
Fix form method/class (#24535)

Fix #24534

17 months agoFix typo in rename branch dialog (#24537)
sillyguodong [Fri, 5 May 2023 04:44:59 +0000 (12:44 +0800)]
Fix typo in rename branch dialog (#24537)

Fix https://github.com/go-gitea/gitea/pull/24512#discussion_r1185664695

17 months agoCheck length of `LogIndexes` in case it is outdated (#24516)
Jason Song [Fri, 5 May 2023 03:37:43 +0000 (11:37 +0800)]
Check length of `LogIndexes` in case it is outdated (#24516)

Fix #24458

17 months agoHarmonize title formatting in `docs/content/doc/development/api-usage.en-us.md` ...
Benjamin Loison [Fri, 5 May 2023 03:11:54 +0000 (05:11 +0200)]
Harmonize title formatting in `docs/content/doc/development/api-usage.en-us.md` (#24529)

17 months agoautomate locking closed threads (#24525)
techknowlogick [Fri, 5 May 2023 02:17:29 +0000 (22:17 -0400)]
automate locking closed threads (#24525)

With comments happening on closed issues/prs this locks issues that have
been closed for >45days. This allows for comments on recently closed
issues/prs to still happen.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 5 May 2023 00:22:45 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoDisplay warning when user try to rename default branch (#24512)
sillyguodong [Thu, 4 May 2023 22:54:38 +0000 (06:54 +0800)]
Display warning when user try to rename default branch (#24512)

Follow #24380

It's better to warn users when they try to rename the default branch.

![image](https://user-images.githubusercontent.com/33891828/236107929-c8ac2854-dd0f-4500-a0a7-800c8fe48861.png)

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoUpgrade to Node 20 on CI, enable actions cancellation (#24524)
silverwind [Thu, 4 May 2023 22:21:48 +0000 (00:21 +0200)]
Upgrade to Node 20 on CI, enable actions cancellation (#24524)

- Upgrade node, the
[snap](https://github.com/go-gitea/gitea/blob/7abe958f5b507efa676fb3b2e27d30517f6d1908/snap/snapcraft.yaml#L47)
is excluded from this because [there is no Node 20 snap
yet](https://snapcraft.io/node).
- Add actions build cancellation based on
[this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value).

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
17 months agoFix incorrectly quoted translation (#24514)
Lunny Xiao [Thu, 4 May 2023 18:46:47 +0000 (02:46 +0800)]
Fix incorrectly quoted translation (#24514)

Looks like crowdin cannot recognize a value starting with a double quote but
not end with a double quote.

17 months agoFix color for transfer related buttons when having no permission to act (#24510)
Hester Gong [Thu, 4 May 2023 13:21:30 +0000 (21:21 +0800)]
Fix color for transfer related buttons when having no permission to act (#24510)

Before:

<img width="1410" alt="Screen Shot 2023-05-04 at 09 28 23"
src="https://user-images.githubusercontent.com/17645053/236100146-2b64d274-2d79-4b4c-827c-3906a2a9dbb7.png">
<img width="1413" alt="Screen Shot 2023-05-04 at 09 28 30"
src="https://user-images.githubusercontent.com/17645053/236100157-15c12e83-a4f5-4b4e-b26b-73a8ce8bc0db.png">

After:

With no permission:

<img width="1409" alt="Screen Shot 2023-05-04 at 12 17 12"
src="https://user-images.githubusercontent.com/17645053/236144666-c2bb6ca2-59e1-45ae-93cd-d43545500d06.png">
<img width="1402" alt="Screen Shot 2023-05-04 at 12 17 17"
src="https://user-images.githubusercontent.com/17645053/236144677-c51a65cf-8aef-4566-b265-14b2ebb46d0b.png">

With permission:

<img width="1412" alt="Screen Shot 2023-05-04 at 12 16 45"
src="https://user-images.githubusercontent.com/17645053/236144565-9c5aa9a6-1424-49e3-a2b2-a129fecb856c.png">
<img width="1420" alt="Screen Shot 2023-05-04 at 12 16 51"
src="https://user-images.githubusercontent.com/17645053/236144573-a4064136-80d9-4c41-8f98-f51b4352bdf7.png">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix some mistakes when using `ignSignIn` (#24415)
wxiaoguang [Thu, 4 May 2023 12:07:15 +0000 (20:07 +0800)]
Fix some mistakes when using `ignSignIn` (#24415)

Some old code doesn't respect the definition of `RequireSignInView` (the
`ignSignIn` is forgotten).

After #24413, this PR will do more fixes, ~~and rename the strange
`ignSignIn` to `optSignIn`.~~

This PR is ready for review, I think we can postpone the "ignSignIn"
renaming to another, to make this PR simple and clear.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRemove unused zapx replace statement on go.mod (#24515)
Lunny Xiao [Thu, 4 May 2023 10:37:39 +0000 (18:37 +0800)]
Remove unused zapx replace statement on go.mod (#24515)

Fix #23617

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoDon't display creating page button in a mirror wiki repository (#24395)
Lunny Xiao [Thu, 4 May 2023 07:27:15 +0000 (15:27 +0800)]
Don't display creating page button in a mirror wiki repository (#24395)

A mirror repository with wiki is also a mirror. So creating page from UI
should be disabled. This PR hides the button like other places.

17 months agoImprove template system and panic recovery (#24461)
wxiaoguang [Thu, 4 May 2023 06:36:34 +0000 (14:36 +0800)]
Improve template system and panic recovery (#24461)

Partially for #24457

Major changes:

1. The old `signedUserNameStringPointerKey` is quite hacky, use
`ctx.Data[SignedUser]` instead
2. Move duplicate code from `Contexter` to `CommonTemplateContextData`
3. Remove incorrect copying&pasting code `ctx.Data["Err_Password"] =
true` in API handlers
4. Use one unique `RenderPanicErrorPage` for panic error page rendering
5. Move `stripSlashesMiddleware` to be the first middleware
6. Install global panic recovery handler, it works for both `install`
and `web`
7. Make `500.tmpl` only depend minimal template functions/variables,
avoid triggering new panics

Screenshot:

<details>

![image](https://user-images.githubusercontent.com/2114189/235444895-cecbabb8-e7dc-4360-a31c-b982d11946a7.png)

</details>

17 months agoFaster git.GetDivergingCommits (#24482)
oliverpool [Thu, 4 May 2023 05:08:41 +0000 (07:08 +0200)]
Faster git.GetDivergingCommits (#24482)

Using `git rev-list --left-right` is almost 2x faster than calling `git
rev-list` twice.

Co-authored-by: silverwind <me@silverwind.io>
17 months agoMerge setting.InitXXX into one function with options (#24389)
Lunny Xiao [Thu, 4 May 2023 03:55:35 +0000 (11:55 +0800)]
Merge setting.InitXXX into one function with options (#24389)

This PR will merge 3 Init functions on setting packages as 1 and
introduce an options struct.

17 months agoChangelog for 1.19.3 (#24495) (#24506)
Yarden Shoham [Thu, 4 May 2023 02:05:47 +0000 (05:05 +0300)]
Changelog for 1.19.3 (#24495) (#24506)

Frontport #24495

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
17 months agoUse Actions for DB & E2E tests (#24494)
techknowlogick [Thu, 4 May 2023 02:04:02 +0000 (22:04 -0400)]
Use Actions for DB & E2E tests (#24494)

following https://github.com/go-gitea/gitea/pull/24314 and
https://github.com/go-gitea/gitea/pull/24434, this PR moves drone cron
pipelines to (GitHub) Actions. As these are mostly compatible with Gitea
Actions, when we start to dogfood, these will already be migrated.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix intermittent CI failure in EmptyQueue (#23753)
zeripath [Thu, 4 May 2023 01:37:30 +0000 (02:37 +0100)]
Fix intermittent CI failure in EmptyQueue (#23753)

The ordering of the final token causing a close of the queue in this
test may be out of sync due to concurrency. Instead just use ensure that
the queue is closed when everything expected is done.

Fixes: https://github.com/go-gitea/gitea/issues/23608
Fixes: https://github.com/go-gitea/gitea/issues/23977
---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
17 months agoPrevent a user with a different email from accepting the team invite (#24491)
Jack Hay [Thu, 4 May 2023 01:21:58 +0000 (21:21 -0400)]
Prevent a user with a different email from accepting the team invite (#24491)

## Changes
- Fixes the case where a logged in user can accept an email invitation
even if their email address does not match the address in the invitation

17 months agoFix incorrect webhook time and use relative-time to display it (#24477)
yp05327 [Wed, 3 May 2023 23:53:43 +0000 (08:53 +0900)]
Fix incorrect webhook time and use relative-time to display it (#24477)

Fixes #24414
After click replay this webhook, it will display `now`

![image](https://user-images.githubusercontent.com/18380374/235559399-05a23927-13f5-442d-8f10-2c7cd24022a0.png)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoMake Issue/PR/projects more compact, misc CSS tweaks (#24459)
silverwind [Wed, 3 May 2023 21:58:59 +0000 (23:58 +0200)]
Make Issue/PR/projects more compact, misc CSS tweaks (#24459)

- Remove various horizontal dividers on repo pages that didn't provide
visual benefit
- Remove label/milestone pills on single issue/pr page
- Remove issue-related pill buttons on projects page
- Increase contrast of color-secondary on arc-green
- Improve notifications icon, make circle bigger
- Remove some inline styles
- Fix focus in issue/pr title edit and select all text on button click

### Issue and PR before and after

<img width="1249" alt="Screenshot 2023-05-01 at 11 44 22"
src="https://user-images.githubusercontent.com/115237/235436662-a708288e-84fb-4b2e-a5a2-3a1c17d28f6c.png">
<img width="1248" alt="Screenshot 2023-05-01 at 11 58 51"
src="https://user-images.githubusercontent.com/115237/235437992-f863e483-f3cc-4cc1-8204-fd223647a0c9.png">

### Projects before and after

<img width="1255" alt="Screenshot 2023-05-01 at 11 41 02"
src="https://user-images.githubusercontent.com/115237/235436433-0deb85d6-4e7d-4e74-847f-254cc70a0cf9.png">
<img width="1267" alt="Screenshot 2023-05-01 at 11 40 03"
src="https://user-images.githubusercontent.com/115237/235436431-715b13cb-f78c-4d86-b27a-9229f9738c5b.png">

### Releases before and after

<img width="1243" alt="Screenshot 2023-05-01 at 11 41 12"
src="https://user-images.githubusercontent.com/115237/235436457-b655ee6f-03b8-4595-8d8c-b15ea469e988.png">
<img width="1240" alt="Screenshot 2023-05-01 at 11 40 10"
src="https://user-images.githubusercontent.com/115237/235436456-05a2a0dd-7cbb-4f26-b0d3-4f667df4bb95.png">

### Misc

<img width="58" alt="Screenshot 2023-05-01 at 10 49 13"
src="https://user-images.githubusercontent.com/115237/235432494-936ce995-6e22-47bc-ab2d-c9e93d31987d.png">
<img width="57" alt="Screenshot 2023-05-01 at 18 57 08"
src="https://user-images.githubusercontent.com/115237/235492430-1d32cfe0-0f2c-467c-b2fa-925b27e30e0e.png">

Issue title edit and wrap:

<img width="1238" alt="Screenshot 2023-05-01 at 12 34 40"
src="https://user-images.githubusercontent.com/115237/235441407-d5067a57-e586-4865-a652-282e5944abb4.png">
<img width="1232" alt="Screenshot 2023-05-01 at 12 06 24"
src="https://user-images.githubusercontent.com/115237/235438710-1a543dda-220f-4d87-8f93-f1710c0695f0.png">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoImplement Cargo HTTP index (#24452)
KN4CK3R [Wed, 3 May 2023 20:58:43 +0000 (22:58 +0200)]
Implement Cargo HTTP index (#24452)

This implements the HTTP index
[RFC](https://rust-lang.github.io/rfcs/2789-sparse-index.html) for Cargo
registries.

Currently this is a preview feature and you need to use the nightly of
`cargo`:

`cargo +nightly -Z sparse-registry update`

See https://github.com/rust-lang/cargo/issues/9069 for more information.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoClean up polluted styles and remove dead CSS code (#24497)
wxiaoguang [Wed, 3 May 2023 18:32:10 +0000 (02:32 +0800)]
Clean up polluted styles and remove dead CSS code (#24497)

Follow #24393

The funny history:

* At the beginning, `.ui.message` was polluted by `text-align: center`
* Then people do `<div class="ui ... message text left">`
* But `.ui.left` is polluted by `float: left`
* Then people do `#xxx .ui.message { width: 100% !important;}`

The code just becomes more and more hacky.

After removing the pollution,  everything becomes clear and straight.

And, this PR also does:

1. Remove the `package.css`, its styles could be provided by `top
aligned`
2. Remove `#avatar-arrow`, dead code

Screenshot:

![image](https://user-images.githubusercontent.com/2114189/235862130-a9eb5d8f-7d01-457c-99f7-21d0abc3075e.png)

![image](https://user-images.githubusercontent.com/2114189/235862222-139709a7-95c2-4f89-a40f-100b2d76d9bb.png)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImprove pull request merge box when pull request merged and branch deleted. (#24397)
Lunny Xiao [Wed, 3 May 2023 13:52:19 +0000 (21:52 +0800)]
Improve pull request merge box when pull request merged and branch deleted. (#24397)

This PR hide the pull request merge box totally if it's merged and branch deleted.

It's also add a bold for merge base commit id in merged message comment

Before:

<img width="989" alt="图片"
src="https://user-images.githubusercontent.com/81045/235066590-28deb506-e824-4a42-a9a2-791cd136756e.png">

After:

<img width="1030" alt="图片"
src="https://user-images.githubusercontent.com/81045/235080749-11d5efe8-a06e-4528-a75f-f6c6d191db50.png">

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoFix EasyMDE toolbar (#24489)
silverwind [Wed, 3 May 2023 05:23:39 +0000 (07:23 +0200)]
Fix EasyMDE toolbar (#24489)

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

The "clean block" button is gone because I could not find a matching
octicon. Order of buttons is roughly equal to textarea.

<img width="824" alt="Screenshot 2023-05-02 at 21 10 00"
src="https://user-images.githubusercontent.com/115237/235762593-ceccb260-e665-4932-ac8a-ef6fe8406a3c.png">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoEnhance stylelint rule config, remove dead CSS (#24472)
silverwind [Wed, 3 May 2023 03:15:52 +0000 (05:15 +0200)]
Enhance stylelint rule config, remove dead CSS (#24472)

Make this stylelint rule match on more properties.

The dead CSS relates to the navbar, which currently has classes:

```
ui top secondary stackable main menu following bar light
```

Which means `.following.bar .top.menu` can never match, so remove this
dead CSS as well as inactive `z-index` and `left` on it.

Commits table striping becomes more visible on dark theme, but I don't
think it's worth introducing a new color until
https://github.com/go-gitea/gitea/pull/24423 is ready, which would have
to remove it again:

<img width="668" alt="Screenshot 2023-05-01 at 18 41 49"
src="https://user-images.githubusercontent.com/115237/235489873-6b272899-1d78-443a-872c-ee7731c269f9.png">
<img width="680" alt="Screenshot 2023-05-01 at 18 41 41"
src="https://user-images.githubusercontent.com/115237/235489878-1b9468af-c74f-48a6-a469-9eba57cfcb4d.png">

17 months agoFix api error message if fork exists (#24487)
Otto Richter (fnetX) [Wed, 3 May 2023 00:26:38 +0000 (02:26 +0200)]
Fix api error message if fork exists (#24487)

On the @Forgejo instance of Codeberg, we discovered that forking a repo
which is already forked now returns a 500 Internal Server Error, which
is unexpected. This is an attempt at fixing this.

The error message in the log:
~~~
2023/05/02 08:36:30 .../api/v1/repo/fork.go:147:CreateFork() [E]
[6450cb8e-113] ForkRepository: repository is already forked by user
[uname: ...., repo path: .../..., fork path: .../...]
~~~

The service that is used for forking returns a custom error message
which is not checked against.

About the order of options:
The case that the fork already exists should be more common, followed by
the case that a repo with the same name already exists for other
reasons. The case that the global repo limit is hit is probably not the
likeliest.

Co-authored-by: Otto Richter <otto@codeberg.org>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd ntlm authentication support for mail (#23811)
木木田 [Tue, 2 May 2023 21:40:46 +0000 (05:40 +0800)]
Add ntlm authentication support for mail (#23811)

Add ntlm authentication support for mail
use "github.com/Azure/go-ntlmssp"

---------

Co-authored-by: yangtan_win <YangTan@Fitsco.com.cn>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix test delivery button in repo webhook settings page (#24478)
yp05327 [Tue, 2 May 2023 19:58:18 +0000 (04:58 +0900)]
Fix test delivery button in repo webhook settings page (#24478)

Caused by
https://github.com/go-gitea/gitea/pull/24246/files#diff-2bfe41d93dbb409583a4f945902e46bb513f60f1c9301649c1689200c4f1466eR1

Class `new` was removed in #24246, but in function
`initCompWebHookEditor`, it will check `.new.webhook`.
So in repo webhook settings page, `initCompWebHookEditor` will init
nothing, and no response after click the test delivery button.

https://github.com/go-gitea/gitea/blob/da65b7ad47e8d0d82f47cb24ee9ac2a0ec50dc25/web_src/js/features/comp/WebHookEditor.js#L6-L9

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd Debian package registry (#24426)
KN4CK3R [Tue, 2 May 2023 16:31:35 +0000 (18:31 +0200)]
Add Debian package registry (#24426)

Co-authored-by: @awkwardbunny
This PR adds a Debian package registry.
You can follow [this
tutorial](https://www.baeldung.com/linux/create-debian-package) to build
a *.deb package for testing.
Source packages are not supported at the moment and I did not find
documentation of the architecture "all" and how these packages should be
treated.

![grafik](https://user-images.githubusercontent.com/1666336/218126879-eb80a866-775c-4c8e-8529-5797203a64e6.png)

Part of #20751.

Revised copy of #22854.

---------

Co-authored-by: Brian Hong <brian@hongs.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoEnable whitespace rendering on selection in Monaco (#24444)
silverwind [Tue, 2 May 2023 13:31:38 +0000 (15:31 +0200)]
Enable whitespace rendering on selection in Monaco (#24444)

Remove the
[renderWhitespace](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IEditorOptions.html#renderWhitespace)
override, so the default value of `selection` takes over and makes
whitespace visible on selection.

<img width="128" alt="Screenshot 2023-04-30 at 19 09 41"
src="https://user-images.githubusercontent.com/115237/235366707-d598268d-03cc-4839-a195-c460bddae99b.png">

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoReplace `N/A` with `-` everywhere (#24474)
silverwind [Tue, 2 May 2023 09:54:29 +0000 (11:54 +0200)]
Replace `N/A` with `-` everywhere (#24474)

Followup to https://github.com/go-gitea/gitea/pull/24427.

Reasoning is that `N/A` is specific to english while `-` is
language-neutral and does not need translation.

Before:
<img width="891" alt="Screenshot 2023-05-01 at 20 58 20"
src="https://user-images.githubusercontent.com/115237/235511592-8a36d0f2-34ff-4dbe-b642-67c0ade644fe.png">

After:
<img width="901" alt="Screenshot 2023-05-01 at 20 59 59"
src="https://user-images.githubusercontent.com/115237/235511594-d49f6d09-92e8-4e99-be7b-2a37f5d24129.png">

17 months agoFix invite display (#24447)
KN4CK3R [Tue, 2 May 2023 07:59:31 +0000 (09:59 +0200)]
Fix invite display (#24447)

Regression of #23901

Before

![grafik](https://user-images.githubusercontent.com/1666336/235371271-f4d06df5-97a0-43bc-b905-5fcdc5666b29.png)

After

![grafik](https://user-images.githubusercontent.com/1666336/235371311-5c03003e-b628-4721-93a6-4e2b1ada4d87.png)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 2 May 2023 00:23:19 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoreplace PR docker dry run in drone with Actions (#24475)
techknowlogick [Mon, 1 May 2023 20:39:36 +0000 (16:39 -0400)]
replace PR docker dry run in drone with Actions (#24475)

As before with past PRs to switch Drone pipelines to use (GitHub)
Actions.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agocorrect env vars
techknowlogick [Mon, 1 May 2023 18:31:11 +0000 (14:31 -0400)]
correct env vars

17 months agonightly image tag for releases
techknowlogick [Mon, 1 May 2023 18:18:56 +0000 (14:18 -0400)]
nightly image tag for releases

17 months agoRemove `font-awesome` and fomantic `icon` module (#24471)
silverwind [Mon, 1 May 2023 17:25:54 +0000 (19:25 +0200)]
Remove `font-awesome` and fomantic `icon` module (#24471)

Fixes https://github.com/go-gitea/gitea/issues/10410.
This PR removes around 120kB of CSS.

17 months agoImprove "new-menu" (#24465)
wxiaoguang [Mon, 1 May 2023 16:08:37 +0000 (00:08 +0800)]
Improve "new-menu" (#24465)

I am not sure what "new-menu" means, but I think we need to fix these
problems:

1. it shouldn't have "stackable", which makes the items stacked when
width is small. the `new-menu` already has `overflow: auto`
2. `justify-content: center` doesn't work with `overflow: auto` (for
small width), so use `margin: auto`
*
https://bhch.github.io/posts/2021/04/centring-flex-items-and-allowing-overflow-scroll/
3. `runner-new-menu` is dead code (copying & pasting ?)

17 months agoRemove fomantic breadcrumb module (#24463)
silverwind [Mon, 1 May 2023 15:40:02 +0000 (17:40 +0200)]
Remove fomantic breadcrumb module (#24463)

### File path before/after

<img width="522" alt="Screenshot 2023-05-01 at 13 23 33"
src="https://user-images.githubusercontent.com/115237/235445636-57776038-c98e-4cab-8abe-045138a76958.png">
<img width="522" alt="Screenshot 2023-05-01 at 13 24 08"
src="https://user-images.githubusercontent.com/115237/235445638-70bef62a-1b70-41f8-ba51-728db4d54402.png">

### File edit before/after

<img width="499" alt="Screenshot 2023-05-01 at 13 24 46"
src="https://user-images.githubusercontent.com/115237/235445676-7b3cc23e-289b-40a6-8d4f-0d7fb2efb55e.png">
<img width="497" alt="Screenshot 2023-05-01 at 13 24 52"
src="https://user-images.githubusercontent.com/115237/235445677-db9f3974-8456-46de-a32b-9198110c0540.png">

### Cherry-pick before/after

<img width="590" alt="Screenshot 2023-05-01 at 13 25 30"
src="https://user-images.githubusercontent.com/115237/235445717-99445024-1bb2-46d4-9bd8-8086bad57d34.png">
<img width="582" alt="Screenshot 2023-05-01 at 13 25 37"
src="https://user-images.githubusercontent.com/115237/235445720-9c1dc497-eb23-4e10-a727-27f4d6df69e6.png">

17 months agoAdd rerun workflow button and refactor to use SVG octicons (#24350)
yp05327 [Mon, 1 May 2023 14:14:20 +0000 (23:14 +0900)]
Add rerun workflow button and refactor to use SVG octicons (#24350)

Changes:
- Add rerun workflow button. Then users can rerun the whole workflow by
only one-click.
- Refactor to use SVG octicons in RepoActionView.vue

![image](https://user-images.githubusercontent.com/18380374/234736083-dea9b333-ec11-4095-a113-763f3716fba7.png)

![image](https://user-images.githubusercontent.com/18380374/234736107-d657d19c-f70a-42f4-985f-156a8c7efb7a.png)

![image](https://user-images.githubusercontent.com/18380374/234736160-9ad372df-7089-4d18-9bab-48bca3f01878.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoRemove .lgtm and reference to old bot (#24464)
silverwind [Mon, 1 May 2023 12:49:30 +0000 (14:49 +0200)]
Remove .lgtm and reference to old bot (#24464)

Since we now use
[gitea-backporter](https://github.com/GiteaBot/gitea-backporter) for
LGTM, we no longer need this.

17 months agoRemove unnecessary g-menu-stackable-scrollable (#24462)
wxiaoguang [Mon, 1 May 2023 10:51:14 +0000 (18:51 +0800)]
Remove unnecessary g-menu-stackable-scrollable (#24462)

Fix #24460

That's a mistake but ..... no idea why I wrote so ... remove it.

17 months agoReplace remaining fontawesome dropdown icons with SVG (#24455)
silverwind [Mon, 1 May 2023 09:35:02 +0000 (11:35 +0200)]
Replace remaining fontawesome dropdown icons with SVG (#24455)

- Replace leftover dropdown triangles with SVG
- Replace remove icon with SVG and add styling for it:

<img width="817" alt="Screenshot 2023-05-01 at 00 40 05"
src="https://user-images.githubusercontent.com/115237/235379271-4674d4f7-b11e-4d6d-90f9-1478325443ca.png">
<img width="816" alt="Screenshot 2023-05-01 at 00 46 56"
src="https://user-images.githubusercontent.com/115237/235379451-b515afb3-9773-4f6f-a259-e7048235bcba.png">

17 months agoMove links out of translation (#24446)
KN4CK3R [Mon, 1 May 2023 07:17:27 +0000 (09:17 +0200)]
Move links out of translation (#24446)

Addition to
https://github.com/go-gitea/gitea/pull/24426#discussion_r1181261215

I updated all existing translations too because otherwise they would
show something like

> For more information on the Container registry, see [the
documentation](#).%!(EXTRA
string=https://docs.gitea.io/en-us/packages/container/)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agotarget correct conditional
techknowlogick [Mon, 1 May 2023 04:31:50 +0000 (00:31 -0400)]
target correct conditional

17 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 1 May 2023 00:25:30 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

17 months agoSet stop_on_error (#24453)
KN4CK3R [Sun, 30 Apr 2023 22:31:16 +0000 (00:31 +0200)]
Set stop_on_error (#24453)

Current air version runs the old binary if the build fails. This
restores the old behaviour.

```
...
code.gitea.io/gitea/services/cron
code.gitea.io/gitea/routers/web/user/setting
code.gitea.io/gitea/routers/web/org
make[2]: *** [Makefile:814: gitea] Error 1
make[2]: Leaving directory '/src'
failed to build, error: exit status 2
running...
2023/04/30 21:04:11 cmd/web.go:125:runWeb() [I] Starting Gitea on PID: 29153
2023/04/30 21:04:11 cmd/web.go:178:runWeb() [I] Global init
...
```

Reference: https://github.com/cosmtrek/air/pull/336

17 months agoRemove all direct references to font-awesome (#24448)
Yarden Shoham [Sun, 30 Apr 2023 22:02:56 +0000 (01:02 +0300)]
Remove all direct references to font-awesome (#24448)

- Related #10410
- I had to add an SVG for an empty checkbox
https://github.com/primer/octicons/issues/942

# Before

![image](https://user-images.githubusercontent.com/20454870/235374683-13f355c3-1245-40db-adda-4c710fc80288.png)

# After

![image](https://user-images.githubusercontent.com/20454870/235374655-cc637132-f314-424d-9243-13d45b8915d5.png)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoAdd `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442)
silverwind [Sun, 30 Apr 2023 18:58:32 +0000 (20:58 +0200)]
Add `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442)

- Add `ui-monospace` to support Safari 13.4+.
- Add `SF Mono` variant to support the font on non-mac.
- Quote fonts as per [W3C
recommendation](https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#propdef-font-family).

> it is recommended to quote font family names that contain white space,
digits, or punctuation characters other than hyphens

Fixes: https://github.com/go-gitea/gitea/issues/22125
17 months agoFix incorrect CurrentUser check for docker rootless (#24441)
wxiaoguang [Sun, 30 Apr 2023 18:14:57 +0000 (02:14 +0800)]
Fix incorrect CurrentUser check for docker rootless (#24441)

The IsRunUserMatchCurrentUser logic is fragile, the "SSH" config is not
ready when it executes.

17 months agoFix config list overflow and layout (#24312)
silverwind [Sun, 30 Apr 2023 17:32:07 +0000 (19:32 +0200)]
Fix config list overflow and layout (#24312)

Fixes: https://github.com/go-gitea/gitea/issues/24299
<img width="531" alt="Screenshot 2023-04-24 at 21 05 40"
src="https://user-images.githubusercontent.com/115237/234091905-9db42697-87b3-40a0-bd18-9e910ad8a2ae.png">

17 months agoMove docs pipelines to use Actions (#24434)
techknowlogick [Sun, 30 Apr 2023 16:23:26 +0000 (12:23 -0400)]
Move docs pipelines to use Actions (#24434)

similar to #24314, this moves drone cron pipelines to (GitHub) Actions.
As these are mostly compatible with Gitea Actions, when we start to
dogfood, these will already be migrated.

I also removed the discord notify pipeline, as it hasn't been working
for several months.

17 months agoImprove issue list filter (#24425)
wxiaoguang [Sun, 30 Apr 2023 15:51:20 +0000 (23:51 +0800)]
Improve issue list filter (#24425)

Partial regression of #24393, not only regression, but broken for long
time, 24393 didn't really improve it but used wrong `overflow: scroll`.

Actually, that "ui secondary filter menu labels" shouldn't be set as
scrollable (I missed that at that time), the problem is: if a "ui menu"
has "dropdown" items, then it should not be scrollable. Otherwise the
dropdown menu can't be shown correctly.

And there are more problems:

* The "issue-filters" shouldn't be used anywhere else (copying&pasting
problem again ....)
* There is also an "issue-actions" container, it should also be fixed.
* There are similar problems on the milestone page.
* The old comment in code: "grid column" doesn't work well.

The major changes of this PR are: use "flex: 1" instead of "ui grid
column".

After this PR, not 100% perfect but much better than before.

17 months agoMove `Rename branch` from repo settings page to the page of branches list (#24380)
sillyguodong [Sun, 30 Apr 2023 15:08:51 +0000 (23:08 +0800)]
Move `Rename branch` from repo settings page to the page of branches list (#24380)

Co-Author: @wxiaoguang

It is more convenient that user just need to enter a new branch name after he selects the branch which he want to rename.
So this PR move the function of renaming branch to the page of branches list.

This PR also restyle the button of `new branch`, `download`, `delete`....

https://user-images.githubusercontent.com/33891828/235277997-413060bb-759f-430a-b5c4-df5e40ffcd28.mov

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoImprove milestone filter on issues page (#22423)
Lunny Xiao [Sun, 30 Apr 2023 13:12:49 +0000 (21:12 +0800)]
Improve milestone filter on issues page (#22423)

Now we have `All milestones`, `No milestones`, `Open milestones` and
`Closed milestones`.
Fix #11924
Fix #22411

<img width="1166" alt="image"
src="https://user-images.githubusercontent.com/81045/212243375-95eea035-a972-44b8-8088-53db614cb07e.png">

17 months agoUse globally shared HTMLRender (#24436)
wxiaoguang [Sun, 30 Apr 2023 12:22:23 +0000 (20:22 +0800)]
Use globally shared HTMLRender (#24436)

The old `HTMLRender` is not ideal.

1. It shouldn't be initialized multiple times, it consumes a lot of
memory and is slow.
2. It shouldn't depend on short-lived requests, the `WatchLocalChanges`
needs a long-running context.
3. It doesn't make sense to use FuncsMap slice.

HTMLRender was designed to only work for GItea's specialized 400+
templates, so it's good to make it a global shared instance.

17 months agoRework header bar on issue, pull requests and milestone (#24420)
silverwind [Sun, 30 Apr 2023 03:33:25 +0000 (05:33 +0200)]
Rework header bar on issue, pull requests and milestone (#24420)

- Make search bar dynamic full width via flexbox
- Make all buttons `small` so font size is the same for all elements in
the header
- Remove primary color from search field, add SVG icon like on Code tab
- Fix button vertical padding being enlarged by SVG icons

[View diff without
whitespace](https://github.com/go-gitea/gitea/pull/24420/files?diff=unified&w=1)

<img width="1226" alt="Screenshot 2023-04-29 at 11 58 53"
src="https://user-images.githubusercontent.com/115237/235296851-74848267-664f-4c1f-b94c-a1b94196ff75.png">
<img width="1219" alt="Screenshot 2023-04-29 at 11 59 39"
src="https://user-images.githubusercontent.com/115237/235296852-bcfde5ed-8658-43c2-b7e5-3ad84611e76f.png">

Mobile:
<img width="437" alt="Screenshot 2023-04-29 at 11 59 52"
src="https://user-images.githubusercontent.com/115237/235296860-99263373-7b27-4540-868c-a93e70f281ca.png">
<img width="433" alt="Screenshot 2023-04-29 at 12 00 00"
src="https://user-images.githubusercontent.com/115237/235296862-6cf64317-a864-405a-a00f-b5ab620349f5.png">

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 30 Apr 2023 00:25:54 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoRemove unused setting `time.FORMAT` (#24430)
Yarden Shoham [Sat, 29 Apr 2023 20:51:43 +0000 (23:51 +0300)]
Remove unused setting `time.FORMAT` (#24430)

It's loaded and then never used.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix user-cards format (#24428)
KN4CK3R [Sat, 29 Apr 2023 19:43:01 +0000 (21:43 +0200)]
Fix user-cards format (#24428)

Fixes #24418

17 months agoAdd follow organization and fix the logic of following page (#24345)
yp05327 [Sat, 29 Apr 2023 19:13:58 +0000 (04:13 +0900)]
Add follow organization and fix the logic of following page (#24345)

![image](https://user-images.githubusercontent.com/18380374/234740589-066f2e5c-30c7-4fc3-a539-066100e1f138.png)

![image](https://user-images.githubusercontent.com/18380374/234740605-88efe55d-7eaa-422e-ab86-0b5a402ca11c.png)

Maybe we can fix user card tmpl in #24319?
Or maybe a list is better here

![image](https://user-images.githubusercontent.com/18380374/234451417-7f93df20-4b19-4abb-a62d-4c67e1aa2220.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd "Updated" column for admin repositories list (#24429)
Yarden Shoham [Sat, 29 Apr 2023 18:40:10 +0000 (21:40 +0300)]
Add "Updated" column for admin repositories list (#24429)

- Closes #12454

# Before

![image](https://user-images.githubusercontent.com/20454870/235314351-82f5a414-7827-4029-8779-a837283a5a05.png)
# After

![image](https://user-images.githubusercontent.com/20454870/235314376-ccf4bb95-6823-4fce-9b9a-a23da2351769.png)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoAdd ability to specify '--not' from GetAllCommits (#24409)
Matthew Walowski [Sat, 29 Apr 2023 12:34:14 +0000 (05:34 -0700)]
Add ability to specify '--not' from GetAllCommits (#24409)

For my specific use case, I'd like to get all commits that are on one
branch but NOT on the other branch.

For instance, I'd like to get all the commits on `Branch1` that are not
also on `master` (I.e. all commits that were made after `Branch1` was
created).

This PR adds a `not` query param that gets passed down to the `git log`
command to allow the user to exclude items from `GetAllCommits`.

See [git
documentation](https://git-scm.com/docs/git-log#Documentation/git-log.txt---not)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImprove template helper (#24417)
wxiaoguang [Sat, 29 Apr 2023 12:02:29 +0000 (20:02 +0800)]
Improve template helper (#24417)

It seems that we really need the "context function" soon. So we should
clean up the helper functions first.

Major changes:

* Improve StringUtils and add JsonUtils
* Remove one-time-use helper functions like CompareLink
* Move other code (no change) to util_avatar/util_render/util_misc (no
need to propose changes for them)

I have tested the changed templates:

![image](https://user-images.githubusercontent.com/2114189/235283862-608dbf6b-2da3-4d06-8157-b523ca93edb4.png)

![image](https://user-images.githubusercontent.com/2114189/235283888-1dfc0471-e622-4d64-9d76-7859819580d3.png)

![image](https://user-images.githubusercontent.com/2114189/235283903-d559f14d-4abb-4a50-915f-2b9cbc381a7a.png)

![image](https://user-images.githubusercontent.com/2114189/235283955-b7b5adea-aca3-4758-b38a-3aae3f7c6048.png)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoStart cleaning the messy ".ui.left / .ui.right", improve label list page, fix stackab...
wxiaoguang [Sat, 29 Apr 2023 11:35:59 +0000 (19:35 +0800)]
Start cleaning the messy ".ui.left / .ui.right", improve label list page, fix stackable menu (#24393)

Since 2015/2016, there is a global pollution: ".ui.left" / ".ui.right".

Fomantic UI doesn't work this way, it just conflicts with many Fomantic
definitions.

This PR starts the cleaning work of such techinical debts.

And, the "label list" page has been quite messy for long time, for
example, why "li" appears in "div" ......

And fix #24296

<details>

![image](https://user-images.githubusercontent.com/2114189/235051281-54c5374c-b5fd-4b5f-9aa2-02d4bb2d9112.png)

![image](https://user-images.githubusercontent.com/2114189/235055703-2ba042e0-4db7-4e63-8646-02f390d496b5.png)

![image](https://user-images.githubusercontent.com/2114189/235056310-4f6ffdc2-5758-4927-8fb8-314d9fb72a6b.png)

![image](https://user-images.githubusercontent.com/2114189/235058400-dab1c9ec-3325-4671-8345-aee6b0b68042.png)

![image](https://user-images.githubusercontent.com/2114189/235058424-85509532-b9bc-43ad-b00f-a87184c60f22.png)

</details>

17 months agoImprove protected branch setting page (#24379)
Hester Gong [Sat, 29 Apr 2023 10:44:52 +0000 (18:44 +0800)]
Improve protected branch setting page (#24379)

Main changes:

1. Change html structure of protected branch page, use [`grouped
fields`](https://fomantic-ui.com/collections/form.html#grouped-fields)
instead of `fields` for better margin, and wrap `grouped fields` around
related `field`s, remove unnecessary `<div id="protection_box"
class="fields">` outer div

2. Changed some order of field to make them more categorized, used `ui
dividing header` for categorization and fine tune css.

Before:

<img width="1907" alt="Screen Shot 2023-04-27 at 14 56 19"
src="https://user-images.githubusercontent.com/17645053/234783731-bce8a7ce-dfc9-4d47-a3a8-b962ebea9467.png">
<img width="1849" alt="Screen Shot 2023-04-27 at 14 56 30"
src="https://user-images.githubusercontent.com/17645053/234783740-c47d314e-5e2d-4854-98fd-c88f85ef3584.png">
<img width="1872" alt="Screen Shot 2023-04-27 at 14 56 36"
src="https://user-images.githubusercontent.com/17645053/234783745-18e35a75-07e8-451d-b001-f9bcf16fcab5.png">

After:

https://user-images.githubusercontent.com/17645053/235114568-da010aad-7654-4410-ab8c-5d0fce7edadb.mov

3. Changed "Enable Merge Whitelist" to radio checkbox, and added "Enable
Merge" radio checkbox, which are exclusive

Before:

<img width="926" alt="Screen Shot 2023-04-28 at 13 08 29"
src="https://user-images.githubusercontent.com/17645053/235059233-75790f7a-e5ea-4e1c-82c6-509fef8b84b3.png">

After:

<img width="942" alt="Screen Shot 2023-04-28 at 13 09 28"
src="https://user-images.githubusercontent.com/17645053/235059367-852d1f61-8407-4126-8c79-315b9c1ffada.png">

4. Add a link to set default branch on branch list page (with reference
to github)

https://user-images.githubusercontent.com/17645053/234787404-61c1c7b6-aabf-429f-a109-5b690e4e0b5a.mov

5. Removed dead codes.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoSkip known flaky `queue` tests on CI environment (#24419)
silverwind [Sat, 29 Apr 2023 09:53:11 +0000 (11:53 +0200)]
Skip known flaky `queue` tests on CI environment (#24419)

Random CI failures are annoying. It's better to just skip the affected
tests so maintainers can use their valuable time for more productive
topics.

Related: https://github.com/go-gitea/gitea/issues/23608
Related: https://github.com/go-gitea/gitea/issues/23977
Related: https://github.com/go-gitea/gitea/issues/18703

17 months agogetting the tag list does not require being signed in (#24413)
Earl Warren [Sat, 29 Apr 2023 04:40:55 +0000 (06:40 +0200)]
getting the tag list does not require being signed in (#24413)

Fixes: https://codeberg.org/forgejo/forgejo/issues/681
17 months agoAdd integration test for API raw content reference formats (#24388)
6543 [Sat, 29 Apr 2023 02:38:22 +0000 (04:38 +0200)]
Add integration test for API raw content reference formats (#24388)

This pull request adds an integration test to validate the behavior of
raw content API's reference handling for all supported formats .

close  #24242

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 29 Apr 2023 00:23:39 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoRevert "Add Debian package registry" (#24412)
Yarden Shoham [Fri, 28 Apr 2023 22:06:41 +0000 (01:06 +0300)]
Revert "Add Debian package registry" (#24412)

Reverts go-gitea/gitea#22854

17 months agoAdd Debian package registry (#22854)
KN4CK3R [Fri, 28 Apr 2023 21:51:36 +0000 (23:51 +0200)]
Add Debian package registry (#22854)

Co-authored-by: @awkwardbunny
This PR adds a Debian package registry. You can follow [this
tutorial](https://www.baeldung.com/linux/create-debian-package) to build
a *.deb package for testing. Source packages are not supported at the
moment and I did not find documentation of the architecture "all" and
how these packages should be treated.

---------

Co-authored-by: Brian Hong <brian@hongs.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
17 months agoMake repo size style matches others (commits/branches/tags) (#24408)
wxiaoguang [Fri, 28 Apr 2023 21:23:19 +0000 (05:23 +0800)]
Make repo size style matches others (commits/branches/tags) (#24408)

The "unit" part shouldn't have bold style.

17 months agoOverride alias template to preserve anchor fragment (#24394)
John Olheiser [Fri, 28 Apr 2023 20:51:17 +0000 (15:51 -0500)]
Override alias template to preserve anchor fragment (#24394)

This PR fixes an annoyance where docs aliases aren't preserving their
anchor fragments.

The refactor included aliases to keep old links from dying, but
currently they redirect without their anchor, which was used _often_ to
jump to sections.

This overrides the alias template with an alternative that preserves the
anchor fragment.

To note, this is just a copy of the [embedded
template](https://github.com/gohugoio/hugo/blob/5c7b79cf7f00aa2651dd5f0364ee575af6715a31/tpl/tplimpl/embedded/templates/alias.html),
but defaults to a JS redirect that preserves the anchor, and uses the
meta tag as a fallback for noscript users.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
17 months agoChangelog 1.19.2 (#24365) (#24403)
Yarden Shoham [Fri, 28 Apr 2023 19:20:52 +0000 (22:20 +0300)]
Changelog 1.19.2 (#24365) (#24403)

Frontport #24365

Add changelog for 1.19.2

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImprove commit date in commit graph (#24399)
yp05327 [Fri, 28 Apr 2023 18:58:59 +0000 (03:58 +0900)]
Improve commit date in commit graph (#24399)

The commit date time is based on server's time zone not user's local
time zone.

Before:

![image](https://user-images.githubusercontent.com/18380374/235074112-cc1e032f-6b43-4876-a1bc-dd48b393866b.png)

After:

![image](https://user-images.githubusercontent.com/18380374/235074056-329811e8-3e81-4b55-b5a1-580ac22b6d72.png)

17 months agoFix unclear `IsRepositoryExist` logic (#24374)
wxiaoguang [Fri, 28 Apr 2023 18:14:26 +0000 (02:14 +0800)]
Fix unclear `IsRepositoryExist` logic (#24374)

There was only one `IsRepositoryExist` function, it did: `has && isDir`

However it's not right, and it would cause 500 error when creating a new
repository if the dir exists.

Then, it was changed to `has || isDir`, it is still incorrect, it
affects the "adopt repo" logic.

To make the logic clear:

* IsRepositoryModelOrDirExist
* IsRepositoryModelExist

17 months agoEnsure final newline in `assets/go-licenses.json` (#24407)
silverwind [Fri, 28 Apr 2023 17:39:18 +0000 (19:39 +0200)]
Ensure final newline in `assets/go-licenses.json` (#24407)

This will ensure that the file always has a final newline. I'm not sure
where this bug with inconsistent final newline actually comes from, it
is likely Windows-related.

---------

Co-authored-by: delvh <dev.lh@web.de>
17 months agoMore detailed branch delete message (#22696)
Maarten Becker [Fri, 28 Apr 2023 06:32:32 +0000 (08:32 +0200)]
More detailed branch delete message (#22696)

Fix #22624 . Message explains that deleted branch can only be restored for a short time period.

17 months agoRefactor docs (#23752)
John Olheiser [Fri, 28 Apr 2023 03:33:41 +0000 (22:33 -0500)]
Refactor docs (#23752)

This was intended to be a small followup for
https://github.com/go-gitea/gitea/pull/23712, but...here we are.

1. Our docs currently use `slug` as the entire URL, which makes
refactoring tricky (see https://github.com/go-gitea/gitea/pull/23712).
Instead, this PR attempts to make future refactoring easier by using
slugs as an extension of the section. (Hugo terminology)
- What the above boils down to is this PR attempts to use directory
organization as URL management. e.g. `usage/comparison.en-us.md` ->
`en-us/usage/comparison/`, `usage/packages/overview.en-us.md` ->
`en-us/usage/packages/overview/`
- Technically we could even remove `slug`, as Hugo defaults to using
filename, however at least with this PR it means `slug` only needs to be
the name for the **current file** rather than an entire URL
2. This PR adds appropriate aliases (redirects) for pages, so anything
on the internet that links to our docs should hopefully not break.
3. A minor nit I've had for a while, renaming `seek-help` to `support`.
It's a minor thing, but `seek-help` has a strange connotation to it.
4. The commits are split such that you can review the first which is the
"actual" change, and the second is added redirects so that the first
doesn't break links elsewhere.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
17 months agoFix layouts of admin table / adapt repo / email test (#24370)
wxiaoguang [Fri, 28 Apr 2023 01:48:41 +0000 (09:48 +0800)]
Fix layouts of admin table / adapt repo / email test  (#24370)

Ref:
https://github.com/go-gitea/gitea/pull/24315#pullrequestreview-1403034993

And fix the incorrect layout for "dasbboard", the "form" shouldn't
follow `<h4 class="ui top attached header">`, so move it to inner.

Diff with ignoring spaces:
https://github.com/go-gitea/gitea/pull/24370/files?diff=unified&w=1

A known bug: the adapt/delete button doesn't work due to a historical
messy logic, will fix it in next PR (#24374)

![image](https://user-images.githubusercontent.com/2114189/234754656-d160b098-b8d4-4783-962a-27d5c764863c.png)

![image](https://user-images.githubusercontent.com/2114189/234762327-3e77e2e4-a156-4498-8a8b-092e14cf9204.png)

![image](https://user-images.githubusercontent.com/2114189/234767811-74b7272c-e40c-4850-8e3c-499e3b53b827.png)

![image](https://user-images.githubusercontent.com/2114189/234761247-e6aad889-dcad-443c-948f-2d44df68725b.png)

17 months agoMove secrets and runners settings to actions settings (#24200)
Hester Gong [Fri, 28 Apr 2023 00:08:47 +0000 (08:08 +0800)]
Move secrets and runners settings to actions settings (#24200)

This PR moves the secrets and runners settings to actions settings on
all settings(repo,org,user,admin) levels.

After this PR, if
[ENABLED](https://github.com/go-gitea/gitea/blob/5e7543fcf441afb30aba6188edac754ef32b9ac3/custom/conf/app.example.ini#L2604)
inside `app.ini` under `[actions]` is set to `false`, the "Actions" tab
(including runners management and secrets management) will not be shown.

After, the settings under actions settings for each level:

1. Admin Level
"Runners Management"
<img width="1437" alt="Screen Shot 2023-04-26 at 14 34 20"
src="https://user-images.githubusercontent.com/17645053/234489731-15822d21-38e1-4560-8bbe-69f122376abc.png">

2. User Level
"Secrets Management"
<img width="1427" alt="Screen Shot 2023-04-26 at 14 34 30"
src="https://user-images.githubusercontent.com/17645053/234489795-68c9c0cb-24f8-4f09-95c6-458ab914c313.png">

3. Repo and Organization Levels
"Runners Management" and "Secrets Management"
   Org:
<img width="1437" alt="Screen Shot 2023-04-26 at 14 35 07"
src="https://user-images.githubusercontent.com/17645053/234489996-f3af5ebb-d354-46ca-9087-a0b586845281.png">

<img width="1433" alt="Screen Shot 2023-04-26 at 14 35 14"
src="https://user-images.githubusercontent.com/17645053/234490004-3abf8fed-81fd-4ce2-837a-935dade1793d.png">

    Repo:
<img width="1419" alt="Screen Shot 2023-04-26 at 14 34 50"
src="https://user-images.githubusercontent.com/17645053/234489904-80c11038-4b58-462c-9d0b-8b7cf70bc2b3.png">

<img width="1430" alt="Screen Shot 2023-04-26 at 14 34 57"
src="https://user-images.githubusercontent.com/17645053/234489918-4e8d1fe2-9bcd-4d8a-96c1-238a8088d92e.png">

It also finished these tasks :

- [x] rename routers function "runners" to "actions", and refactor
related file names
- [x] check and modify part of the runners related functions to match
their name
- [x] Fix backend check caused by fmt check

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoGitea Actions add `base_ref`, `head_ref`, `api_url`, `ref_type` fields (#24356)
ChristopherHX [Thu, 27 Apr 2023 23:35:21 +0000 (01:35 +0200)]
Gitea Actions add `base_ref`, `head_ref`, `api_url`, `ref_type` fields (#24356)

As discussed in https://gitea.com/gitea/act_runner/issues/147
`github.base_ref` is empty.
This change adds these fields to the server side context data.

17 months agoFix auth check bug (#24382)
Lunny Xiao [Thu, 27 Apr 2023 20:43:27 +0000 (04:43 +0800)]
Fix auth check bug (#24382)

Fix https://github.com/go-gitea/gitea/pull/24362/files#r1179095324

`getAuthenticatedMeta` has checked them, these code are duplicated one.
And the first invokation has a wrong permission check. `DownloadHandle`
should require read permission but not write.

17 months agoDisplay 'Unknown' when runner.version is empty (#24378)
yp05327 [Thu, 27 Apr 2023 08:44:38 +0000 (17:44 +0900)]
Display 'Unknown' when runner.version is empty (#24378)

Before:

![image](https://user-images.githubusercontent.com/18380374/234782197-43d8f86d-afe2-4626-8e46-b621d7cde8f9.png)
After:

![image](https://user-images.githubusercontent.com/18380374/234782064-6828ae3b-5957-451f-82bb-22ab60b6c2a8.png)

17 months agoFix incorrect last online time in runner_edit.tmpl (#24376)
yp05327 [Thu, 27 Apr 2023 07:56:49 +0000 (16:56 +0900)]
Fix incorrect last online time in runner_edit.tmpl (#24376)

Before:

![image](https://user-images.githubusercontent.com/18380374/234772748-7f4b416f-4056-4a5e-89f0-727d2fa14a41.png)

After:

![image](https://user-images.githubusercontent.com/18380374/234772682-8b076054-d0be-4f5f-892d-8d0427275493.png)

17 months agoRefactor "route" related code, fix Safari cookie bug (#24330)
wxiaoguang [Thu, 27 Apr 2023 06:06:45 +0000 (14:06 +0800)]
Refactor "route" related code, fix Safari cookie bug (#24330)

Fix #24176

Clean some misuses of route package, clean some legacy FIXMEs

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd custom helm repo name generated from url (#24363)
Vladimir Smagin [Thu, 27 Apr 2023 05:40:00 +0000 (12:40 +0700)]
Add custom helm repo name generated from url (#24363)

Fresh version of "Add custom helm repo name generated from url #21024"
https://github.com/go-gitea/gitea/pull/21024

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd API for gitignore templates (#22783)
JakobDev [Thu, 27 Apr 2023 03:51:20 +0000 (05:51 +0200)]
Add API for gitignore templates (#22783)

This implements the [Gitignores template API of GitHub](https://docs.github.com/en/rest/gitignore?apiVersion=2022-11-28) in Gitea

17 months agoAdd eslint-plugin-regexp (#24361)
silverwind [Thu, 27 Apr 2023 02:08:16 +0000 (04:08 +0200)]
Add eslint-plugin-regexp (#24361)

Add
[`eslint-plugin-regexp`](https://github.com/ota-meshi/eslint-plugin-regexp)
and fix discovered issues. Config is mostly the recommended one, but I
relaxed a few rules.

17 months agoSupport uploading file to empty repo by API (#24357)
wxiaoguang [Thu, 27 Apr 2023 01:36:26 +0000 (09:36 +0800)]
Support uploading file to empty repo by API (#24357)

The uploading API already works (the only nit is the the IsEmpty flag is
out-of-sync, this PR also fixes it)

Close #14633

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 27 Apr 2023 01:07:47 +0000 (01:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoRequire repo scope for PATs for private repos and basic authentication (#24362)
John Olheiser [Thu, 27 Apr 2023 00:24:03 +0000 (19:24 -0500)]
Require repo scope for PATs for private repos and basic authentication (#24362)

> The scoped token PR just checked all API routes but in fact, some web
routes like `LFS`, git `HTTP`, container, and attachments supports basic
auth. This PR added scoped token check for them.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
17 months agoAlert error message if open dependencies are included in the issues that try to batch...
sillyguodong [Wed, 26 Apr 2023 16:54:17 +0000 (00:54 +0800)]
Alert error message if open dependencies are included in the issues that try to batch close (#24329)

fix #24185

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoFix 404 error when leaving the last private org team (#24322)
yp05327 [Wed, 26 Apr 2023 16:27:46 +0000 (01:27 +0900)]
Fix 404 error when leaving the last private org team (#24322)

If the user only belongs to one org team and the org is private,
leaving the org team will redirect to `ctx.Org.OrgLink + "/teams/"`
which is inaccessible.

So we need to check whether the user still belongs to the org.

17 months agoModify width of ui container, fine tune css for settings pages and org header (#24315)
Hester Gong [Wed, 26 Apr 2023 15:59:08 +0000 (23:59 +0800)]
Modify width of ui container, fine tune css for settings pages and org header (#24315)

Close #24302
Part of #24229, Follows #24246
This PR focused on CSS style fine-tune, main changes:

1. Give `.ui.ui.ui.container` a width of `1280px` with a max-width of
`calc(100vw - 64px)`, so the main contents looks better on large
devices.

2. Share styles for table elements in all levels settings pages to fix
overflow of runners table on mobile and for consistency (The headers on
mobile can be further improved, but haven't found a proper way yet).

3. Use [stackable
grid](https://fomantic-ui.com/collections/grid.html#stackable) and
[device column width](https://fomantic-ui.com/examples/responsive.html)
for responsiveness for some pages (repo/org collaborators settings
pages, org teams related page)

4. Fixed #24302 by sharing label related CSS in reporg.css

5. Fine tune repo tags settings page

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoAdd .livemd as a markdown extension (#22730)
contra-bit [Wed, 26 Apr 2023 15:22:54 +0000 (17:22 +0200)]
Add .livemd as a markdown extension (#22730)

## Needs and benefits
[Livebook](https://livebook.dev/) notebooks are used for code
documentation and for deep dives and note-taking in the elixir
ecosystem. Rendering these in these as Markdown on frogejo has many
benefits, since livemd is a subset of markdown. Some of the benefits
are:
- New users of elixir and livebook are scared by unformated .livemd
files, but are shown what they expect
- Sharing a notebook is as easy as sharing a link, no need to install
the software in order to see the results.

[goldmark-meraid ](https://github.com/abhinav/goldmark-mermaid) is a
mermaid-js parser already included in gitea. This makes the .livemd
rendering integration feature complete. With this PR class diagrams, ER
Diagrams, flow charts and much more will be rendered perfectly.

With the additional functionality gitea will be an ideal tool for
sharing resources with fellow software engineers working in the elixir
ecosystem. Allowing the git forge to be used without needing to install
any software.

## Feature Description
This issue requests the .livemd extension to be added as a Markdown
language extension.

- `.livemd` is the extension of Livebook which is an Elixir version of
Jupyter Notebook.
- `.livemd` is` a subset of Markdown.

This would require the .livemd to be recognized as a markdown file. The
Goldmark the markdown parser should handle the parsing and rendering
automatically.

Here is the corresponding commit for GitHub linguist:
https://github.com/github/linguist/pull/5672

Here is a sample page of a livemd file:

https://github.com/github/linguist/blob/master/samples/Markdown/livebook.livemd

## Screenshots

The first screenshot shows how github shows the sample .livemd in the
browser.
The second screenshot shows how mermaid js, renders my development
notebook and its corresponding ER Diagram. The source code can be found
here:
https://codeberg.org/lgh/Termi/src/commit/79615f74281789a1f2967b57bad0c67c356cef1f/termiNotes.livemd

## Testing
I just changed the file extension from `.livemd`to `.md`and the document
already renders perfectly on codeberg. Check you can it out
[here](https://codeberg.org/lgh/Termi/src/branch/livemd2md/termiNotes.md)

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
17 months agoDisplay when a repo was archived (#22664)
JakobDev [Wed, 26 Apr 2023 14:46:26 +0000 (16:46 +0200)]
Display when a repo was archived (#22664)

This adds the date a repo is archived to Gitea and shows it in the UI
and API. A feature, that GitHub has been [introduced
recently](https://github.blog/changelog/2022-11-23-repository-archive-date-now-shown-in-ui/).

I currently don't know how to correctly deal with the Date in the
template, as different languages have different ways of writing a date.

![grafik](https://user-images.githubusercontent.com/15185051/234315187-7db5763e-d96e-4080-b894-9be178bfb6e1.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>