]> source.dussan.org Git - gitea.git/log
gitea.git
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>
17 months agoFix wrong error info in RepoRefForAPI (#24344)
yp05327 [Wed, 26 Apr 2023 08:14:35 +0000 (17:14 +0900)]
Fix wrong error info in RepoRefForAPI (#24344)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd missed column title in runner management page (#24328)
yp05327 [Wed, 26 Apr 2023 07:46:25 +0000 (16:46 +0900)]
Add missed column title in runner management page (#24328)

![image](https://user-images.githubusercontent.com/18380374/234214706-315a8465-8931-4693-8015-e50279db53ab.png)

17 months agoRemove unnecessary helper function `DateFmtLong` (#24343)
Yarden Shoham [Wed, 26 Apr 2023 06:52:50 +0000 (09:52 +0300)]
Remove unnecessary helper function `DateFmtLong` (#24343)

After #24317 this function is only used in one place where it is not
needed. I confirmed the timestamp still renders correctly

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoAdd API for License templates (#23009)
JakobDev [Wed, 26 Apr 2023 06:08:28 +0000 (08:08 +0200)]
Add API for License templates (#23009)

This adds a API for getting License templates. This tries to be as close
to the [GitHub
API](https://docs.github.com/en/rest/licenses?apiVersion=2022-11-28) as
possible, but Gitea does not support all features that GitHub has. I
think they should been added, but this out f the scope of this PR. You
should merge #23006 before this PR for security reasons.

17 months agoFix Monaco IOS keyboard button (#24341)
silverwind [Wed, 26 Apr 2023 05:31:50 +0000 (07:31 +0200)]
Fix Monaco IOS keyboard button (#24341)

Fix https://github.com/go-gitea/gitea/issues/16188. Turns out the
element was completely misaligned by fomantic styles. Add most of the
original styles in `!important` form to fix.

Tapping the button doesn't do anything useful in Simulator.app, but I
guess it's still better to not outright hide it in case it has a
possiblity to work.

<img width="121" alt="image"
src="https://user-images.githubusercontent.com/115237/234379685-4e67f8cd-7e91-4bcc-8e17-9d5b2ebed6cd.png">

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoDon't set meta `theme-color` by default (#24340)
silverwind [Wed, 26 Apr 2023 04:56:42 +0000 (06:56 +0200)]
Don't set meta `theme-color` by default (#24340)

Fixes https://github.com/go-gitea/gitea/issues/24321. By not setting
this meta tag, Safari will use body color for chrome and out-of-viewport
areas, which looks much better then static mismatching green.

As per
[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color)
it's really only Apple browsers who still support this tag, most others
have dropped support.

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.