]> source.dussan.org Git - gitea.git/log
gitea.git
17 months agoFix runner button height (#24338)
silverwind [Wed, 26 Apr 2023 04:09:29 +0000 (06:09 +0200)]
Fix runner button height (#24338)

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

Set size class and downsize any such buttons that have a dropdown icon
because the dropdown icon increases button height artificially.

[`:has()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:has) is not
supported in Firefox yet, but works fine with the experimental pref
enabled. I see this as a graceful degradation in unsupporting browsers.

17 months agoFix broken clone script on an empty archived repo (#24339)
Yarden Shoham [Wed, 26 Apr 2023 03:28:37 +0000 (06:28 +0300)]
Fix broken clone script on an empty archived repo (#24339)

I made it render the script even if the repo is archived

- Fixes #24324

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoImprove RSS (#24335)
wxiaoguang [Wed, 26 Apr 2023 02:53:44 +0000 (10:53 +0800)]
Improve RSS (#24335)

Follow  #22719

### Major changes

1. `ServerError` doesn't do format, so remove the `%s`
2. Simplify `RenderBranchFeed` (slightly)
3. Remove unused `BranchFeedRSS`
4. Make `feed.RenderBranchFeed` respect `EnableFeed` config
5. Make `RepoBranchTagSelector.vue` respect `EnableFeed` setting,
otherwise there is always RSS icon
6. The `(branchURLPrefix + item.url).replace('src', 'rss')` doesn't seem
right for all cases, for example, the string `src` could appear in
`branchURLPrefix`, so we need a separate `rssURLPrefix`
7. The `<a>` in Vue menu needs `@click.stop`, otherwise the menu itself
would be triggered at the same time
8. Change `<a><button></button></a>` to `<a role=button>`
9. Use `{{PathEscapeSegments .TreePath}}` instead of `{{range $i, $v :=
.TreeNames}}/{{$v}}{{end}}`

Screenshot of changed parts:

<details>

![image](https://user-images.githubusercontent.com/2114189/234315538-66603694-9093-48a8-af33-83575fd7a018.png)

![image](https://user-images.githubusercontent.com/2114189/234315786-f1efa60b-012e-490b-8ce2-d448dc6fe5c9.png)

![image](https://user-images.githubusercontent.com/2114189/234334941-446941bc-1baa-4256-8850-ccc439476cda.png)

</details>

### Other thoughts

Should we remove the RSS icon from the branch dropdown list? It seems
too complex for a list UI, and users already have the chance to get the
RSS feed URL from "branches" page.

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoAutomatically select the org when click create repo from org dashboard (#24325)
yp05327 [Wed, 26 Apr 2023 02:25:29 +0000 (11:25 +0900)]
Automatically select the org when click create repo from org dashboard (#24325)

![image](https://user-images.githubusercontent.com/18380374/234209941-d661b07f-e963-427b-a673-78c46043a792.png)

In org dashboard, the create repo link will be `repo/create?org={orgId}`

17 months agoon schedule
techknowlogick [Wed, 26 Apr 2023 01:38:49 +0000 (21:38 -0400)]
on schedule

17 months agoon schedule
techknowlogick [Wed, 26 Apr 2023 01:38:33 +0000 (21:38 -0400)]
on schedule

17 months agoswitch to use Actions from drone for cron (#24314)
techknowlogick [Wed, 26 Apr 2023 01:32:49 +0000 (21:32 -0400)]
switch to use Actions from drone for cron (#24314)

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

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 26 Apr 2023 00:07:58 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoRestore bold on repolist (#24337)
silverwind [Tue, 25 Apr 2023 21:19:22 +0000 (23:19 +0200)]
Restore bold on repolist (#24337)

Looking at it again, it does look a bit "odd" without bold, so revert
the repolist change done in
https://github.com/go-gitea/gitea/pull/24307.

<img width="141" alt="image"
src="https://user-images.githubusercontent.com/115237/234331813-c6e2402f-e099-43b3-aed6-46a0e24e3899.png">

17 months agoFix template function DateTime (#24317)
wxiaoguang [Tue, 25 Apr 2023 19:48:30 +0000 (03:48 +0800)]
Fix template function DateTime (#24317)

Before, 500 error

![image](https://user-images.githubusercontent.com/2114189/234170176-403ffd1b-ec27-42be-bff9-86184dc8d74d.png)

17 months agoFix incorrect CORS response in Http Git handler (#24303)
wxiaoguang [Tue, 25 Apr 2023 18:35:50 +0000 (02:35 +0800)]
Fix incorrect CORS response in Http Git handler (#24303)

Use the general `cors.Handler` for CORS

17 months agoUpdated upgrade script that is informing user that Gitea service has to be running...
TATHAGATA ROY [Tue, 25 Apr 2023 17:19:58 +0000 (22:49 +0530)]
Updated upgrade script that is informing user that Gitea service has to be running in order to upgrade it (#24260)

Hello sir,
This pull request solves issue #23949
I have updated the upgrade script such that it will check if the Gitea
service is running, if it's not running then it will exit the process
and if it's running then the process will move further ahead.
Thank You.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoAdd tags list for repos whose release setting is disabled (#23465)
Zettat123 [Tue, 25 Apr 2023 16:29:00 +0000 (00:29 +0800)]
Add tags list for repos whose release setting is disabled (#23465)

Close #23427

Co-Author: @wxiaoguang

If a repo's release setting is enabled, the logic has't changed.
Clicking the "Tags" button will jump to `/{user}/{repo}/tags` and
`templates/repo/release/list.tmpl` template will be used.

<img
src="https://user-images.githubusercontent.com/15528715/224939362-bd8974fd-08b0-4f79-a114-3389d15847ca.png"
width="600px" />

If the release setting is disabled, clicking the "Tags" button will
still jump to `/{user}/{repo}/tags` but a new template
`templates/repo/tag/list.tmpl` will be used.

<img
src="https://user-images.githubusercontent.com/15528715/233834564-74741e49-f4e9-47c8-ac12-e306642798dc.png"
width="600px" />

Since both templates above need to render the tags list, I moved the
tags list to a shared template located in
`templates/repo/tag/table.tmpl`.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRefactor config provider (#24245)
Lunny Xiao [Tue, 25 Apr 2023 15:06:39 +0000 (23:06 +0800)]
Refactor config provider (#24245)

This PR introduces more abstract about `ConfigProvider` and hides more `ini` references.

---------

Co-authored-by: delvh <dev.lh@web.de>
17 months agoAdd RSS Feeds for branches and files (#22719)
jladbrook [Tue, 25 Apr 2023 14:08:29 +0000 (15:08 +0100)]
Add RSS Feeds for branches and files (#22719)

Fix #22228 adding RSS feeds for branches and files.

RSS feeds are accessed through:

* [gitea]/src/branch/{branch}.rss
* [gitea]/src/branch/{branch}/{file_name}.rss

No changes have been made to the UI to expose the feed urls for branches
and files.

17 months agoMake SVG in dropdown menu have the same margin-right as IMG (#24316)
wxiaoguang [Tue, 25 Apr 2023 11:34:37 +0000 (19:34 +0800)]
Make SVG in dropdown menu have the same margin-right as IMG (#24316)

Fix #24226

![image](https://user-images.githubusercontent.com/2114189/234167393-0fe36a0d-29c9-46b6-b71d-52436f2b27f3.png)

Co-authored-by: silverwind <me@silverwind.io>
17 months agoRespect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (#24035)
Gary Moon [Tue, 25 Apr 2023 06:40:48 +0000 (02:40 -0400)]
Respect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (#24035)

This change prevents Gitea from bypassing the manual approval process
for newly registered users when OIDC is used.

- Resolves https://github.com/go-gitea/gitea/issues/23392

Signed-off-by: Gary Moon <gary@garymoon.net>
17 months agodefault show closed actions list if all actions was closed (#24234)
a1012112796 [Tue, 25 Apr 2023 03:34:16 +0000 (11:34 +0800)]
default show closed actions list if all actions was closed (#24234)

that's the same with issues and pull list

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 25 Apr 2023 00:07:53 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoupdate nightly drone docker tag (#24311)
techknowlogick [Mon, 24 Apr 2023 21:59:57 +0000 (17:59 -0400)]
update nightly drone docker tag (#24311)

17 months agoRemove org users who belong to no teams (#24247)
yp05327 [Mon, 24 Apr 2023 19:52:38 +0000 (04:52 +0900)]
Remove org users who belong to no teams (#24247)

Fix #24128

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix typo in API route (#24310)
silverwind [Mon, 24 Apr 2023 18:44:27 +0000 (20:44 +0200)]
Fix typo in API route (#24310)

Continuation of https://github.com/go-gitea/gitea/pull/23995

---------

Co-authored-by: bilogic <946010+bilogic@users.noreply.github.com>
17 months agoAdd --font-weight-bold and set previous bold to 601 (#24307) 23995/head
wxiaoguang [Mon, 24 Apr 2023 17:46:00 +0000 (01:46 +0800)]
Add --font-weight-bold and set previous bold to 601 (#24307)

Fix #24305

According to MDN, "bold" starts from 700, some fonts do not provide
"bolding" for weight 600

https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoMark `/templates/swagger/v1_json.tmpl` as generated file (#24306)
JakobDev [Mon, 24 Apr 2023 17:18:24 +0000 (19:18 +0200)]
Mark `/templates/swagger/v1_json.tmpl` as generated file (#24306)

17 months agoImprove External Wiki in Repo Header (#24304)
JakobDev [Mon, 24 Apr 2023 16:28:37 +0000 (18:28 +0200)]
Improve External Wiki in Repo Header (#24304)

If you use a External Wiki, with Gitea, it brings currently 2 Problems
in the Header:

1. It always uses the Wiki Icon. When you use e.g. a External Issue
Tracker, it shows the External Link icon to Indicate, that the User will
send to a External Side. This helps preventing fishing.
2. If you use a External Wiki, the Link in the Header still goes to
`{repo}/wiki` which will redirect the user to the External Wiki. That
means, that if the users hovers with the Cursor over the link, it shows
`{repo}/wiki`, so the User does not know, where he will land.

This PR fixes both.

![grafik](https://user-images.githubusercontent.com/15185051/233964455-dbca9bbe-a224-44c5-b351-5649fd9b15fc.png)

17 months agoUnify nightly naming across binaries and docker images (#24116)
techknowlogick [Mon, 24 Apr 2023 15:43:19 +0000 (11:43 -0400)]
Unify nightly naming across binaries and docker images (#24116)

Proposal found here: https://github.com/go-gitea/gitea/issues/23654

TODO: make non-breaking (can we publish docker image using dev and
nightly prefix? at same time). if anyone has advice please comment :)

If this PR is merged, then I can add redirects to the downloads site.

17 months agoWrap too long push mirror addresses (#21120)
JakobDev [Mon, 24 Apr 2023 14:29:16 +0000 (16:29 +0200)]
Wrap too long push mirror addresses (#21120)

I noticed that it is possible to break the push mirror list by entering
a too long URL. This should fix it.

| Before         | After     |
|--------------|-----------|

|![Before](https://user-images.githubusercontent.com/15185051/189294585-333965d1-0f0f-48e2-96d5-e04b84b55ae3.png)|![After](https://user-images.githubusercontent.com/15185051/189294619-301e271c-b89b-4bc0-9c11-9536bd0302be.png)|

17 months agoImprove some modal action buttons (#24289)
wxiaoguang [Mon, 24 Apr 2023 11:08:59 +0000 (19:08 +0800)]
Improve some modal action buttons (#24289)

Follow #24097 and #24285

And add a devtest page for modal action button testing.
http://localhost:3000/devtest/fomantic-modal

Now the `modal_actions_confirm.tmpl` could support: green / blue /
yellow positive buttons, the negative button is "secondary".

ps: this PR is only a small improvement, there are still a lot of
buttons not having proper colors. In the future these buttons could be
improved by this approach.

These buttons could also be improved according to the conclusion of
#24285 in the future.

![image](https://user-images.githubusercontent.com/2114189/233847773-a6d6b29b-7b5c-490e-8425-40dfd0ad2529.png)

And add GitHub-like single danger button (context:
https://github.com/go-gitea/gitea/issues/24285#issuecomment-1519100312)

![image](https://user-images.githubusercontent.com/2114189/233891566-055d7611-894d-4d5a-baf5-f6369180bf8d.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoEnable forbidigo linter (#24278)
silverwind [Mon, 24 Apr 2023 09:50:58 +0000 (11:50 +0200)]
Enable forbidigo linter (#24278)

Enable [forbidigo](https://github.com/ashanbrown/forbidigo) linter which
forbids print statements. Will check how to integrate this with the
smallest impact possible, so a few `nolint` comments will likely be
required. Plan is to just go through the issues and either:

- Remove the print if it is nonsensical
- Add a `//nolint` directive if it makes sense

I don't plan on investigating the individual issues any further.

<details>
<summary>Initial Lint Results</summary>

```
modules/log/event.go:348:6: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(err)

^

modules/log/event.go:382:6: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(err)

^

modules/queue/unique_queue_disk_channel_test.go:20:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("TempDir %s\n", tmpDir)

^

contrib/backport/backport.go:168:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* Backporting %s to %s as %s\n", pr, localReleaseBranch, backportBranch)

^

contrib/backport/backport.go:216:4: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* Navigate to %s to open PR\n", url)

^

contrib/backport/backport.go:223:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* `xdg-open %s`\n", url)

^

contrib/backport/backport.go:233:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* `git push -u %s %s`\n", remote, backportBranch)

^

contrib/backport/backport.go:243:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* Amending commit to prepend `Backport #%s` to body\n", pr)

^

contrib/backport/backport.go:272:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("* Attempting git cherry-pick --continue")

^

contrib/backport/backport.go:281:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* Attempting git cherry-pick %s\n", sha)

^

contrib/backport/backport.go:297:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* Current branch is %s\n", currentBranch)

^

contrib/backport/backport.go:299:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* Current branch is %s - not checking out\n", currentBranch)

^

contrib/backport/backport.go:304:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* Branch %s already exists. Checking it out...\n", backportBranch)

^

contrib/backport/backport.go:308:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* `git checkout -b %s %s`\n", backportBranch, releaseBranch)

^

contrib/backport/backport.go:313:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* `git fetch %s main`\n", remote)

^

contrib/backport/backport.go:316:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(string(out))

^

contrib/backport/backport.go:319:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(string(out))

^

contrib/backport/backport.go:321:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("* `git fetch %s %s`\n", remote, releaseBranch)

^

contrib/backport/backport.go:324:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(string(out))

^

contrib/backport/backport.go:327:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(string(out))

^

models/unittest/fixtures.go:50:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("Unsupported RDBMS for integration tests")

^

models/unittest/fixtures.go:89:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("LoadFixtures failed after retries: %v\n", err)

^

models/unittest/fixtures.go:110:4: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Failed to generate sequence update: %v\n", err)

^

models/unittest/fixtures.go:117:6: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Failed to update sequence: %s Error: %v\n", value, err)

^

models/migrations/base/tests.go:118:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("Environment variable $GITEA_ROOT not set")

^

models/migrations/base/tests.go:127:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Could not find gitea binary at %s\n", setting.AppPath)

^

models/migrations/base/tests.go:134:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Environment variable $GITEA_CONF not set - defaulting to %s\n", giteaConf)

^

models/migrations/base/tests.go:145:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Unable to create temporary data path %v\n", err)

^

models/migrations/base/tests.go:154:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Unable to InitFull: %v\n", err)

^

models/migrations/v1_11/v112.go:34:5: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Error: %v", err)

^

contrib/fixtures/fixture_generation.go:36:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("CreateTestEngine: %+v", err)

^

contrib/fixtures/fixture_generation.go:40:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("PrepareTestDatabase: %+v\n", err)

^

contrib/fixtures/fixture_generation.go:46:5: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("generate '%s': %+v\n", r, err)

^

contrib/fixtures/fixture_generation.go:53:5: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("generate '%s': %+v\n", g.name, err)

^

contrib/fixtures/fixture_generation.go:71:4: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s created.\n", path)

^

services/gitdiff/gitdiff_test.go:543:2: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println(result)

^

services/gitdiff/gitdiff_test.go:560:2: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println(result)

^

services/gitdiff/gitdiff_test.go:577:2: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println(result)

^

modules/web/routing/logger_manager.go:34:2: use of `print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

print Printer

^

modules/doctor/paths.go:109:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Warning: can't remove temporary file: '%s'\n", tmpFile.Name())

^

tests/test_utils.go:33:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf(format+"\n", args...)

^

tests/test_utils.go:61:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Environment variable $GITEA_CONF not set, use default: %s\n", giteaConf)

^

cmd/actions.go:54:9: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

_, _ = fmt.Printf("%s\n", respText)

       ^

cmd/admin_user_change_password.go:74:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s's password has been successfully updated!\n", user.Name)

^

cmd/admin_user_create.go:109:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("generated random password is '%s'\n", password)

^

cmd/admin_user_create.go:164:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Access token was successfully created... %s\n", t.Token)

^

cmd/admin_user_create.go:167:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("New user '%s' has been successfully created!\n", username)

^

cmd/admin_user_generate_access_token.go:74:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s\n", t.Token)

^

cmd/admin_user_generate_access_token.go:76:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Access token was successfully created: %s\n", t.Token)

^

cmd/admin_user_must_change_password.go:56:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Updated %d users setting MustChangePassword to %t\n", n, mustChangePassword)

^

cmd/convert.go:44:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("Converted successfully, please confirm your database's character set is now utf8mb4")

^

cmd/convert.go:50:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("Converted successfully, please confirm your database's all columns character is NVARCHAR now")

^

cmd/convert.go:52:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("This command can only be used with a MySQL or MSSQL database")

^

cmd/doctor.go:104:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(err)

^

cmd/doctor.go:105:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("Check if you are using the right config file. You can use a --config directive to specify one.")

^

cmd/doctor.go:243:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(err)

^

cmd/embedded.go:154:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(a.path)

^

cmd/embedded.go:198:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("Using app.ini at", setting.CustomConf)

^

cmd/embedded.go:217:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Extracting to %s:\n", destdir)

^

cmd/embedded.go:253:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s already exists; skipped.\n", dest)

^

cmd/embedded.go:275:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(dest)

^

cmd/generate.go:63:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s", internalToken)

^

cmd/generate.go:66:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("\n")

^

cmd/generate.go:78:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s", JWTSecretBase64)

^

cmd/generate.go:81:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("\n")

^

cmd/generate.go:93:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s", secretKey)

^

cmd/generate.go:96:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("\n")

^

cmd/keys.go:74:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println(strings.TrimSpace(authorizedString))

^

cmd/mailer.go:32:4: use of `fmt.Print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Print("warning: Content is empty")

^

cmd/mailer.go:35:3: use of `fmt.Print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Print("Proceed with sending email? [Y/n] ")

^

cmd/mailer.go:40:4: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Println("The mail was not sent")

^

cmd/mailer.go:49:9: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

_, _ = fmt.Printf("Sent %s email(s) to all users\n", respText)

       ^

cmd/serv.go:147:3: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println("Gitea: SSH has been disabled")

^

cmd/serv.go:153:4: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("error showing subcommand help: %v\n", err)

^

cmd/serv.go:175:4: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Gitea does not provide shell access.")

^

cmd/serv.go:177:4: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println("Hi there! You've successfully authenticated with the principal " + key.Content + ", but Gitea does not provide shell access.")

^

cmd/serv.go:179:4: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")

^

cmd/serv.go:181:3: use of `println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

println("If this is unexpected, please log in with password and setup Gitea under another user.")

^

cmd/serv.go:196:5: use of `fmt.Print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Print(`{"type":"gitea","version":1}`)

^

tests/e2e/e2e_test.go:54:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Error initializing test database: %v\n", err)

^

tests/e2e/e2e_test.go:63:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("util.RemoveAll: %v\n", err)

^

tests/e2e/e2e_test.go:67:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Unable to remove repo indexer: %v\n", err)

^

tests/e2e/e2e_test.go:109:6: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%v", stdout.String())

^

tests/e2e/e2e_test.go:110:6: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%v", stderr.String())

^

tests/e2e/e2e_test.go:113:6: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%v", stdout.String())

^

tests/integration/integration_test.go:124:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Error initializing test database: %v\n", err)

^

tests/integration/integration_test.go:135:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("util.RemoveAll: %v\n", err)

^

tests/integration/integration_test.go:139:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("Unable to remove repo indexer: %v\n", err)

^

tests/integration/repo_test.go:357:4: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

fmt.Printf("%s", resp.Body)

^
```

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix no edit/close/delete button in org repo project view page (#24301)
yp05327 [Mon, 24 Apr 2023 08:51:44 +0000 (17:51 +0900)]
Fix no edit/close/delete button in org repo project view page  (#24301)

Part of #23318.

17 months agoReplace whitespace inside template parens during make fmt (#24293)
silverwind [Mon, 24 Apr 2023 06:48:43 +0000 (08:48 +0200)]
Replace whitespace inside template parens during make fmt (#24293)

Remove space/tab after `(` and before `)` in templates. Only two
violations it seems.

17 months agoUpgrade act (#24298)
Zettat123 [Mon, 24 Apr 2023 04:46:54 +0000 (12:46 +0800)]
Upgrade act  (#24298)

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 24 Apr 2023 00:07:49 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoAdd all `no-query` rules to eslint config (#24294)
silverwind [Sun, 23 Apr 2023 21:50:44 +0000 (23:50 +0200)]
Add all `no-query` rules to eslint config (#24294)

Add rules of the `no-jquery` plugin to the config and enable all non-violating ones.

17 months agoFix bug when deleting wiki with no code write permission (#24274)
Lunny Xiao [Sun, 23 Apr 2023 21:22:16 +0000 (05:22 +0800)]
Fix bug when deleting wiki with no code write permission (#24274)

Fix #24125

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoMove code from module to service (#24287)
KN4CK3R [Sun, 23 Apr 2023 20:44:05 +0000 (22:44 +0200)]
Move code from module to service (#24287)

The code should not be in `modules/` but `services/`.

Reference:
https://github.com/go-gitea/gitea/pull/24257#discussion_r1174578230

17 months agoAdd comments for Manually Merged feature (#24291)
wxiaoguang [Sun, 23 Apr 2023 19:48:51 +0000 (03:48 +0800)]
Add comments for Manually Merged feature (#24291)

In case I would forget it again one day .....

17 months agoAllow using localized absolute date times within phrases with place holders and local...
Yarden Shoham [Sun, 23 Apr 2023 19:12:33 +0000 (22:12 +0300)]
Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275)

This refactors the `shared/datetime/short|long|full` templates into a
template helper function, which allows us to render absolute date times
within translatable phrases.

- Follows #23988
- The first attempt was in #24055
- This should help #22664

Changes:
1. Added the `DateTime` template helper that replaces the
`shared/datetime/short|long|full` templates
2. Used find-and-replace with varying regexes to replace the templates
from step 1 (for example, `\{\{template "shared/datetime/(\S+) \(dict
"Datetime" ([^"]+) "Fallback" ([^\)]+\)?) ?\)?\}\}` -> `{{DateTime "$1
$2 $3}}`)
3. Used the new `DateTime` helper in the issue due date timestamp
rendering

# Before

![image](https://user-images.githubusercontent.com/20454870/233791256-b454c455-aca0-4b76-b300-7866c7bd529e.png)

# After

![image](https://user-images.githubusercontent.com/20454870/233790809-c4913355-2822-4657-bb29-2298deb6d4b3.png)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoHandle canceled workflow as a warning instead of a fail (#24282)
Jason Song [Sun, 23 Apr 2023 18:41:55 +0000 (02:41 +0800)]
Handle canceled workflow as a warning instead of a fail (#24282)

Follow what Drone CI does:

![image](https://user-images.githubusercontent.com/9418365/233829853-d1c30a30-10cc-4b97-a134-793a79d46d85.png)

17 months agoTweak pull request branch delete ui (#23951)
silverwind [Sun, 23 Apr 2023 18:12:36 +0000 (20:12 +0200)]
Tweak pull request branch delete ui (#23951)

- Move delete button to right and remove red color on it.
- Remove CLI instructions when PR has been merged.

Before:

<img width="855" alt="Screenshot 2023-04-06 at 20 21 47"
src="https://user-images.githubusercontent.com/115237/230463178-95735fc0-9632-4d51-bbd5-2131c40186c4.png">

After:

<img width="865" alt="Screenshot 2023-04-06 at 20 23 17"
src="https://user-images.githubusercontent.com/115237/230463347-8155cbf9-4e58-421a-93a8-56ce6188dab8.png">

After (deleted):

<img width="860" alt="Screenshot 2023-04-06 at 20 19 30"
src="https://user-images.githubusercontent.com/115237/230463442-f53d7500-191d-4d75-a097-d100a461672a.png">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRestore air delay of 1000ms (#24290)
silverwind [Sun, 23 Apr 2023 17:26:22 +0000 (19:26 +0200)]
Restore air delay of 1000ms (#24290)

https://github.com/cosmtrek/air/pull/343 has changed air's default
`delay` from 1000 to 0 and since then, while switching git branches, I
notice air starting off multiple parallel build, essentially overloading
my machine. Restore previous value of 1000.

````
building...
routers/web/org/setting_secrets.go has changed
routers/web/org/teams.go has changed
building...
routers/web/org/teams.go has changed
routers/web/repo/setting_secrets.go has changed
building...
routers/web/org/setting_secrets.go has changed
routers/web/repo/setting_secrets.go has changed
building...
routers/web/shared/secrets/secrets.go has changed
routers/web/repo/view.go has changed
building...
routers/web/repo/view.go has changed
routers/web/user/setting/secrets.go has changed
building...
routers/web/shared/secrets/secrets.go has changed
routers/web/user/setting/secrets.go has changed
building...
routers/web/web.go has changed
routers/web/web.go has changed
building...
services/wiki/wiki_path.go has changed
services/wiki/wiki_path.go has changed
building...
...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
Running go generate...
```

17 months agoLoad reviewer for comments when dismissing a review (#24281)
Jason Song [Sun, 23 Apr 2023 15:04:23 +0000 (23:04 +0800)]
Load reviewer for comments when dismissing a review (#24281)

If a comment dismisses a review, we need to load the reviewer to show
whose review has been dismissed.

Related to:

https://github.com/go-gitea/gitea/blob/20b6ae0e5399cfc22c6a0989d8e520194e920bdd/templates/repo/issue/view_content/comments.tmpl#L765-L770

We don't need `.Review.Reviewer` for all comments, because
"dismissing" doesn't happen often, or we would have already received
error reports.

17 months agoSet type="password" on all auth_token fields (#22175)
Dan Church [Sun, 23 Apr 2023 14:28:27 +0000 (09:28 -0500)]
Set type="password" on all auth_token fields (#22175)

Set `type="password"` on all `auth_token` fields

Seen when migrating from other hosting platforms.

1. Prevents exposing the token to screen capture/cameras/eyeballs.
2. Prevents the browser from saving the value in its autocomplete
dictionary, which often is not secure.

![exposed auth
token](https://user-images.githubusercontent.com/615684/208541005-e2c9c6b0-3c6c-4a56-95d9-357b987aa0c8.png)

Closes #22174

---------

Signed-off-by: Dan Church <amphetamachine@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoOnly delete secrets belonging to its owner (#24284)
KN4CK3R [Sun, 23 Apr 2023 13:35:14 +0000 (15:35 +0200)]
Only delete secrets belonging to its owner (#24284)

17 months agoFix inconsistent wiki path converting. (#24277)
wxiaoguang [Sun, 23 Apr 2023 11:16:30 +0000 (19:16 +0800)]
Fix inconsistent wiki path converting. (#24277)

The Infinite Monkey Random Typing catches a bug, inconsistent wiki path
converting.

Close #24276

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoChange to vertical navbar layout for secondary navbar for repo/user/admin settings...
Hester Gong [Sun, 23 Apr 2023 10:21:21 +0000 (18:21 +0800)]
Change to vertical navbar layout for secondary navbar for repo/user/admin settings  (#24246)

Co-Author: @wxiaoguang

This is the first step of #24229. And this PR will only includes html
changes, and followed by other PRs that fine tune css and change to
submenus.

After:

Admin Level

<img width="1400" alt="Screen Shot 2023-04-21 at 10 07 16"
src="https://user-images.githubusercontent.com/17645053/233523870-f848b61d-056a-4b41-9760-a9a49fea1fe8.png">

User Level

<img width="1422" alt="Screen Shot 2023-04-21 at 10 07 23"
src="https://user-images.githubusercontent.com/17645053/233523878-979adb20-a657-43d9-99a6-ad414010c0ef.png">

Repo Level

<img width="1404" alt="Screen Shot 2023-04-21 at 10 07 07"
src="https://user-images.githubusercontent.com/17645053/233523863-337440bd-c03a-4dfd-87fa-cef40300bfe0.png">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoRefactor delete_modal_actions template and use it for project column related actions...
Hester Gong [Sun, 23 Apr 2023 09:24:19 +0000 (17:24 +0800)]
Refactor delete_modal_actions template and use it for project column related actions (#24097)

Co-Author: @wxiaoguang

This PR is to fix
https://github.com/go-gitea/gitea/issues/23318#issuecomment-1506275446 .
The way to fix this in this PR is to use `delete_modal_actions.tmpl`
here both to fix this issue and keep ui consistency (as suggested by
[TODO
here](https://github.com/go-gitea/gitea/blob/4299c3b7db61f8741eca0ba3d663bb65745a4acc/templates/projects/view.tmpl#L161))

And this PR also refactors `delete_modal_actions.tmpl` and its related
styles, and use the template for more modal actions:

1. Added template attributes:
* locale
* ModalButtonStyle: "yes" (default) or "confirm"
* ModalButtonCancelText
* ModalButtonOkText

2. Rename `delete_modal_actions.tmpl` template to
`modal_actions_confirm.tmpl` because it is not only used for action
modals deletion now.

3. Refactored css related to modals into `web_src/css/modules/modal.css`
and improved the styles.

4. Also use the template for PR deletion modal and remove issue
dependency modal.

5. Some modals should also use the template, but not sure how to open
them, so mark these modal actions by `{{/* TODO: Convert to
base/modal_actions_confirm */}}`

After (Also tested on arc green):

Hovering on the left buttons

<img width="711" alt="Screen Shot 2023-04-23 at 15 17 12"
src="https://user-images.githubusercontent.com/17645053/233825650-76307e65-9255-44bb-80e8-7062f58ead1b.png">

<img width="786" alt="Screen Shot 2023-04-23 at 15 17 21"
src="https://user-images.githubusercontent.com/17645053/233825652-4dc6f7d1-a180-49fb-a468-d60950eaee0d.png">

Test for functionalities:

https://user-images.githubusercontent.com/17645053/233826857-76376fda-022c-42d0-b0f3-339c17ca4e59.mov

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoupdate upgrade script to use new CDN (#24280)
techknowlogick [Sun, 23 Apr 2023 06:29:03 +0000 (02:29 -0400)]
update upgrade script to use new CDN (#24280)

The upgrade script has to deal with redirects due to pointing to former
CDN, this reduces HTTP calls by 2

setting as skip-changelog, due to it being a contrib script

17 months agoshow workflow config error on file view also (#24267)
a1012112796 [Sun, 23 Apr 2023 02:16:54 +0000 (10:16 +0800)]
show workflow config error on file view also (#24267)

As title, follow #24124

![image](https://user-images.githubusercontent.com/25342410/233763031-8c5ab4a1-a4db-4173-87f7-cef41860f1db.png)

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoAdd missing badges in user profile for /projects and /packages (#24232)
Jakob [Sun, 23 Apr 2023 01:32:40 +0000 (03:32 +0200)]
Add missing badges in user profile for /projects and /packages (#24232)

- Implement fix for user and organization page
- Add necessary ctx.Data

When switching tabs on `user profile page` the badges are shown for
`/gitea_user?tab=stars`, `/gitea_user?tab=activity` and missing under
`gitea_user/-/projects` and `gitea_user/-/packages`

This was added for users and organizations.

Before:

![image](https://user-images.githubusercontent.com/72307968/233338877-f795fae3-b65a-4ea1-8784-dd2b0cd6618f.png)
After:

![image](https://user-images.githubusercontent.com/72307968/233339012-90adb6c4-4de2-432e-ae49-69611eb7aec3.png)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 23 Apr 2023 00:07:50 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoRefactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270)
wxiaoguang [Sat, 22 Apr 2023 23:38:25 +0000 (07:38 +0800)]
Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270)

The `SHOW_FOOTER_BRANDING` came from year 2015, and it seems nobody ever
uses it. It only shows an GitHub icon which seems unrelated to Gitea, it
doesn't do what document says. So, remove it.

## :warning: Breaking

Users can now remove the key `[other].SHOW_FOOTER_BRANDING` from their
app.ini.

17 months agoUse more specific test methods (#24265)
KN4CK3R [Sat, 22 Apr 2023 21:56:27 +0000 (23:56 +0200)]
Use more specific test methods (#24265)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoSupport upload `outputs` and use `needs` context on Actions (#24230)
Jason Song [Sat, 22 Apr 2023 20:12:41 +0000 (04:12 +0800)]
Support upload `outputs` and use `needs` context on Actions (#24230)

See [Defining outputs for
jobs](https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs)
and [Example usage of the needs
context](https://docs.github.com/en/actions/learn-github-actions/contexts#example-usage-of-the-needs-context).

Related to:
- [actions-proto-def
#5](https://gitea.com/gitea/actions-proto-def/pulls/5)
- [act_runner #133](https://gitea.com/gitea/act_runner/pulls/133)

<details>
<summary>Tests & screenshots</summary>

Test workflow file:
```yaml
name: outputs
on: push

jobs:
  job1:
    runs-on: ubuntu-latest
    outputs:
      output1: ${{ steps.step1.outputs.output1 }}
      output2: ${{ steps.step2.outputs.output2 }}
    steps:
      - name: step1
        id: step1
        run: |
          date -Is > output1
          cat output1
          echo "output1=$(cat output1)" >> $GITHUB_OUTPUT
      - name: step2
        id: step2
        run: |
          cat /proc/sys/kernel/random/uuid > output2
          cat output2
          echo "output2=$(cat output2)" >> $GITHUB_OUTPUT
  job2:
    needs: job1
    runs-on: ubuntu-latest
    steps:
      - run: echo ${{ needs.job1.outputs.output1 }}
      - run: echo ${{ needs.job1.outputs.output2 }}
      - run: echo ${{ needs.job1.result }}
```

<img width="397" alt="image"
src="https://user-images.githubusercontent.com/9418365/233313322-903e7ebf-49a7-48e2-8c17-95a4581b3284.png">
<img width="385" alt="image"
src="https://user-images.githubusercontent.com/9418365/233313442-30909135-1711-4b78-a5c6-133fcc79f47c.png">

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoUpdate go tool dependencies, restructure lint targets (#24239)
silverwind [Sat, 22 Apr 2023 18:53:00 +0000 (20:53 +0200)]
Update go tool dependencies, restructure lint targets (#24239)

- Update all tool dependencies to latest tag
- Remove unused errcheck, it is part of golangci-lint
- Include main.go in air
- Enable wastedassign again now that it's
[generics-compatible](https://github.com/golangci/golangci-lint/pull/3689)
- Restructured lint targets to new `lint-*` namespace

17 months agoImprove template helper functions: string/slice (#24266)
wxiaoguang [Sat, 22 Apr 2023 18:16:22 +0000 (02:16 +0800)]
Improve template helper functions: string/slice (#24266)

Follow #23328

The improvements:

1. The `contains` functions are covered by tests
2. The inconsistent behavior of `containGeneric` is replaced by
`StringUtils.Contains` and `SliceUtils.Contains`
3. In the future we can move more help functions into XxxUtils to
simplify the `helper.go` and reduce unnecessary global functions.

FAQ:

1. Why it's called `StringUtils.Contains` but not `strings.Contains`
like Golang?

Because our `StringUtils` is not Golang's `strings` package. There will
be our own string functions.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoAdd `DumpVar` helper function to help debugging templates (#24262)
wxiaoguang [Sat, 22 Apr 2023 17:28:20 +0000 (01:28 +0800)]
Add `DumpVar` helper function to help debugging templates (#24262)

I guess many contributors might agree that it's really difficult to
write Golang template. The dot syntax `.` confuses everyone: what
variable it is ....

So, we can use a `{{DumpVar .ContextUser}}` to look into every variable
now.

![image](https://user-images.githubusercontent.com/2114189/233692383-f3c8f24d-4465-45f8-839b-b63e00731559.png)

And it can even dump the whole `ctx.Data` by `{{DumpVar .}}`:

```
dumpVar: templates.Vars
{
  "AllLangs": [
    {
      "Lang": "id-ID",
      "Name": "Bahasa Indonesia"
    },
...
      "Context": "[dumped]",
      "ContextUser": {
        "AllowCreateOrganization": true,
        "AllowGitHook": false,
        "AllowImportLocal": false,
...
  "TemplateLoadTimes": "[func() string]",
  "TemplateName": "user/profile",
  "Title": "Full'\u003cspan\u003e Name",
  "Total": 7,
  "UnitActionsGlobalDisabled": false,
  "UnitIssuesGlobalDisabled": false,
  "UnitProjectsGlobalDisabled": false,
  "UnitPullsGlobalDisabled": false,
  "UnitWikiGlobalDisabled": false,
  "locale": {
    "Lang": "en-US",
    "LangName": "English",
    "Locale": {}
  }
...

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoImprove emoji and mention matching (#24255)
Yarden Shoham [Sat, 22 Apr 2023 15:32:34 +0000 (18:32 +0300)]
Improve emoji and mention matching (#24255)

Prioritize matches that start with the given text, then matches that
contain the given text.

I wanted to add a heart emoji on a pull request comment so I started
writing `:`, `h`, `e`, `a`, `r` (at this point I still couldn't find the
heart), `t`... The heart was not on the list, that's weird - it feels
like I made a typo or a mistake. This fixes that.

This also feels more like GitHub's emoji auto-complete.

# Before

![image](https://user-images.githubusercontent.com/20454870/233630750-bd0a1b76-33d0-41d4-9218-a37b670c42b0.png)

# After

![image](https://user-images.githubusercontent.com/20454870/233775128-05e67fc1-e092-4025-b6f7-1fd8e5f71e87.png)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoRemove git sample files and ignore them (#24271)
wxiaoguang [Sat, 22 Apr 2023 12:29:29 +0000 (20:29 +0800)]
Remove git sample files and ignore them (#24271)

17 months agoFix footer display (#24251)
wxiaoguang [Sat, 22 Apr 2023 05:58:59 +0000 (13:58 +0800)]
Fix footer display (#24251)

Fix #24249

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

Screenshots:

<details>

<img width="1440" alt="image"
src="https://user-images.githubusercontent.com/2114189/233592840-d9ef7296-64eb-4e48-a598-300807a7c2f9.png">

<img width="923" alt="image"
src="https://user-images.githubusercontent.com/2114189/233593015-16edc531-43c2-4ff0-b27e-ca75dbadce0c.png">

</details>

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 22 Apr 2023 00:07:44 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoLimit avatar upload to valid image files (#24258)
JakobDev [Fri, 21 Apr 2023 21:58:59 +0000 (23:58 +0200)]
Limit avatar upload to valid image files (#24258)

This causes the browser to allow only valid images in the file picker by
default.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoAdd project type descriptions in issue badge and improve project icons (#23437)
yp05327 [Fri, 21 Apr 2023 21:15:17 +0000 (06:15 +0900)]
Add project type descriptions in issue badge and improve project icons (#23437)

Changes:

- ~~Add project icons to issue badge~~
~~After:~~

![image](https://user-images.githubusercontent.com/18380374/224633165-9d899176-03dc-4c36-94f8-b2fd9583856c.png)
Use `tooltip` to add a description of project type to the project name.

![image](https://user-images.githubusercontent.com/18380374/224923685-77201b5a-1c1f-4d37-b867-23299649df3f.png)

- improve project icons
we can use `project.icon` to get the svg name, which looks better and is
easy to change all of them in templates.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoImprove test logger (#24235)
wxiaoguang [Fri, 21 Apr 2023 20:32:25 +0000 (04:32 +0800)]
Improve test logger (#24235)

Before, there was a `log/buffer.go`, but that design is not general, and
it introduces a lot of irrelevant `Content() (string, error) ` and
`return "", fmt.Errorf("not supported")` .

And the old `log/buffer.go` is difficult to use, developers have to
write a lot of `Contains` and `Sleep` code.

The new `LogChecker` is designed to be a general approach to help to
assert some messages appearing or not appearing in logs.

17 months agoAllow `webp` images as avatars (#24248)
JakobDev [Fri, 21 Apr 2023 17:15:49 +0000 (19:15 +0200)]
Allow `webp` images as avatars (#24248)

Users can now upload `webp` images.
Browsers supporting webp images then display this as the avatar of this
user (every major browser except IE).

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoShow commit history for closed/merged PRs (#24238)
wxiaoguang [Fri, 21 Apr 2023 16:36:37 +0000 (00:36 +0800)]
Show commit history for closed/merged PRs (#24238)

Close #24237

Before:

<details>

![image](https://user-images.githubusercontent.com/2114189/233424875-a69c6dad-df4a-483e-b796-36c6459af2d6.png)

</details>

After:

![image](https://user-images.githubusercontent.com/2114189/233424712-60a296de-017b-49a8-89b2-5925ff452646.png)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix access token issue on some public endpoints (#24194)
harryzcy [Fri, 21 Apr 2023 15:39:03 +0000 (11:39 -0400)]
Fix access token issue on some public endpoints (#24194)

- [x] Identify endpoints that should be public
- [x] Update integration tests

Fix #24159

17 months agoFix comment for EmailNotificationsAndYourOwn constant (#24236)
Infinoid [Fri, 21 Apr 2023 14:27:32 +0000 (10:27 -0400)]
Fix comment for EmailNotificationsAndYourOwn constant (#24236)

This fixes some copypasta in the constant definitions for the
`User.EmailNotificationsPreference` field. No code changes.

17 months agoApply to become maintainer (#24254)
wxiaoguang [Fri, 21 Apr 2023 13:23:16 +0000 (21:23 +0800)]
Apply to become maintainer (#24254)

PRs:
https://github.com/go-gitea/gitea/pulls?q=is%3Apr+is%3Aclosed+author%3Awxiaoguang

17 months agoFix label color, fix divider in dropdown (#24215)
silverwind [Fri, 21 Apr 2023 01:53:17 +0000 (03:53 +0200)]
Fix label color, fix divider in dropdown (#24215)

Two small CSS fixes:

1. Fix basic primary label hover
2. Fix border color of divider in dropdown and remove margin so it looks
better with hover effect, as discussed in
https://github.com/go-gitea/gitea/pull/24143:

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 21 Apr 2023 00:08:19 +0000 (00:08 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoRefactor web route (#24080)
wxiaoguang [Thu, 20 Apr 2023 18:49:06 +0000 (02:49 +0800)]
Refactor web route (#24080)

The old code is unnecessarily complex, and has many misuses.

Old code "wraps" a lot, wrap wrap wrap, it's difficult to understand
which kind of handler is used.

The new code uses a general approach, we do not need to write all kinds
of handlers into the "wrapper", do not need to wrap them again and
again.

New code, there are only 2 concepts:

1. HandlerProvider: `func (h any) (handlerProvider func (next)
http.Handler)`, it can be used as middleware
2. Use HandlerProvider to get the final HandlerFunc, and use it for
`r.Get()`

And we can decouple the route package from context package (see the
TODO).

# FAQ

## Is `reflect` safe?

Yes, all handlers are checked during startup, see the `preCheckHandler`
comment. If any handler is wrong, developers could know it in the first
time.

## Does `reflect` affect performance?

No. https://github.com/go-gitea/gitea/pull/24080#discussion_r1164825901

1. This reflect code only runs for each web handler call, handler is far
more slower: 10ms-50ms
2. The reflect is pretty fast (comparing to other code): 0.000265ms
3. XORM has more reflect operations already

17 months agoFix unclear "Owner" concept (#24233)
wxiaoguang [Thu, 20 Apr 2023 17:33:30 +0000 (01:33 +0800)]
Fix unclear "Owner" concept (#24233)

Some user/org pages use `Owner` variable. It's an incorrect concept
since year 2016: what is a user's owner?

Actually, new code is right: use `ContextUser`.

This PR cleans all legacy "Owner" variables.

## Screenshots for related pages and test results

All pages are as before:

### `web/org/home.go`

![image](https://user-images.githubusercontent.com/2114189/233366687-a3643025-1f78-474d-a901-deea35b72f4d.png)

### `web/user/profile.go`

![image](https://user-images.githubusercontent.com/2114189/233366812-2e5c2fbc-3f78-44e7-88c1-ec2f612c241e.png)

### `web/user/setting/profile.go`

![image](https://user-images.githubusercontent.com/2114189/233366928-7a1e52c9-b400-4379-a4be-af06a853c5fa.png)

17 months agoIntroduce eslint-plugin-no-jquery/no-event-shorthand (#24198)
yp05327 [Thu, 20 Apr 2023 09:28:27 +0000 (18:28 +0900)]
Introduce eslint-plugin-no-jquery/no-event-shorthand (#24198)

https://github.com/go-gitea/gitea/pull/24098#issuecomment-1514010690

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoUse secondary pointing menu for tabs on user/organization home page (#24162)
Hester Gong [Thu, 20 Apr 2023 08:58:26 +0000 (16:58 +0800)]
Use secondary pointing menu for tabs on user/organization home page (#24162)

Close #24108

Use secondary pointing menu for tabs on user/organization home page so
the tabs look the same.
Main changes:
1. modified a part of dom structure in
`templates/user/overview/header.tmpl` to make it the same as
`templates/org/header.tmpl` in order to produce the same ui.
2. Move some css to `web_src/css/shared/repoorgshared.css` to make them
shareable between `templates/user/overview/header.tmpl` and
`templates/org/header.tmpl`

After:

https://user-images.githubusercontent.com/17645053/232400617-2add5bec-d483-4ab1-b48d-eaee157f7b09.mov

For further improvements. Need some thoughts:

For [this
TODO](https://github.com/HesterG/gitea/blob/729ad294cbec7a77623b2e3eab750ea7a20e8ee0/templates/user/overview/header.tmpl#L1),
it is viable to make it a shared template for [this
part](https://github.com/HesterG/gitea/blob/729ad294cbec7a77623b2e3eab750ea7a20e8ee0/templates/user/overview/header.tmpl#L2-L17)
and [this
part](https://github.com/HesterG/gitea/blob/729ad294cbec7a77623b2e3eab750ea7a20e8ee0/templates/org/header.tmpl#L1-L16)
because they are the same except for the variable. But for the menu
parts, they are quite different so might not be suitable to use a shared
template. So need some thoughts and advice about extracting the shared
template from these two headers.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoMake HTML template functions support context (#24056)
wxiaoguang [Thu, 20 Apr 2023 08:08:58 +0000 (16:08 +0800)]
Make HTML template functions support context (#24056)

# Background

Golang template is not friendly for large projects, and Golang template
team is quite slow, related:
* `https://github.com/golang/go/issues/54450`

Without upstream support, we can also have our solution to make HTML
template functions support context.

It helps a lot, the above Golang template issue `#54450` explains a lot:

1. It makes `{{Locale.Tr}}` could be used in any template, without
passing unclear `(dict "root" . )` anymore.
2. More and more functions need `context`, like `avatar`, etc, we do not
need to do `(dict "Context" $.Context)` anymore.
3. Many request-related functions could be shared by parent&children
templates, like "user setting" / "system setting"

See the test `TestScopedTemplateSetFuncMap`, one template set, two
`Execute` calls with different `CtxFunc`.

# The Solution

Instead of waiting for upstream, this PR re-uses the escaped HTML
template trees, use `AddParseTree` to add related templates/trees to a
new template instance, then the new template instance can have its own
FuncMap , the function calls in the template trees will always use the
new template's FuncMap.

`template.New` / `template.AddParseTree` / `adding-FuncMap` are all
quite fast, so the performance is not affected.

The details:

1. Make a new `html/template/Template` for `all` templates
2. Add template code to the `all` template
3. Freeze the `all` template, reset its exec func map, it shouldn't
execute any template.
4. When a router wants to render a template by its `name`
    1. Find the `name` in `all`
    2. Find all its related sub templates
3. Escape all related templates (just like what the html template
package does)
4. Add the escaped parse-trees of related templates into a new (scoped)
`text/template/Template`
    5. Add context-related func map into the new (scoped) text template
    6. Execute the new (scoped) text template
7. To improve performance, the escaped templates are cached to `template
sets`

# FAQ

## There is a `unsafe` call, is this PR unsafe?

This PR is safe. Golang has strict language definition, it's safe to do
so: https://pkg.go.dev/unsafe#Pointer (1) Conversion of a *T1 to Pointer
to *T2

## What if Golang template supports such feature in the future?

The public structs/interfaces/functions introduced by this PR is quite
simple, the code of `HTMLRender` is not changed too much. It's very easy
to switch to the official mechanism if there would be one.

## Does this PR change the template execution behavior?

No, see the tests (welcome to design more tests if it's necessary)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix issue attachment handling (#24202)
wxiaoguang [Thu, 20 Apr 2023 06:39:44 +0000 (14:39 +0800)]
Fix issue attachment handling (#24202)

Close #24195

Some of the changes are taken from my another fix
https://github.com/go-gitea/gitea/pull/20147/commits/f07b0de997125c9b79cc5af27966a7cdd1803a4d
in #20147 (although that PR was discarded ....)

The bug is:

1. The old code doesn't handle `removedfile` event correctly
2. The old code doesn't provide attachments for type=CommentTypeReview

This PR doesn't intend to refactor the "upload" code to a perfect state
(to avoid making the review difficult), so some legacy styles are kept.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoUpdate JS dependencies (#24218)
silverwind [Thu, 20 Apr 2023 02:36:41 +0000 (04:36 +0200)]
Update JS dependencies (#24218)

- Update all js dependencies, update playwright image to jammy
- Adjust eslint and vitest config
- Tested build, monaco, mermaid, katex

17 months agoRemove most path-based golangci exclusions (#24214)
silverwind [Thu, 20 Apr 2023 02:08:01 +0000 (04:08 +0200)]
Remove most path-based golangci exclusions (#24214)

They are non-obvious and do not survive refactor.

Will replace with `//nolint` comments after CI results are in.

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 20 Apr 2023 00:07:41 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoFix internal sever error when visiting a PR that bound to the deleted team (#24127)
sillyguodong [Wed, 19 Apr 2023 23:50:00 +0000 (07:50 +0800)]
Fix internal sever error when visiting a PR that bound to the deleted team (#24127)

Close: #23738

The actual cause of `500 Internal Server Error` in the issue is not what
is descirbed in the issue.

The actual cause is that after deleting team, if there is a PR which has
requested reivew from the deleted team, the comment could not match with
the deleted team by `assgin_team_id`. So the value of `.AssigneeTeam`
(see below code block) is `nil` which cause `500 error`.

https://github.com/go-gitea/gitea/blob/1c8bc4081a4f4d0d921ac218cb724ce97924d410/templates/repo/issue/view_content/comments.tmpl#L691-L695

To fix this bug, there are the following problems to be resolved:

- [x] 1. ~~Stroe the name of the team in `content` column when inserting
`comment` into DB in case that we cannot get the name of team after it
is deleted. But for comments that already exist, just display "Unknown
Team"~~ Just display "Ghost Team" in the comment if the assgined team is
deleted.
- [x] 2. Delete the PR&team binding (the row of which `review_team_id =
${team_id} ` in table `review`) when deleting team.
- [x] 3.For already exist and undeleted binding rows in in table
`review`, ~~we can delete these rows when executing migrations.~~ they
do not affect the function, so won't delete them.

17 months agoAdd owner team permission check test (#24096)
yp05327 [Wed, 19 Apr 2023 23:19:13 +0000 (08:19 +0900)]
Add owner team permission check test (#24096)

Add test for https://github.com/go-gitea/gitea/pull/23675

Should be merged after #24117

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix incorrect CORS default values (#24206)
wxiaoguang [Wed, 19 Apr 2023 19:30:10 +0000 (03:30 +0800)]
Fix incorrect CORS default values (#24206)

Document:

```
;ALLOW_DOMAIN = *
;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
```

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd repository counter badge to repository tab (#24205)
Jakob [Wed, 19 Apr 2023 18:58:36 +0000 (20:58 +0200)]
Add repository counter badge to repository tab (#24205)

Add a new badge to the repository tab for users and organizations.
The badge is only visible if a repo exists.

Change the badge color of existing "Starred Repositories". (from primary to small)

Closes #24188

17 months agoFix template error in pull request with deleted head repo (#24192)
Brecht Van Lommel [Wed, 19 Apr 2023 18:21:48 +0000 (20:21 +0200)]
Fix template error in pull request with deleted head repo (#24192)

Rendering of Allow Edits from Maintainers did not check if the head repo
exists, while other parts of the page handle it gracefully.

17 months agoMake wiki title supports dashes and improve wiki name related features (#24143)
wxiaoguang [Wed, 19 Apr 2023 17:50:10 +0000 (01:50 +0800)]
Make wiki title supports dashes and improve wiki name related features (#24143)

Close #7570

1. Clearly define the wiki path behaviors, see
`services/wiki/wiki_path.go` and tests
2. Keep compatibility with old contents
3. Allow to use dashes in titles, eg: "2000-01-02 Meeting record"
4. Add a "Pages" link in the dropdown, otherwise users can't go to the
Pages page easily.
5. Add a "View original git file" link in the Pages list, even if some
file names are broken, users still have a chance to edit or remove it,
without cloning the wiki repo to local.
6. Fix 500 error when the name contains prefix spaces.

This PR also introduces the ability to support sub-directories, but it
can't be done at the moment due to there are a lot of legacy wiki data,
which use "%2F" in file names.

![image](https://user-images.githubusercontent.com/2114189/232239004-3359d7b9-7bf3-4ff3-8446-bfb0e79645dd.png)

![image](https://user-images.githubusercontent.com/2114189/232239020-74b92c72-bf73-4377-a319-1c85609f82b1.png)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix Resolve Conversation not working in Conversation view (#24191)
Brecht Van Lommel [Wed, 19 Apr 2023 17:05:25 +0000 (19:05 +0200)]
Fix Resolve Conversation not working in Conversation view (#24191)

It only worked in the Files Changed view.

Caused by #23639.

17 months agoVertical widths of containers removed (#24184)
Krzysztof Jeziorny [Wed, 19 Apr 2023 16:13:00 +0000 (18:13 +0200)]
Vertical widths of containers removed (#24184)

A vertical overflow appears in Firefox 112/MacOS 12.6 when the system
setting for scrollbars is to "Always" show them.
---
Here, the fixed 100vw container widths are removed, which removes the
overflow. It is, however, only simulated in Developer Tools in latest
Firefox and Chromium, so please test on a Gitea installation.

17 months agoDon't list root repository on compare page if pulls not allowed (#24183)
Lunny Xiao [Wed, 19 Apr 2023 15:16:46 +0000 (23:16 +0800)]
Don't list root repository on compare page if pulls not allowed (#24183)

Fix #24165

17 months agoAdd unset default project column (#23531)
yp05327 [Wed, 19 Apr 2023 14:28:28 +0000 (23:28 +0900)]
Add unset default project column (#23531)

Close: https://github.com/go-gitea/gitea/issues/23401

17 months agoAllow adding new files to an empty repo (#24164)
wxiaoguang [Wed, 19 Apr 2023 13:40:42 +0000 (21:40 +0800)]
Allow adding new files to an empty repo (#24164)

![image](https://user-images.githubusercontent.com/2114189/232561612-2bfcfd0a-fc04-47ba-965f-5d0bcea46c54.png)

17 months agoAdd runner check in repo action page (#24124)
yp05327 [Wed, 19 Apr 2023 12:51:20 +0000 (21:51 +0900)]
Add runner check in repo action page (#24124)

![image](https://user-images.githubusercontent.com/18380374/232996647-13c2b9f1-c9e9-42d9-acbf-8a6e16b175a6.png)

Maybe we can also add online runner check? e.g. : Target runner is
offline.

17 months agoUse same action status svg icons on actions list as on action page (#24178)
Hester Gong [Wed, 19 Apr 2023 05:42:53 +0000 (13:42 +0800)]
Use same action status svg icons on actions list as on action page (#24178)

Close #24020

After:

These icons are the same now:

<img width="1287" alt="截屏2023-04-18 13 52 11"
src="https://user-images.githubusercontent.com/17645053/232684252-05ddc101-dc5b-41b5-b374-132c3d853a41.png">

<img width="1141" alt="截屏2023-04-18 13 54 48"
src="https://user-images.githubusercontent.com/17645053/232684261-6ebd864a-a9aa-4982-af32-2cea91c35be8.png">

In this PR, didn't use `ActionRunStatus.vue` because the mounting of the
component will cause flash of the icons like below:

https://user-images.githubusercontent.com/17645053/232682646-713202dc-9023-4b9c-a849-c3a1ae6dd155.mov

Instead, modified and used `status.tmpl` to make it the same as
`ActionRunStatus.vue` to avoid the ui flash (Welcomed to show how to use
`ActionRunStatus.vue` without flashing if there is a way).
Added comments to both of them for reminding synchronization of these
two files.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Apr 2023 00:07:39 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

17 months agofix calReleaseNumCommitsBehind (#24148)
oliverpool [Tue, 18 Apr 2023 19:11:17 +0000 (21:11 +0200)]
fix calReleaseNumCommitsBehind (#24148)

`repoCtx.CommitsCount` is not reliably the commit count of the default
branch (Repository.GetCommitsCount depends on what is currently
displayed).

For instance on the releases page the commit count is correct:
https://codeberg.org/Codeberg/pages-server/releases

![2023-04-15-215027](https://user-images.githubusercontent.com/3864879/232250500-6c05dc00-7030-4ec9-87f1-18c7797d36bf.png)

However it is not on the single page:
https://codeberg.org/Codeberg/pages-server/releases/tag/v4.6.2

![2023-04-15-215036](https://user-images.githubusercontent.com/3864879/232250503-620c8038-7c2c-45a1-b99d-cb994ef955a6.png)

This PR fixes this by removing a "fast branch" which was using this
field (I think this field should be removed, since it is a bit
unpredictable - but this would mean a larger refactoring PR).

_contributed in the context of @forgejo_

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
17 months agoMark `public/img/svg/*.svg` as generated files (#24193)
Yarden Shoham [Tue, 18 Apr 2023 17:52:18 +0000 (20:52 +0300)]
Mark `public/img/svg/*.svg` as generated files (#24193)

These files are generated using `make svg`

17 months agoMake mention autocomplete case insensitive in new markdown editor (#24190)
Brecht Van Lommel [Tue, 18 Apr 2023 17:25:11 +0000 (19:25 +0200)]
Make mention autocomplete case insensitive in new markdown editor (#24190)

This matches EasyMDE, and makes it easier to find the right user without
having to remember the exact name.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix duplicate modals when clicking on "remove all" repository button (#24129)
Hester Gong [Tue, 18 Apr 2023 16:49:49 +0000 (00:49 +0800)]
Fix duplicate modals when clicking on "remove all" repository button (#24129)

Under Team tab of an organization, click on "remove all" repositories
button will trigger two modals. Because `data-modal-id` is not proerly
added.

Before:

https://user-images.githubusercontent.com/17645053/231988545-ac690b86-e3fe-4bf5-81c6-5ef09302e849.mov

After:

https://user-images.githubusercontent.com/17645053/231989678-53be4f91-fdc9-4bc5-ba11-a08aa4548e37.mov

17 months agoBump GitHub's `relative-time-element` to `v4.3.0` (#24187)
Yarden Shoham [Tue, 18 Apr 2023 16:00:01 +0000 (19:00 +0300)]
Bump GitHub's `relative-time-element` to `v4.3.0` (#24187)

https://github.com/github/relative-time-element/releases/tag/v4.3.0

I checked and everything still works

17 months agoFix wrong scopes of locale.PrettyNumber (#24181)
Hester Gong [Tue, 18 Apr 2023 11:26:57 +0000 (19:26 +0800)]
Fix wrong scopes of locale.PrettyNumber (#24181)