summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix duplicate modals when clicking on "remove all" repository button (#24129)Hester Gong2023-04-192-8/+8
| | | | | | | | | | | | | 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
* Bump GitHub's `relative-time-element` to `v4.3.0` (#24187)Yarden Shoham2023-04-192-5/+5
| | | | | https://github.com/github/relative-time-element/releases/tag/v4.3.0 I checked and everything still works
* Fix wrong scopes of locale.PrettyNumber (#24181)Hester Gong2023-04-182-4/+4
|
* Fix incorrect internal response type (#24173)wxiaoguang2023-04-171-1/+2
| | | | | | Close #24167 The endpoint "set-default-branch" returns `success`, so just decode it as `responseText`
* zh-cn support on doc pages (#24166)Kroytz2023-04-182-2/+93
| | | | + Add zh-cn support for upgrade-from-gitea page + Fix typo error on https-support.zh-cn page
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-181-6/+23
|
* Use double quotes consistently in en-US (#24141)Panagiotis "Ivory" Vasilopoulos2023-04-178-86/+86
| | | | Also removes quotes in commit messages related to file modifications made in the Web UI.
* Use correct locale key for forks page (#24172)John Olheiser2023-04-171-1/+1
| | | | | 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
* Improve Wiki TOC (#24137)wxiaoguang2023-04-1712-117/+128
| | | | | | | | | | 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>
* Localize activity heatmap (except tooltip) (#24131)Yarden Shoham2023-04-177-12/+30
| | | | | | | | | | | | | | | 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>
* Support triggering workflows by wiki related events (#24119)Zettat1232023-04-174-2/+47
| | | | | | 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)
* add CLI command to register runner tokens (#23762)techknowlogick2023-04-176-0/+201
| | | | | | | | | | 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>
* Add new user types `reserved`, `bot`, and `remote` (#24026)techknowlogick2023-04-172-1/+23
| | | | | | | | | | | | | | | | | | | | 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>
* Fix Org edit page bugs: renaming detection, maxlength (#24161)wxiaoguang2023-04-174-25/+17
| | | | | | | | | | | | | | | | | | | | | ## 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)
* Make HAS_GO a simply expanded variable (#24169)silverwind2023-04-171-2/+2
| | | | Avoid recursive expansion on this variable and simplify the value. [Reference](https://www.gnu.org/software/make/manual/html_node/Setting.html).
* Support converting varchar to nvarchar for mssql database (#24105)Lunny Xiao2023-04-172-11/+43
|
* Fix math and mermaid rendering bugs (#24049)silverwind2023-04-178-43/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Refactor locale number (#24134)wxiaoguang2023-04-1719-106/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-1727-79/+0
|
* Use 1.18's aria role for dropdown menus (#24144)wxiaoguang2023-04-161-2/+2
| | | | | | | | | | | | 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.
* Set EasyMDE heading font-size to the same size as the resulting markdown ↵wxiaoguang2023-04-161-0/+25
| | | | | | | | | | | | | | | | | | | | (#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">
* Fix 2-dot direct compare to use the right base commit (#24133)Jonathan Tran2023-04-161-1/+5
| | | | | | 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.
* Add migration to fix external unit access mode of owner/admin team (#24117)yp053272023-04-152-0/+51
| | | | | | Fix the incorrect migration in #23675 and #24012 External Unit (Tracker and Wiki) access mode should be `read` in owner/admin team.
* Remove untranslatable `on_date` key (#24106)Yarden Shoham2023-04-155-15/+74
| | | | | | | | | | | | | | | | | | | | - 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>
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-153-15/+72
|
* Sort repo topic labels by name (#24123)wxiaoguang2023-04-143-9/+7
| | | | Close #24077
* Add option to search for users is active join a team (#24093)Tyrone Yeh2023-04-142-1/+2
| | | | | | | | 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>
* Make more functions use ctx instead of db.DefaultContext (#24068)wxiaoguang2023-04-1417-79/+79
| | | | | | Continue the "ctx refactoring" work. There are still a lot db.DefaultContext, incorrect context could cause database deadlock errors.
* Fix meilisearch not working when searching across multiple repositories (#24109)Brecht Van Lommel2023-04-141-2/+4
| | | | | | 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.
* Show friendly 500 error page to users and developers (#24110)wxiaoguang2023-04-1410-172/+305
| | | | | | | | | | | | | | | | | | | | | | 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)
* Fix incorrect server error content in RunnersList (#24118)yp053272023-04-141-2/+2
|
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-1420-20/+28
|
* Improve git log for debugging (#24095)wxiaoguang2023-04-133-59/+48
|
* Update redis library to support redis v7 (#24114)techknowlogick2023-04-139-18/+29
|
* Refactor cookie (#24107)wxiaoguang2023-04-1318-328/+141
| | | | | | | | | | | | 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.
* Fix admin team access mode value in team_unit table (#24012)yp053272023-04-136-45/+151
| | | | | Same as https://github.com/go-gitea/gitea/pull/23675 Feedback: https://github.com/go-gitea/gitea/pull/23879#issuecomment-1500923636
* Add monospace toggle button to textarea (#24034)silverwind2023-04-135-3/+29
| | | | | | | | | | | | | | | | | - 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>
* Correct the access log format (#24085)Gary Moon2023-04-136-6/+13
| | | | | | | | | | | 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>
* Changelog v1.19.1 (#24079) (#24092)65432023-04-131-1/+90
| | | Frontport #24079
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-1327-0/+72
|
* Bump vm2 from 3.9.15 to 3.9.16 (#24089)dependabot[bot]2023-04-121-3/+3
| | | | | Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.15 to 3.9.16. Signed-off-by: dependabot[bot] <support@github.com>
* Fix difficult translation for other languages (#24070)Lunny Xiao2023-04-122-2/+2
| | | | | | | Fix https://github.com/go-gitea/gitea/pull/24051#discussion_r1163697643 --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix mismatch between hook events and github event types (#24048)Zettat1232023-04-122-25/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Improve LFS error logs (#24072)wxiaoguang2023-04-121-2/+3
| | | | | The error logs were not clear. Help (but not fix) #24053
* Update the value of the `diffEnd` when click `Show More` btn in the ↵sillyguodong2023-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add tooltips to `Hide comment type` settings where necessary (#21306)delvh2023-04-122-2/+8
| | | | | Previously, this setting was pretty confusing for users, especially the difference between "reference" and "issue reference". Related: #21321.
* Use a general approach to access custom/static/builtin assets (#24022)wxiaoguang2023-04-1236-1054/+688
| | | | | | | | | | | | | | | | | | | 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>
* Make Release Download URLs predictable (#23891)JakobDev2023-04-125-15/+60
| | | | | | | | | | | | | | | | | | | | 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>
* Expand selected file when clicking file tree (#24041)sillyguodong2023-04-121-0/+10
| | | | | | | 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
* Localize milestone related time strings (#24051)Yarden Shoham2023-04-125-10/+5
| | | | | | | - With #23988 in place, we can improve these timestamps --------- Co-authored-by: silverwind <me@silverwind.io>