]> source.dussan.org Git - gitea.git/log
gitea.git
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)

17 months agoFix incorrect internal response type (#24173)
wxiaoguang [Tue, 18 Apr 2023 03:10:40 +0000 (11:10 +0800)]
Fix incorrect internal response type (#24173)

Close #24167

The endpoint "set-default-branch" returns `success`, so just decode it
as `responseText`

18 months agozh-cn support on doc pages (#24166)
Kroytz [Tue, 18 Apr 2023 00:23:35 +0000 (08:23 +0800)]
zh-cn support on doc pages (#24166)

+ Add zh-cn support for upgrade-from-gitea page
+ Fix typo error on https-support.zh-cn page

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

18 months agoUse double quotes consistently in en-US (#24141)
Panagiotis "Ivory" Vasilopoulos [Mon, 17 Apr 2023 22:04:26 +0000 (22:04 +0000)]
Use double quotes consistently in en-US (#24141)

Also removes quotes in commit messages related to file modifications
made in the Web UI.

18 months agoUse correct locale key for forks page (#24172)
John Olheiser [Mon, 17 Apr 2023 20:41:06 +0000 (15:41 -0500)]
Use correct locale key for forks page (#24172)

https://github.com/go-gitea/gitea/blob/4014200021a1997283c779a815fe9e5febf1fda1/options/locale/locale_en-US.ini#L873

https://github.com/go-gitea/gitea/blob/4014200021a1997283c779a815fe9e5febf1fda1/options/locale/locale_en-US.ini#L943

18 months agoImprove Wiki TOC (#24137)
wxiaoguang [Mon, 17 Apr 2023 19:05:19 +0000 (03:05 +0800)]
Improve Wiki TOC (#24137)

The old code has a lot of technical debts, eg: `repo/wiki/view.tmpl` /
`Iterate`

This PR improves the Wiki TOC display and improves the code.

---------

Co-authored-by: delvh <dev.lh@web.de>
18 months agoLocalize activity heatmap (except tooltip) (#24131)
Yarden Shoham [Mon, 17 Apr 2023 18:26:01 +0000 (21:26 +0300)]
Localize activity heatmap (except tooltip) (#24131)

The calculation of the total sum is moved to the backend so a full HTML
string could be sent.

![image](https://user-images.githubusercontent.com/20454870/232112381-c11d896b-ba47-40f8-b2a3-71cf4b3208de.png)

- Closes #10669
- 2nd attempt (the first was in #21570)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
18 months agoSupport triggering workflows by wiki related events (#24119)
Zettat123 [Mon, 17 Apr 2023 17:49:47 +0000 (01:49 +0800)]
Support triggering workflows by wiki related events (#24119)

This PR is to support triggering workflows by wiki related events like
creating, editing or deleting wiki pages. In GitHub, this event is
called
[gollum](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#gollum)

18 months agoadd CLI command to register runner tokens (#23762)
techknowlogick [Mon, 17 Apr 2023 17:07:13 +0000 (13:07 -0400)]
add CLI command to register runner tokens (#23762)

This is a CLI command to generate new tokens for the runners to register
with

Fix https://github.com/go-gitea/gitea/issues/23643

---------

Co-authored-by: delvh <dev.lh@web.de>
18 months agoAdd new user types `reserved`, `bot`, and `remote` (#24026)
techknowlogick [Mon, 17 Apr 2023 16:36:50 +0000 (12:36 -0400)]
Add new user types `reserved`, `bot`, and `remote` (#24026)

This allows for usernames, and emails connected to them to be reserved
and not reused.

Use case, I manage an instance with open registration, and sometimes
when users are deleted for spam (or other purposes), their usernames are
freed up and they sign up again with the same information.

This could also be used to reserve usernames, and block them from being
registered (in case an instance would like to block certain things
without hardcoding the list in code and compiling from scratch).

This is an MVP, that will allow for future work where you can set
something as reserved via the interface.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
18 months agoFix Org edit page bugs: renaming detection, maxlength (#24161)
wxiaoguang [Mon, 17 Apr 2023 15:35:57 +0000 (23:35 +0800)]
Fix Org edit page bugs: renaming detection, maxlength (#24161)

## Before

* The renaming detection is wrong (eg: pasting a new name into the input
doesn't trigger the detection)
* The renaming prompt layout is not good
* Some MaxSize/maxlength rules is missing

![image](https://user-images.githubusercontent.com/2114189/232379191-5d0f6d10-56ca-4cec-ac52-7f77b9cb4a8a.png)

![image](https://user-images.githubusercontent.com/2114189/232379234-3289373b-9ddb-4627-ae86-f4d74589fa0c.png)

## After

* Fix these problems

![image](https://user-images.githubusercontent.com/2114189/232379098-31c6fa21-c210-4e7f-a337-b38b99670835.png)

18 months agoMake HAS_GO a simply expanded variable (#24169)
silverwind [Mon, 17 Apr 2023 14:46:25 +0000 (16:46 +0200)]
Make HAS_GO a simply expanded variable (#24169)

Avoid recursive expansion on this variable and simplify the value.
[Reference](https://www.gnu.org/software/make/manual/html_node/Setting.html).

18 months agoSupport converting varchar to nvarchar for mssql database (#24105)
Lunny Xiao [Mon, 17 Apr 2023 13:22:10 +0000 (21:22 +0800)]
Support converting varchar to nvarchar for mssql database (#24105)

18 months agoFix math and mermaid rendering bugs (#24049)
silverwind [Mon, 17 Apr 2023 10:10:22 +0000 (12:10 +0200)]
Fix math and mermaid rendering bugs (#24049)

1. Fix multiple error display for math and mermaid:

![err](https://user-images.githubusercontent.com/115237/231126411-8a21a777-cd53-4b7e-ac67-5332623106e8.gif)

2. Fix height calculation of certain mermaid diagrams by reading the
iframe inner height from it's document instead of parsing it from SVG:

Before:
<img width="866" alt="Screenshot 2023-04-11 at 11 56 27"
src="https://user-images.githubusercontent.com/115237/231126480-b194e02b-ea8c-4ddf-8c79-50c525815d92.png">

After:
<img width="855" alt="Screenshot 2023-04-11 at 11 56 35"
src="https://user-images.githubusercontent.com/115237/231126494-5fe86a48-8d21-455a-8b95-79b6ee27a16f.png">

3. Refactor error handling to a common function
4. Rename to `renderAsciicast` for consistency
5. Improve mermaid loading sequence

Note: I did try `securityLevel: 'sandbox'` to make mermaid output a
iframe directly, but that showed a bug in mermaid where the iframe style
height was set incorrectly. Opened
https://github.com/mermaid-js/mermaid/issues/4289 for this.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
18 months agoRefactor locale number (#24134)
wxiaoguang [Mon, 17 Apr 2023 03:37:23 +0000 (11:37 +0800)]
Refactor locale number (#24134)

Before, the `GiteaLocaleNumber.js` was just written as a a drop-in
replacement for old `js-pretty-number`.

Actually, we can use Golang's `text` package to format.

This PR partially completes the TODOs in `GiteaLocaleNumber.js`:

> if we have complete backend locale support (eg: Golang "x/text"
package), we can drop this component.
> tooltip: only 2 usages of this, we can replace it with Golang's
"x/text/number" package in the future.

This PR also helps #24131

Screenshots:

<details>

![image](https://user-images.githubusercontent.com/2114189/232179420-b1b9974b-9d96-4408-b209-b80182c8b359.png)

![image](https://user-images.githubusercontent.com/2114189/232179416-14f36aa0-3f3e-4ac9-b366-7bd3a4464a11.png)

</details>

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

18 months agoUse 1.18's aria role for dropdown menus (#24144)
wxiaoguang [Sun, 16 Apr 2023 13:58:22 +0000 (21:58 +0800)]
Use 1.18's aria role for dropdown menus (#24144)

According to erion's feedback, the 1.18 approach works with Safari
(`role=menu` on the parent container), while the 1.19's approach doesn't
work well with Safari+VoiceOver (although I tested it worked with Chrome
a little better).

I have tested this 1.18 approach could work for all
Safari/Chrome+VoiceOver and Chrome+Talkback.

Let's try to make it on try.gitea.io to see whether it helps Safari
users.

18 months agoSet EasyMDE heading font-size to the same size as the resulting markdown (#24151)
wxiaoguang [Sun, 16 Apr 2023 12:01:08 +0000 (20:01 +0800)]
Set EasyMDE heading font-size to the same size as the resulting markdown (#24151)

Fix #23816

According to my personal experience, the EasyMDE is still useful when
writing a lot of contents, eg: the wiki page.

It's not difficult to improve its heading styles, so let's make it.

Before:

<img width="815" alt="image"
src="https://user-images.githubusercontent.com/2114189/232280943-9177f0bc-e380-426f-8588-20ff8d8e5293.png">

After:

<img width="538" alt="image"
src="https://user-images.githubusercontent.com/2114189/232280903-e8c476ee-f5b1-48fe-8a93-86fcd79680c3.png">

18 months agoFix 2-dot direct compare to use the right base commit (#24133)
Jonathan Tran [Sun, 16 Apr 2023 07:27:23 +0000 (03:27 -0400)]
Fix 2-dot direct compare to use the right base commit (#24133)

For 2-dot direct compare, we should use the base commit in the title and
templates, as is used elsewhere, not the common ancestor which is used
for 3-dot compare. I believe that this change should have been included
in #22949.

18 months agoAdd migration to fix external unit access mode of owner/admin team (#24117)
yp05327 [Sat, 15 Apr 2023 13:52:44 +0000 (22:52 +0900)]
Add migration to fix external unit access mode of owner/admin team (#24117)

Fix the incorrect migration in #23675 and #24012

External Unit (Tracker and Wiki) access mode should be `read` in
owner/admin team.

18 months agoRemove untranslatable `on_date` key (#24106)
Yarden Shoham [Sat, 15 Apr 2023 11:01:54 +0000 (14:01 +0300)]
Remove untranslatable `on_date` key (#24106)

- Follows #23988
- Fixes: #24074 by removing this key

GitHub's `relative-time` elements allow us to force their rendering to
`auto`, `past`, or `future` tense. We will never show an absolute date
`on ...` in `TimeSince`

## Before

![image](https://user-images.githubusercontent.com/20454870/231735872-048c7bf3-6aa1-4113-929d-75a985c9922c.png)

## After

![image](https://user-images.githubusercontent.com/20454870/231736116-6ad47b63-77f4-4d3f-82a2-ee9a46ba2bd1.png)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
18 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 15 Apr 2023 00:07:26 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

18 months agoSort repo topic labels by name (#24123)
wxiaoguang [Fri, 14 Apr 2023 19:29:05 +0000 (03:29 +0800)]
Sort repo topic labels by name (#24123)

Close #24077

18 months agoAdd option to search for users is active join a team (#24093)
Tyrone Yeh [Fri, 14 Apr 2023 18:48:36 +0000 (02:48 +0800)]
Add option to search for users is active join a team (#24093)

Adding a user in a team to enter a username gives a list of no active
users

---------

Co-authored-by: Jason Song <i@wolfogre.com>
18 months agoMake more functions use ctx instead of db.DefaultContext (#24068)
wxiaoguang [Fri, 14 Apr 2023 18:18:28 +0000 (02:18 +0800)]
Make more functions use ctx instead of db.DefaultContext (#24068)

Continue the "ctx refactoring" work.

There are still a lot db.DefaultContext, incorrect context could cause
database deadlock errors.

18 months agoFix meilisearch not working when searching across multiple repositories (#24109)
Brecht Van Lommel [Fri, 14 Apr 2023 17:27:11 +0000 (19:27 +0200)]
Fix meilisearch not working when searching across multiple repositories (#24109)

This would happen in the issue and pull request dashboards, while the
per repository lists worked fine.

Use OR instead of AND for repo IDs.

18 months agoShow friendly 500 error page to users and developers (#24110)
wxiaoguang [Fri, 14 Apr 2023 05:19:11 +0000 (13:19 +0800)]
Show friendly 500 error page to users and developers (#24110)

Close #24104

This also introduces many tests to cover many complex error handling
functions.

### Before

The details are never shown in production.

<details>

![image](https://user-images.githubusercontent.com/2114189/231805004-13214579-4fbe-465a-821c-be75c2749097.png)

</details>

### After

The details could be shown to site admin users. It is safe.

![image](https://user-images.githubusercontent.com/2114189/231803912-d5660994-416f-4b27-a4f1-a4cc962091d4.png)

18 months agoFix incorrect server error content in RunnersList (#24118)
yp05327 [Fri, 14 Apr 2023 03:34:10 +0000 (12:34 +0900)]
Fix incorrect server error content in RunnersList (#24118)

18 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 14 Apr 2023 00:07:25 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

18 months agoImprove git log for debugging (#24095)
wxiaoguang [Thu, 13 Apr 2023 23:17:27 +0000 (07:17 +0800)]
Improve git log for debugging (#24095)

18 months agoUpdate redis library to support redis v7 (#24114)
techknowlogick [Thu, 13 Apr 2023 22:41:04 +0000 (18:41 -0400)]
Update redis library to support redis v7 (#24114)

18 months agoRefactor cookie (#24107)
wxiaoguang [Thu, 13 Apr 2023 19:45:33 +0000 (03:45 +0800)]
Refactor cookie (#24107)

Close #24062

At the beginning, I just wanted to fix the warning mentioned by #24062

But, the cookie code really doesn't look good to me, so clean up them.

Complete the TODO on `SetCookie`:

> TODO: Copied from gitea.com/macaron/macaron and should be improved
after macaron removed.

18 months agoFix admin team access mode value in team_unit table (#24012)
yp05327 [Thu, 13 Apr 2023 19:06:10 +0000 (04:06 +0900)]
Fix admin team access mode value in team_unit table (#24012)

Same as https://github.com/go-gitea/gitea/pull/23675
Feedback:
https://github.com/go-gitea/gitea/pull/23879#issuecomment-1500923636

18 months agoAdd monospace toggle button to textarea (#24034)
silverwind [Thu, 13 Apr 2023 19:05:06 +0000 (21:05 +0200)]
Add monospace toggle button to textarea (#24034)

- Add new button to textarea to switch font. State is persisted in
localStorage.
- Change markdown-switch-easymde button from `<span>` to `<button>`
- Slightly increased monospace font globally by 5% as I think it fits
better.

For hover effect on these buttons I'm deferring to
https://github.com/go-gitea/gitea/pull/23896.

![](https://user-images.githubusercontent.com/115237/230948526-ecf8d730-0c69-4a8e-a1a5-1e5e079c754d.gif)

---------

Co-authored-by: delvh <dev.lh@web.de>
18 months agoCorrect the access log format (#24085)
Gary Moon [Thu, 13 Apr 2023 13:14:06 +0000 (09:14 -0400)]
Correct the access log format (#24085)

The default access log format has been unnecessarily escaped, leading to
spurious backslashes appearing in log lines.

Additionally, the `RemoteAddr` field includes the port, which breaks
most log parsers attempting to process it. I've added a call to
`net.SplitHostPort()` attempting to isolate the address alone, with a
fallback to the original address if it errs.

Signed-off-by: Gary Moon <gary@garymoon.net>
18 months agoChangelog v1.19.1 (#24079) (#24092)
6543 [Thu, 13 Apr 2023 08:45:54 +0000 (10:45 +0200)]
Changelog v1.19.1 (#24079) (#24092)

Frontport #24079

18 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 13 Apr 2023 00:07:24 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

18 months agoBump vm2 from 3.9.15 to 3.9.16 (#24089)
dependabot[bot] [Wed, 12 Apr 2023 21:45:39 +0000 (17:45 -0400)]
Bump vm2 from 3.9.15 to 3.9.16 (#24089)

Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.15 to 3.9.16.

Signed-off-by: dependabot[bot] <support@github.com>
18 months agoFix difficult translation for other languages (#24070)
Lunny Xiao [Wed, 12 Apr 2023 17:05:53 +0000 (01:05 +0800)]
Fix difficult translation for other languages (#24070)

Fix https://github.com/go-gitea/gitea/pull/24051#discussion_r1163697643

---------

Co-authored-by: silverwind <me@silverwind.io>
18 months agoFix mismatch between hook events and github event types (#24048)
Zettat123 [Wed, 12 Apr 2023 16:16:47 +0000 (00:16 +0800)]
Fix mismatch between hook events and github event types (#24048)

Some workflow trigger events can have multiple activity types, such as
`issues` and `pull_request`, and user can specify which types can
trigger the workflow. See GitHub documentation:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows

Now some hook events cannot match the workflow trigger events correctly
because we don't check the activity types. For example,
`pull_request_label` is an individual hook event. But there isn't a
`pull_request_label` workflow trigger event, we can only use
`pull_request` event's `label` activity type. If we don't check the
activity types, the workflows without the `label` activity type may be
triggered by the `pull_request_label` event by mistake. We need to
improve the match logic.

- [x] [`issues`
](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues)
- [x]
[`issue_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment)
- [x]
[`pull_request`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request)
- [x]
[`pull_request_review`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review)
- [x]
[`pull_request_review_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review_comment)
- [x]
[`release`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)
- [x]
[`registry_package`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#registry_package)

18 months agoImprove LFS error logs (#24072)
wxiaoguang [Wed, 12 Apr 2023 15:01:41 +0000 (23:01 +0800)]
Improve LFS error logs (#24072)

The error logs were not clear.

Help (but not fix) #24053

18 months agoUpdate the value of the `diffEnd` when click `Show More` btn in the DiffFileTree...
sillyguodong [Wed, 12 Apr 2023 13:11:23 +0000 (21:11 +0800)]
Update the value of the `diffEnd` when click `Show More` btn in the DiffFileTree (#24069)

In the component `DiffFileTree`,if don't update the value of the
`diffEnd` in the callback of ajax request, click `Show More` btn will
always return the same response, duplicate files are appended to the
file list.

Before:

https://user-images.githubusercontent.com/33891828/231371188-82d169af-10bb-47e2-8aca-83ced2597f2d.mov

After:

https://user-images.githubusercontent.com/33891828/231369805-39a5a4d0-662c-4f08-bc5a-7d31e8782453.mov

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoAdd tooltips to `Hide comment type` settings where necessary (#21306)
delvh [Wed, 12 Apr 2023 11:59:17 +0000 (13:59 +0200)]
Add tooltips to `Hide comment type` settings where necessary (#21306)

Previously, this setting was pretty confusing for users, especially the
difference between "reference" and "issue reference".
Related: #21321.

18 months agoUse a general approach to access custom/static/builtin assets (#24022)
wxiaoguang [Wed, 12 Apr 2023 10:16:45 +0000 (18:16 +0800)]
Use a general approach to access custom/static/builtin assets (#24022)

The idea is to use a Layered Asset File-system (modules/assetfs/layered.go)

For example: when there are 2 layers: "custom", "builtin", when access
to asset "my/page.tmpl", the Layered Asset File-system will first try to
use "custom" assets, if not found, then use "builtin" assets.

This approach will hugely simplify a lot of code, make them testable.

Other changes:

* Simplify the AssetsHandlerFunc code
* Simplify the `gitea embedded` sub-command code

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoMake Release Download URLs predictable (#23891)
JakobDev [Wed, 12 Apr 2023 09:05:23 +0000 (11:05 +0200)]
Make Release Download URLs predictable (#23891)

As promised in #23817, I have this made a PR to make Release Download
URLs predictable. It currently follows the schema
`<repo>/releases/download/<tag>/<filename>`. this already works, but it
is nowhere shown in the UI or the API. The Problem is, that it is
currently possible to have multiple files with the same name (why do we
even allow this) for a release. I had written some Code to check, if a
Release has 2 or more files with the same Name. If yes, it uses the old
`attachments/<uuid>` URlL if no it uses the new fancy URL.

I had also changed `<repo>/releases/download/<tag>/<filename>` to
directly serve the File instead of redirecting, so people who who use
automatic update checker don't end up with the `attachments/<uuid>` URL.

Fixes #10919

---------

Co-authored-by: a1012112796 <1012112796@qq.com>
18 months agoExpand selected file when clicking file tree (#24041)
sillyguodong [Wed, 12 Apr 2023 07:06:39 +0000 (15:06 +0800)]
Expand selected file when clicking file tree (#24041)

Auto expand the selected file when clicking the file item of the file
tree.
This is consistent with Github's behavior.

https://user-images.githubusercontent.com/33891828/231048124-61f180af-adba-42d7-9ffa-626e1de04aed.mov

18 months agoLocalize milestone related time strings (#24051)
Yarden Shoham [Wed, 12 Apr 2023 06:29:49 +0000 (09:29 +0300)]
Localize milestone related time strings (#24051)

- With #23988 in place, we can improve these timestamps

---------

Co-authored-by: silverwind <me@silverwind.io>
18 months agoupdate BSDmakefile to latest version from upstream (#24063)
techknowlogick [Wed, 12 Apr 2023 03:42:22 +0000 (23:42 -0400)]
update BSDmakefile to latest version from upstream (#24063)

from https://github.com/neosmart/gmake-proxy

18 months agoAdd popup to hashed comments/pull requests/issues in file editing/adding preview...
Hester Gong [Wed, 12 Apr 2023 03:03:23 +0000 (11:03 +0800)]
Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040)

#23734 didn't add popups(tippy) to ref issues for the preview tab when
adding/editing a file

The location of the preview tab:
<img width="1214" alt="截屏2023-04-10 13 55 38"
src="https://user-images.githubusercontent.com/17645053/230836213-a73f0cee-378c-4a21-93db-583ba2c72f77.png">

This PR resues the logic in `ComboMarkdownEditor.js` to also add popup
to hashed comments/pull requests/issues in file editing/adding preview
tab.

After - On hover:
<img width="1222" alt="截屏2023-04-10 13 55 42"
src="https://user-images.githubusercontent.com/17645053/230836250-527ca7d0-6ec4-4c68-89ab-4f1b57b09239.png">

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
18 months agoUse reactive store to share data between components (#23996)
wxiaoguang [Wed, 12 Apr 2023 00:44:26 +0000 (08:44 +0800)]
Use reactive store to share data between components (#23996)

Follow #23947

* Use reactive store to share data between components
* Remove no-op `this.hashListener = window.addEventListener()` because
`addEventListener` returns void/undefined.

Reference:

https://vuejs.org/guide/scaling-up/state-management.html#simple-state-management-with-reactivity-api

Screenshot (the same as before):

<details>

<img width="565" alt="image"
src="https://user-images.githubusercontent.com/2114189/230701282-bd61bfa3-7786-433b-9ad8-a88591112a02.png">

</details>

---------

Co-authored-by: silverwind <me@silverwind.io>
18 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 12 Apr 2023 00:08:36 +0000 (00:08 +0000)]
[skip ci] Updated translations via Crowdin

18 months agoFix accidental overwriting of LDAP team memberships (#24050)
sillyguodong [Tue, 11 Apr 2023 23:54:26 +0000 (07:54 +0800)]
Fix accidental overwriting of LDAP team memberships (#24050)

In the `for` loop, the value of `membershipsToAdd[org]` and
`membershipsToRemove[org]` is a slice that should be appended instead of
overwritten.
Due to the current overwrite, the LDAP group sync only matches the last
group at the moment.

## Example reproduction
- an LDAP user is both a member of
`cn=admin_staff,ou=people,dc=planetexpress,dc=com` and
`cn=ship_crew,ou=people,dc=planetexpress,dc=com`.
- configuration of `Map LDAP groups to Organization teams ` in
`Authentication Sources`:
```json
{
    "cn=admin_staff,ou=people,dc=planetexpress,dc=com":{
        "test_organization":[
            "admin_staff",
            "test_add"
        ]
    },
    "cn=ship_crew,ou=people,dc=planetexpress,dc=com":{
        "test_organization":[
            "ship_crew"
        ]
}
```
- start `Synchronize external user data` task in the `Dashboard`.
- the user was only added for the team `test_organization.ship_crew`

18 months agoAdd cardtype to org/user level project on creation, edit and view (#24043)
Hester Gong [Tue, 11 Apr 2023 18:28:40 +0000 (02:28 +0800)]
Add cardtype to org/user level project on creation, edit and view (#24043)

Part of #23318

The way to fix the missing cardtype for user/org level projects in this
PR is to port the cardtype related part from #22112 to org/user level
projects' template and router functions.

Before:
<img width="1135" alt="截屏2023-04-11 13 55 49"
src="https://user-images.githubusercontent.com/17645053/231069068-ba897129-ae90-4aa0-9b0f-468bf5c65375.png">

<img width="1131" alt="截屏2023-04-11 13 55 59"
src="https://user-images.githubusercontent.com/17645053/231069084-279f6681-5a10-42da-b5a8-2b0ba47c7078.png">

After:
Create
<img width="835" alt="截屏2023-04-11 13 27 16"
src="https://user-images.githubusercontent.com/17645053/231064445-0d6e12bd-5725-48db-a102-80e7472757c2.png">

Edit
<img width="852" alt="截屏2023-04-11 13 27 05"
src="https://user-images.githubusercontent.com/17645053/231064503-c70525cd-1038-43ec-8d93-8b8d95d183d4.png">

View
<img width="1329" alt="截屏2023-04-11 13 26 56"
src="https://user-images.githubusercontent.com/17645053/231064529-26023c85-698b-4b2e-af02-45f9820c77ec.png">

Co-authored-by: Giteabot <teabot@gitea.io>
18 months agoFix branch protection priority (#24045)
Lunny Xiao [Tue, 11 Apr 2023 17:22:49 +0000 (01:22 +0800)]
Fix branch protection priority (#24045)

Fix #24044

18 months agoUpdate documentation to explain which projects allow Gitea to host static pages ...
6543 [Tue, 11 Apr 2023 16:36:58 +0000 (18:36 +0200)]
Update documentation to explain which projects allow Gitea to host static pages (#23993)

close  #23521

---------

Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
18 months agoFix date display bug (#24047)
wxiaoguang [Tue, 11 Apr 2023 09:48:13 +0000 (17:48 +0800)]
Fix date  display bug (#24047)

Follow
https://github.com/go-gitea/gitea/pull/23988#pullrequestreview-1377696819

Many template helper functions are not good enough and cause various
problems, that's why I am cleaning them.

## Before

![image](https://user-images.githubusercontent.com/51889757/230930898-0c48150f-de85-461d-9455-efcfdc36b644.png)

![image](https://user-images.githubusercontent.com/2114189/231111676-b0da1392-5e47-4f89-a81e-85156aca5cfd.png)

## After

![image](https://user-images.githubusercontent.com/2114189/231111732-920f304d-dd44-4c54-9f5f-518e325006fc.png)

18 months agoFine tune markdown editor toolbar (#24046)
wxiaoguang [Tue, 11 Apr 2023 08:36:18 +0000 (16:36 +0800)]
Fine tune markdown editor toolbar (#24046)

1. Remove unnecessary `btn-link` `muted` classes
* Link is link, button is button, I can't see a real requirement to make
a button like a link.
* If anyone insists, please help to show me real example from modern
frameworks / websites, how and why they do so.
    * No need to duplicate a lot of class names on similar elements
* Declare styles clearly, for example, `markdown-toolbar` itself should
have `display: flex`, but not use `gt-df` to overwrite the `display:
block`.
2. Remove unnecessary `role` attribute
    * https://github.com/github/markdown-toolbar-element/issues/70
* The `markdown-toolbar-element` does want to add `role=button`, but
there is a bug.
* So we do the similar thing as upstream does (add the role by JS),
until they fix their bugs.
3. Indent `markdown-switch-easymde` (before it doesn't have a proper
indent)

Screenshot:

![image](https://user-images.githubusercontent.com/2114189/231090912-f6ba01cb-d0eb-40ad-bf8c-ffc597d9a778.png)

18 months agoAdd tooltips for MD editor buttons and add `muted` class for buttons (#23896)
delvh [Tue, 11 Apr 2023 07:26:18 +0000 (09:26 +0200)]
Add tooltips for MD editor buttons and add `muted` class for buttons (#23896)

Followup of #23876 according to my unreleased review demanding tooltips.
Additionally
- add a `muted` equivalent for buttons
- convert `switch to legacy` to an actual button
- enroll `switch to legacy` in the builtin pseudo focus cycle
- remove spaces between the buttons

The effect of the `muted` class is what you would expect: The button
loses all of its normal styling, and is defined only by its content instead.
This will help reduce a11y infractions in the future, as that was one of
the major points why people didn't use `<button>` tags and decided on a
bad fix (i.e. through `<div>`s) instead.

## Appearance

![image](https://user-images.githubusercontent.com/51889757/229510842-337378e5-faa5-4886-a910-08614c0c233d.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
18 months agoPrefer native parser for SSH public key parsing (#23798)
Leon Busch-George [Tue, 11 Apr 2023 06:34:28 +0000 (08:34 +0200)]
Prefer native parser for SSH public key parsing (#23798)

Without this patch, the setting SSH.StartBuiltinServer decides whether
the native (Go) implementation is used rather than calling 'ssh-keygen'.
It's possible for 'using ssh-keygen' and 'using the built-in server' to
be independent.
In fact, the gitea rootless container doesn't ship ssh-keygen and can be
configured to use the host's SSH server - which will cause the public
key parsing mechanism to break.

This commit changes the decision to be based on SSH.KeygenPath instead.
Any existing configurations with a custom KeygenPath set will continue
to function. The new default value of '' selects the native version. The
downside of this approach is that anyone who has relying on plain
'ssh-keygen' to have special properties will now be using the native
version instead.
I assume the exec-variant is only there because /x/crypto/ssh didn't
support ssh-ed25519 until 2016. I don't see any other reason for using
it so it might be an acceptable risk.

Fixes #23363

EDIT: this message was garbled when I tried to get the commit
description back in.. Trying to reconstruct it:

## :warning: BREAKING :warning: Users who don't have SSH.KeygenPath
explicitly set and rely on the ssh-keygen binary need to set
SSH.KeygenPath to 'ssh-keygen' in order to be able to continue using it
for public key parsing.

There was something else but I can't remember at the moment.

EDIT2: It was about `make test` and `make lint`. Can't get them to run.
To reproduce the issue, I installed `golang` in `docker.io/node:16` and
got:
```
...
go: mvdan.cc/xurls/v2@v2.4.0: unknown revision mvdan.cc/xurls/v2.4.0
go: gotest.tools/v3@v3.4.0: unknown revision gotest.tools/v3.4.0
...
go: gotest.tools/v3@v3.0.3: unknown revision gotest.tools/v3.0.3
...
go: error loading module requirements
```

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
18 months agoAvoid recursing into sub-sub-sub-docs folders when looking for READMEs. (#23695)
Nick [Tue, 11 Apr 2023 03:00:19 +0000 (23:00 -0400)]
Avoid recursing into sub-sub-sub-docs folders when looking for READMEs. (#23695)

Fixes a bug introduced in https://github.com/go-gitea/gitea/pull/22177
which allows finding READMEs like
docs/docs/docs/.gitea/.github/docs/README.md

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

18 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 11 Apr 2023 00:08:10 +0000 (00:08 +0000)]
[skip ci] Updated translations via Crowdin

18 months agoUse auto-updating, natively hoverable, localized time elements (#23988)
Yarden Shoham [Mon, 10 Apr 2023 23:01:20 +0000 (02:01 +0300)]
Use auto-updating, natively hoverable, localized time elements (#23988)

- Added [GitHub's `relative-time` element](https://github.com/github/relative-time-element)
- Converted all formatted timestamps to use this element
- No more flashes of unstyled content around time elements
- These elements are localized using the `lang` property of the HTML file
- Relative (e.g. the activities in the dashboard) and duration (e.g.
server uptime in the admin page) time elements are auto-updated to keep
up with the current time without refreshing the page
- Code that is not needed anymore such as `formatting.js` and parts of `since.go` have been deleted

Replaces #21440
Follows #22861

## Screenshots

### Localized

![image](https://user-images.githubusercontent.com/20454870/230775041-f0af4fda-8f6b-46d3-b8e3-d340c791a50c.png)

![image](https://user-images.githubusercontent.com/20454870/230673393-931415a9-5729-4ac3-9a89-c0fb5fbeeeb7.png)

### Tooltips

#### Native for dates

![image](https://user-images.githubusercontent.com/20454870/230797525-1fa0a854-83e3-484c-9da5-9425ab6528a3.png)

#### Interactive for relative

![image](https://user-images.githubusercontent.com/115237/230796860-51e1d640-c820-4a34-ba2e-39087020626a.png)

### Auto-update

![rec](https://user-images.githubusercontent.com/20454870/230672159-37480d8f-435a-43e9-a2b0-44073351c805.gif)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
18 months agoReserve ".png" suffix for user/org names (#23992)
6543 [Mon, 10 Apr 2023 20:14:16 +0000 (22:14 +0200)]
Reserve ".png" suffix for user/org names (#23992)

Org/User names ending with ".png" where not functional, so reserve them

alternative / close  #23908

18 months agoAllow adding SSH keys even if SSH server is disabled (#24025)
Dmitry Sharshakov [Mon, 10 Apr 2023 17:22:51 +0000 (20:22 +0300)]
Allow adding SSH keys even if SSH server is disabled (#24025)

This is useful in case you want to use them for signature verification.

A notice is added to avoid confusion.

18 months agoAdd placeholder and aria attributes to release and wiki edit page (#24031)
silverwind [Mon, 10 Apr 2023 15:56:57 +0000 (17:56 +0200)]
Add placeholder and aria attributes to release and wiki edit page (#24031)

- Add placeholders and aria-label all input fields on these two pages
- Add margin before wiki change message
- Remove labels from release page, replacing them with aria-label

18 months agoAdd --quiet option to gitea dump (#22969)
Fredrik Eriksson [Mon, 10 Apr 2023 13:46:23 +0000 (15:46 +0200)]
Add --quiet option to gitea dump (#22969)

Fixes: #19687
The --quiet options to gitea dump silences informational and less
important messages, but will still log warnings and errors to console.
Very useful in combination with cron backups and '-f -'.

Since --verbose and --quiet are incompatible with each other I made it
an error to specify both. To get the error message to be printed to
stderr I had to make this test after the NewServices()-call, which is
why there are three new blocks of code instead of two.

18 months agoRemove "inverted" class on creating new label and cancel buttons (#24030)
Hester Gong [Mon, 10 Apr 2023 12:00:30 +0000 (20:00 +0800)]
Remove "inverted" class on creating new label and cancel buttons (#24030)

"inverted" class might not be needed because background of these two
buttons is light color.

inverted related rule from `semantic.css`:
```css
.ui.inverted.green.basic.buttons .button,
.ui.inverted.green.buttons .basic.button,
.ui.inverted.green.basic.button {
  background-color: transparent;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) inset;
  color: #FFFFFF;
}
```

Before:
<img width="771" alt="截屏2023-04-10 17 21 22"
src="https://user-images.githubusercontent.com/17645053/230873878-cc64b3d6-ffa9-4cae-9280-07b06f7829b2.png">

After:
<img width="765" alt="截屏2023-04-10 17 22 14"
src="https://user-images.githubusercontent.com/17645053/230873956-9412054f-b739-4878-9ee9-57ff65eb7910.png">

18 months agoUse actions job link as commit status URL instead of run link (#24023)
Jason Song [Mon, 10 Apr 2023 10:40:30 +0000 (18:40 +0800)]
Use actions job link as commit status URL instead of run link (#24023)

A commit status is bound to a job, not a run.

---------

Co-authored-by: silverwind <me@silverwind.io>
18 months agoMake label templates have consistent behavior and priority (#23749)
wxiaoguang [Mon, 10 Apr 2023 08:44:02 +0000 (16:44 +0800)]
Make label templates have consistent behavior and priority (#23749)

Fix https://github.com/go-gitea/gitea/issues/23715

Other related PRs:

* #23717
* #23716
* #23719

This PR is different from others, it tries to resolve the problem fundamentally (and brings more benefits)

Although it looks like some more lines are added, actually many new lines are for tests.

----

Before, the code was just "guessing" the file type and try to parse them.

<details>

![image](https://user-images.githubusercontent.com/2114189/228002245-57d58e27-1078-4da9-bf42-5bc0b264c6ce.png)

</details>

This PR:

* Always remember the original option file names, and always use correct parser for them.

* Another benefit is that we can sort the Label Templates now (before there was a map, its key order is undefined)

![image](https://user-images.githubusercontent.com/2114189/228002432-931b9f18-3908-484b-a36b-04760c9ad132.png)

18 months agoAdd actions support to package auth verification (#23729)
yp05327 [Mon, 10 Apr 2023 07:21:03 +0000 (16:21 +0900)]
Add actions support to package auth verification (#23729)

Partly fixes https://github.com/go-gitea/gitea/issues/23642

Error info:

![image](https://user-images.githubusercontent.com/18380374/227827027-4280a368-ec9e-49e0-bb93-6b496ada7cd9.png)
ActionsUser (userID -2) is used to login in to docker in action jobs.

Due to we have no permission policy settings of ActionsUser now,
ActionsUser can only access public registry by this quick fix.

18 months agoFix protected branch for API (#24013)
Lunny Xiao [Mon, 10 Apr 2023 02:52:16 +0000 (10:52 +0800)]
Fix protected branch for API (#24013)

Fix #23998

18 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 10 Apr 2023 00:07:14 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

18 months agoFix markdownlint (#24024)
silverwind [Sun, 9 Apr 2023 18:39:37 +0000 (20:39 +0200)]
Fix markdownlint (#24024)

Should fix the currently broken CI, and also validate via new
`complicance-docs` pipeline.

18 months agoIntroduce lint-md and compliance-docs pipeline (#24021)
silverwind [Sun, 9 Apr 2023 18:05:12 +0000 (20:05 +0200)]
Introduce lint-md and compliance-docs pipeline (#24021)

- Add new Make target `lint-md`
- Add new Drone pipeline `compliance-docs`
- Add `*.md` to docs exclusion/inclusion
- Consistently quote `path.include` and `path.exclude` statements in
YAML

18 months agoFix https setup doc zh-cn (#24015)
Lunny Xiao [Sun, 9 Apr 2023 17:53:08 +0000 (01:53 +0800)]
Fix https setup doc zh-cn (#24015)

18 months agoReplace tribute with text-expander-element for textarea (#23985)
silverwind [Sun, 9 Apr 2023 16:18:45 +0000 (18:18 +0200)]
Replace tribute with text-expander-element for textarea (#23985)

The completion popup now behaves now much more as expected than before
for the raw textarea:
- You can press <kbd>Tab</kbd> or <kbd>Enter</kbd> once the completion
popup is open to accept the selected item
- The menu does not close automatically when moving the cursor
- When you delete text, previously correct suggestions are shown again
- If you delete all text until the opening char (`@` or `:`) after
applying a suggestion, the popup reappears again
- Menu UI has been improved

<img width="278" alt="Screenshot 2023-04-07 at 19 43 42"
src="https://user-images.githubusercontent.com/115237/230653601-d6517b9f-0988-445e-aa57-5ebfaf5039f3.png">

18 months agoImprove GetBoards and getDefaultBoard (#22981)
yp05327 [Sun, 9 Apr 2023 14:07:23 +0000 (23:07 +0900)]
Improve GetBoards and getDefaultBoard (#22981)

Change
`GetBoards(ctx context.Context, projectID int64)`
to
`(p *Project) GetBoards(ctx context.Context) (BoardList, error)`

`getDefaultBoard` is same.

18 months agoExpand/Collapse all changed files (#23639)
sillyguodong [Sun, 9 Apr 2023 13:11:02 +0000 (21:11 +0800)]
Expand/Collapse all changed files (#23639)

close #23628

Now in `...` dropdown, you can expand or collapse all diff files that
have loaded.

https://user-images.githubusercontent.com/33891828/227749688-2d406916-3347-49f6-93a5-4092a00e8809.mov

Co-authored-by: silverwind <me@silverwind.io>
18 months agoShow errors for KaTeX and mermaid on the preview tab (#24009)
silverwind [Sun, 9 Apr 2023 12:07:43 +0000 (14:07 +0200)]
Show errors for KaTeX and mermaid on the preview tab (#24009)

There is a conflicting fomantic rule that hid the error messages inside
the markdown preview tab for things like mermaid or katex.
Overruled it to always show these errors.

<img width="774" alt="image"
src="https://user-images.githubusercontent.com/115237/230738528-322814c1-8994-495e-b901-bbb79b924ccb.png">

18 months agoShow protected branch rule names again (#23907)
Hester Gong [Sun, 9 Apr 2023 10:15:43 +0000 (18:15 +0800)]
Show protected branch rule names again (#23907)

`!important`s for one of the primary label selectors are removed by
#23774, so the repository branch protection settings ui will not have
the demanding css. This PR modifies `.ui.primary.label` to fix it.

Before:
<img width="1408" alt="飞书20230404-115410"
src="https://user-images.githubusercontent.com/17645053/229683221-ef9c7d5c-68a8-42b0-ba19-ef2d5dfce5f9.png">

After:
<img width="1419" alt="截屏2023-04-04 11 56 32"
src="https://user-images.githubusercontent.com/17645053/229683469-70cfc92d-d7ef-4323-a7f5-2247810fabce.png">

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoReference the `zh-CN` version of `reverse-proxies` in `https-support` (#24016)
Yarden Shoham [Sun, 9 Apr 2023 09:31:31 +0000 (12:31 +0300)]
Reference the `zh-CN` version of `reverse-proxies` in `https-support` (#24016)

18 months agoFix lint problem in `https-support.zh-cn.md` (#24014)
Yarden Shoham [Sun, 9 Apr 2023 09:06:31 +0000 (12:06 +0300)]
Fix lint problem in `https-support.zh-cn.md` (#24014)

https://github.com/DavidAnson/markdownlint/blob/v0.26.2/doc/Rules.md#md051

18 months agodocs: HTTPS configuration for zh-cn (#23039)
阿卡林刘 [Sun, 9 Apr 2023 08:30:26 +0000 (16:30 +0800)]
docs: HTTPS configuration for zh-cn (#23039)

added the Use HTTPS Configuration section Translation Chinese

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoRe-add initial wiki page text when editing the page (#23984)
wxiaoguang [Sun, 9 Apr 2023 07:51:32 +0000 (15:51 +0800)]
Re-add initial wiki page text when editing the page (#23984)

The `$content` was prepared above, but forgot to put it into the editor

Fix #23979

18 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 9 Apr 2023 00:07:20 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

18 months agofix: do not escape space between PyPI repository url and package name… (#23981)
Daniel Gunzinger [Sat, 8 Apr 2023 18:57:00 +0000 (20:57 +0200)]
fix: do not escape space between PyPI repository url and package name… (#23981)

…; add trailing slash to PyPI repository URL (in accordance to PEP-503)

This should solve Issue #23980, by moving the space in front of the
package name and the package name out of the `gitea-origin-url` block.
It also adds a trailing slash to the PyPI repository URL in accordance
to [Python PEP-503](https://peps.python.org/pep-0503/).

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoMake bindata static build parse builtin templates correctly (#24003)
wxiaoguang [Sat, 8 Apr 2023 13:56:50 +0000 (21:56 +0800)]
Make bindata static build parse builtin templates correctly (#24003)

Close #24002

Two problems before:

1. The `log.Fatal` is missing after these `wrapFatal` calls, so the
error is not shown to users.
2. `GetTemplateAssetNames` has different behaviors for local files and
builtin assets, for builtin assets, it also returns directories, so we
need to check the extension again.

I have tested with `TAGS="bindata sqlite sqlite_unlock_notify" make
build && ./gitea` , it works well now. Before, the server responds
internal server error (because it doesn't complete the template parsing)

18 months agoGroup template helper functions, remove `Printf`, improve template error messages...
wxiaoguang [Sat, 8 Apr 2023 13:15:22 +0000 (21:15 +0800)]
Group template helper functions, remove `Printf`, improve template error messages (#23982)

Follow #23328

Major changes:

* Group the function in `templates/help.go` by their purposes. It could
make future work easier.
* Remove the `Printf` helper function, there is already a builtin
`printf`.
* Remove `DiffStatsWidth`, replace with `Eval` in template
* Rename the `NewTextFuncMap` to `mailSubjectTextFuncMap`, it's for
subject text template only, no need to make it support HTML functions.

----

And fine tune template error messages, to make it more friendly to
developers and users.

![image](https://user-images.githubusercontent.com/2114189/230714245-4fd202d1-2b25-41b2-8be5-03c5fee45091.png)

![image](https://user-images.githubusercontent.com/2114189/230714277-66783577-2a03-49d5-8e8c-ceba5e07a2d4.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
18 months agoAdjust sticky pr header to cover background (#23956)
silverwind [Sat, 8 Apr 2023 12:43:15 +0000 (14:43 +0200)]
Adjust sticky pr header to cover background (#23956)

Very minor CSS tweak: Adjust sticky PR header to cover the box-shadow of
selected files.

Before:
<img width="1250" alt="Screenshot 2023-04-06 at 22 54 59"
src="https://user-images.githubusercontent.com/115237/230492218-4d71da48-a362-4c52-a7f7-01daf4ffa458.png">

After:
<img width="1255" alt="Screenshot 2023-04-06 at 22 54 46"
src="https://user-images.githubusercontent.com/115237/230492227-c7142210-e535-4da8-b610-37d33dcbb549.png">

18 months agoUpdate github.com/google/go-github to v51 (#23946)
harryzcy [Sat, 8 Apr 2023 11:27:30 +0000 (07:27 -0400)]
Update github.com/google/go-github to v51 (#23946)

`github.com/google/go-github` has new major version releases frequently.
It is required to update all import path, in additional to `go.mod`

18 months agoShow visibility status of email in own profile (#23900)
n0toose [Sat, 8 Apr 2023 10:05:21 +0000 (10:05 +0000)]
Show visibility status of email in own profile (#23900)

I've heard many reports of users getting scared when they see their own
email address for their own profile, as they believe that the email
field is also visible to other users. Currently, using Incognito mode
or going over the Settings is the only "reasonable" way to verify this
from the perspective of the user.

A locked padlock should be enough to indicate that the email is not
visible to anyone apart from the user and the admins. An unlocked
padlock is used if the email address is only shown to authenticated
users.

Some additional string-related changes in the Settings were introduced
as well to ensure consistency, and the comments in the relevant tests
were improved so as to allow for easier modifications in the future.

---

#### Screenshot (EDIT: Scroll down for more up-to-date screenshots)

***Please remove this section before merging.***

![image](https://user-images.githubusercontent.com/30193966/229572425-909894aa-a7d5-4bf3-92d3-23b1921dcc90.png)

This lock should only appear if the email address is explicitly hidden
using the `Hide Email Address` setting. The change was originally tested
on top of and designed for the Forgejo fork, but I don't expect any
problems to arise from this and I don't think that a
documentation-related change is strictly necessary.

---------

Co-authored-by: silverwind <me@silverwind.io>
18 months agoAdd eslint-plugin-custom-elements (#23991)
silverwind [Sat, 8 Apr 2023 09:24:42 +0000 (11:24 +0200)]
Add eslint-plugin-custom-elements (#23991)

Add
[eslint-plugin-custom-elements](https://github.com/github/eslint-plugin-custom-elements)
and enable all rules that I've found sensible.