summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Support Copy Link for video attachments (#24833)Brecht Van Lommel2023-05-211-0/+3
| | | Creating a `<video>` tag with controls and title.
* Fix video width overflow in markdown, and other changes to match img (#24834)Brecht Van Lommel2023-05-212-8/+18
| | | | | This change makes the CSS for `<video>` in markup match that of `<img>`, and also allows additional attributes to be used. This way the width, padding, alignment should work equally well for both.
* Improve accessibility when (re-)viewing files (#24817)delvh2023-05-2117-92/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | Visually, nothing should have changed. Changes include - Convert most `<a [no href]>` to `<button>` when (re-)viewing files: - `<a [no href]>` are, by HTML definition, not a link and hence cannot be focused - `<a class="ui button">` can now be clicked (again?) using <kbd>Enter</kbd> - Previously, the installed keypress handler on `.ui.button` elements disabled it for links somehow - The `(un)escape file`, the `expand section` and the `expand/collapse file` buttons can now be focused (and subsequently clicked using only the keyboard) - You can now press <kbd>Space</kbd> on a focused `View file` checkbox to mark the file as viewed. - previously, this was impossible as this checkbox listened on the wrong event listener The `add code comment` button has been left inaccessible for now as it requires quite a bit of extra logic so that it is unhidden when it is focused (you can otherwise focus it without seeing it as you are not hovering on the corresponding line). --------- Co-authored-by: silverwind <me@silverwind.io>
* Refactor rename user and rename organization (#24052)Lunny Xiao2023-05-2112-188/+267
| | | | | | | | | | This PR is a refactor at the beginning. And now it did 4 things. - [x] Move renaming organizaiton and user logics into services layer and merged as one function - [x] Support rename a user capitalization only. For example, rename the user from `Lunny` to `lunny`. We just need to change one table `user` and others should not be touched. - [x] Before this PR, some renaming were missed like `agit` - [x] Fix bug the API reutrned from `http.StatusNoContent` to `http.StatusOK`
* Use `CommentList` instead of `[]*Comment` (#24828)Lunny Xiao2023-05-214-13/+13
| | | As title.
* Fix topics deleted via API not being deleted in org page (#24825)Yarden Shoham2023-05-211-20/+25
| | | | | | | | | | | | | | | The topics are saved in the `repo_topic` table. They are also saved directly in the `repository` table. Before this PR, only `AddTopic` and `SaveTopics` made sure the `topics` field in the `repository` table was synced with the `repo_topic` table. This PR makes sure `GenerateTopics` and `DeleteTopic` also sync the `topics` in the repository table. `RemoveTopicsFromRepo` doesn't need to sync the data as it is only used to delete a repository. Fixes #24820
* Return `404` in the API if the requested webhooks were not found (#24823)Yevhen Pavlov2023-05-211-2/+7
| | | | Should resolve first point of the issue https://github.com/go-gitea/gitea/issues/24574
* Decouple the different contexts from each other (#24786)wxiaoguang2023-05-2157-778/+882
| | | | | | | | | | | | | | | | | | | | Replace #16455 Close #21803 Mixing different Gitea contexts together causes some problems: 1. Unable to respond proper content when error occurs, eg: Web should respond HTML while API should respond JSON 2. Unclear dependency, eg: it's unclear when Context is used in APIContext, which fields should be initialized, which methods are necessary. To make things clear, this PR introduces a Base context, it only provides basic Req/Resp/Data features. This PR mainly moves code. There are still many legacy problems and TODOs in code, leave unrelated changes to future PRs.
* [skip ci] Updated translations via CrowdinGiteaBot2023-05-211-28/+318
|
* Add RTL rendering support to Markdown (#24816)silverwind2023-05-207-5/+23
| | | | | | | | | | | | | | | | | | | | Support RTL content in Markdown: ![image](https://github.com/go-gitea/gitea/assets/115237/dedb1b0c-2f05-40dc-931a-0d9dc81f7c97) Example document: https://try.gitea.io/silverwind/symlink-test/src/branch/master/bidi-text.md Same on GitHub: https://github.com/silverwind/symlink-test/blob/master/bidi-text.md `dir=auto` enables a browser heuristic that sets the text direction automatically. It is the only way to get automatic text direction. Ref: https://codeberg.org/Codeberg/Community/issues/1021 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2023-05-202-7/+408
|
* Update JS dependencies (#24815)silverwind2023-05-192-328/+309
| | | | | | | - Update all JS dependencies - Remove `@vue/compiler-sfc` as per [this notice](https://github.com/vuejs/core/tree/main/packages/compiler-sfc#vuecompiler-sfc), still builds as normal - Tested build and text/image copy
* Fix duplicate tooltip hiding (#24814)silverwind2023-05-191-1/+1
| | | | | A tippy instance's role is actually on `props.role`. This makes duplicate tooltip hiding work again after https://github.com/go-gitea/gitea/pull/24688.
* Mute repo names in dashboard repo list (#24811)Yarden Shoham2023-05-191-1/+1
| | | | | | | | | | | | # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/24b80212-4a4d-44a7-99d5-a8c6b207225e) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/565b242a-f65d-450c-b43b-c4539a0f8b28) Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Rework label colors (#24790)silverwind2023-05-192-21/+29
| | | | | | | | | | | | | | | | | | | Introduce `--color-label-fg`, `--color-label-bg` and `--color-label-hover-bg`, decoupling the label styles from other color variables. I've set the colors so that non-interactive labels like on tabs are dark-on-light on light theme, which imho looks better than previous light-on-dark. In the screenshot below, the leftmost label has hover, the second one has active. <img width="786" alt="Screenshot 2023-05-18 at 12 48 26" src="https://github.com/go-gitea/gitea/assets/115237/d989bb68-504a-4406-b5f6-419ed9609f90"> <img width="789" alt="Screenshot 2023-05-18 at 13 04 07" src="https://github.com/go-gitea/gitea/assets/115237/689a281a-a2b7-45e8-a5ee-dafb7a35e105"> --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix max width and margin of comment box on conversation page (#24809)HesterG2023-05-191-0/+3
| | | | | | | | | | | | | | | | | | | | | Fix regression from #23937 The changes should only be limited to `.conversation-holder .comment-code-cloud`, otherwise it will affect the `.comment-code-cloud` in conversation tab Before: <img width="962" alt="Screen Shot 2023-05-19 at 18 22 25" src="https://github.com/go-gitea/gitea/assets/17645053/0db01d04-2581-48f9-b46c-497836b1f12b"> After: <img width="997" alt="Screen Shot 2023-05-19 at 18 35 01" src="https://github.com/go-gitea/gitea/assets/17645053/5d14b67b-88c1-46c6-b859-fd41752b3ebb"> --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Allow all URL schemes in Markdown links by default (#24805)Yarden Shoham2023-05-196-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | - Closes #21146 - Closes #16721 ## :warning: BREAKING :warning: This changes the default behavior to now create links for any URL scheme when the user uses the markdown form for links (`[label](URL)`), this doesn't affect the rendering of inline links. To opt-out set the `markdown.CUSTOM_URL_SCHEMES` setting to a list of allowed schemes, all other schemes (except `http` and `https`) won't be allowed. # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/35fa18ce-7dda-4995-b5b3-3f360f38296d) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/0922216b-0b35-4b77-9919-21a5c21dd5d0) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Some refactors for issues stats (#24793)Lunny Xiao2023-05-1912-948/+948
| | | | | | | | This PR - [x] Move some functions from `issues.go` to `issue_stats.go` and `issue_label.go` - [x] Remove duplicated issue options `UserIssueStatsOption` to keep only one `IssuesOptions`
* Implement actions artifacts (#22738)FuXiaoHei2023-05-1924-6/+1127
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement action artifacts server api. This change is used for supporting https://github.com/actions/upload-artifact and https://github.com/actions/download-artifact in gitea actions. It can run sample workflow from doc https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts. The api design is inspired by https://github.com/nektos/act/blob/master/pkg/artifacts/server.go and includes some changes from gitea internal structs and methods. Actions artifacts contains two parts: - Gitea server api and storage (this pr implement basic design without some complex cases supports) - Runner communicate with gitea server api (in comming) Old pr https://github.com/go-gitea/gitea/pull/22345 is outdated after actions merged. I create new pr from main branch. ![897f7694-3e0f-4f7c-bb4b-9936624ead45](https://user-images.githubusercontent.com/2142787/219382371-eb3cf810-e4e0-456b-a8ff-aecc2b1a1032.jpeg) Add artifacts list in actions workflow page.
* Fix Actions being enabled accidentally (#24802)Jason Song2023-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | Regression of #24536. If the user doesn't explicitly disable Actions, it will be enabled. 1. Gitea will call `loadRepositoryFrom` before `loadActionsFrom`. https://github.com/go-gitea/gitea/blob/25d4f95df25dae5226e96e813dde87b071d9155e/modules/setting/setting.go#L234-L237 2. In `loadRepositoryFrom`, `rootCfg.Section("actions").Key("ENABLED").MustBool(true)` will set `actions.ENABLED` with `true`. https://github.com/go-gitea/gitea/blob/25d4f95df25dae5226e96e813dde87b071d9155e/modules/setting/repository.go#L313-L315 3. In `loadActionsFrom`, `rootCfg.Section("actions")` will get a section with Actions enabled. https://github.com/go-gitea/gitea/blob/25d4f95df25dae5226e96e813dde87b071d9155e/modules/setting/actions.go#L23-L26 Although the cause of the problem was using `true` by copy-paste mistake, it also surprised me that **`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` doesn't only read, but also write.**
* Change `add_on` in `keys_ssh.tmpl` (#24803)Zettat1232023-05-191-1/+1
| | | Follow #24562
* replace `drone exec` to `act_runner exec` in test README.md (#24791)a10121127962023-05-184-11/+44
|
* Fix OAuth loading state (#24788)silverwind2023-05-183-45/+45
| | | | | | | | | | | | | | Fix regression from https://github.com/go-gitea/gitea/pull/24740 where the loading state was not showing because the `oauth-login-image` class was removed. Replaced the Fomantic loader with a pure CSS loader and cleaned up the HTML. Diff: https://github.com/go-gitea/gitea/pull/24788/files?diff=unified&w=1 ![](https://github.com/go-gitea/gitea/assets/115237/b5b4137f-9821-464b-9777-858fe85d9e03) Co-authored-by: Giteabot <teabot@gitea.io>
* Remove duplicated issues options and some more refactors (#24787)Lunny Xiao2023-05-186-1648/+1662
| | | | | | | | | This PR - [x] Move some code from `issue.go` to `issue_search.go` and `issue_update.go` - [x] Use `IssuesOptions` instead of `IssueStatsOptions` becuase they are too similiar. - [x] Rename some functions
* Revert "Mark `models/fixtures` as generated (#24775)" (#24782)wxiaoguang2023-05-181-1/+0
| | | | | | | | They are not generated in some cases (although they can). And we should keep an eye on these files when reviewing. When reviewing, files can be marked as "Viewed" and then it is collapsed.
* Remove background on user dashboard filter bar (#24779)silverwind2023-05-183-2/+3
| | | | | | | | | | | | | Was only an issue on arc-green: ### Before <img width="313" alt="Screenshot 2023-05-17 at 23 33 15" src="https://github.com/go-gitea/gitea/assets/115237/0f6916c6-c6c3-43c8-84cc-24b0a9800a43"> ### After <img width="310" alt="Screenshot 2023-05-17 at 23 32 52" src="https://github.com/go-gitea/gitea/assets/115237/207d3d7f-ce6f-4170-b426-e743be760185"> Co-authored-by: Giteabot <teabot@gitea.io>
* Enable two vue eslint rules (#24780)silverwind2023-05-171-2/+0
| | | These two rules are no longer violated, so we can enable them again.
* Add two eslint plugins (#24776)silverwind2023-05-186-3/+127
| | | | | | | | Add these two plugins and autofix issues: - [eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native) - [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)
* Mark `models/fixtures` as generated (#24775)silverwind2023-05-171-0/+1
| | | | | Makes diffs like https://github.com/go-gitea/gitea/pull/24676/files more readable. I'm not sure if those are actually generated, but they are good to collapse in diffs anyways.
* Fix TestMinioStorageIterator skip message (#24765)silverwind2023-05-171-1/+1
| | | | Followup to https://github.com/go-gitea/gitea/pull/24762, fix this message.
* Fix missed table name on iterate lfs meta objects (#24768)Lunny Xiao2023-05-171-1/+1
|
* Revert "Fix missed table name on iterate lfs meta objects" (#24764)Yarden Shoham2023-05-171-1/+1
| | | | | This reverts commit 3364092013aa4d5d27ad02806b0f47967c04de18. It was accidentally pushed to `main` without a review.
* Make the color of zero-contribution-squares in the activity heatmap more ↵Evur2023-05-171-2/+2
| | | | | | | | | subtle (#24758) The previous color had a too high contrast with the background. --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix missed table name on iterate lfs meta objectsLunny Xiao2023-05-171-1/+1
|
* Skip TestMinioStorageIterator on CI (#24762)Lunny Xiao2023-05-171-0/+5
| | | | | | | Fix https://github.com/go-gitea/gitea/pull/24691#issuecomment-1550987681 --------- Co-authored-by: silverwind <me@silverwind.io>
* Support no label/assignee filter and batch clearing labels/assignees (#24707)Lunny Xiao2023-05-174-15/+40
| | | | | | | Since milestones has been implemented, this PR will fix #3407 --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Support for status check pattern (#24633)Zettat1232023-05-1710-78/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR is to allow users to specify status checks by patterns. Users can enter patterns in the "Status Check Pattern" `textarea` to match status checks and each line specifies a pattern. If "Status Check" is enabled, patterns cannot be empty and user must enter at least one pattern. Users will no longer be able to choose status checks from the table. But a __*`Matched`*__ mark will be added to the matched checks to help users enter patterns. Benefits: - Even if no status checks have been completed, users can specify necessary status checks in advance. - More flexible. Users can specify a series of status checks by one pattern. Before: ![image](https://github.com/go-gitea/gitea/assets/15528715/635738ad-580c-49cd-941d-c721e5b99be4) After: ![image](https://github.com/go-gitea/gitea/assets/15528715/16aa7b1b-abf1-4170-9bfa-ae6fc9803a82) --------- Co-authored-by: silverwind <me@silverwind.io>
* Updates to doc (#24757)Alejandro Leal2023-05-174-5/+5
| | | | | | | | | | | ## Misspelling fixes to: - docs/content/doc/administration/config-cheat-sheet.en-us.md - docs/content/doc/installation/from-source.en-us.md - docs/content/doc/usage/packages/cargo.en-us.md - docs/content/doc/usage/packages/storage.en-us.md --------- Co-authored-by: delvh <dev.lh@web.de>
* Ignore build for docs only (#24761)Lunny Xiao2023-05-171-0/+30
| | | Fix https://github.com/go-gitea/gitea/pull/24530#issuecomment-1550227919
* Fix team members API endpoint pagination (#24754)Yarden Shoham2023-05-171-2/+2
| | | | | | | | | | | | | | | | | | | Now it's 1-based instead of 0-based - Fixes #24747 ### Before ![image](https://github.com/go-gitea/gitea/assets/20454870/9b58ecfa-666c-4b78-bd0f-93233efeecbd) ### After ![image](https://github.com/go-gitea/gitea/assets/20454870/103b767a-e02e-4473-9f9f-5a676a61c174) ## :warning: BREAKING :warning: Previous API consumers may have relied on the 0-based pagination of this endpoint. The page numbering now starts at 1, as documented. Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Make mailer SMTP check have timed context (#24751)wxiaoguang2023-05-161-7/+9
| | | | | | | | | Make mailer SMTP check have timed context Otherwise Gitea may block for long time if the DNS request blocks. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Add @garymoon to MAINTAINERS (#24752)Gary Moon2023-05-161-0/+1
| | | | | | | | | | | | Hi all. I would like to apply to be a maintainer please. I have [four accepted PRs](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Agarymoon) (such as they are), sign my commits, and have MFA enabled everywhere. My hope is to continue with code contributions where I can (I'm not a developer, just a wannabe), take some work off kdumont's hands, and contribute on the infrastructure side where there is room 💚 :tea: Thank you!
* Skip TestRepoCommitsStatusParallel on CI (#24741)silverwind2023-05-161-0/+4
| | | | | Related: https://github.com/go-gitea/gitea/issues/22109 Co-authored-by: Giteabot <teabot@gitea.io>
* Respect original content when creating secrets (#24745)Jason Song2023-05-162-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #24721. Follow what GitHub does: - Don't trim spaces for secrets. - Newline should be `\n` instead of `\r\n`. Did some tests with: ```yaml name: secrets on: push jobs: show_secrets: runs-on: ubuntu-latest steps: - name: Dump secrets context run: echo '${{ toJSON(secrets) }}' | base64 ``` `AAAAAA`: ```text AAAAAA AAAAAA ``` `BBBBBB`: ```text BBBBBB BBBBBB ``` On GitHub: <img width="675" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/0ec60652-c2a3-47bb-9f9d-7e81665355a8"> On Gitea (before): <img width="673" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/cce818bf-5edc-4656-86e1-2c81c304cdb2"> On Gitea (after): <img width="673" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/0b3b15af-4d48-4bab-a334-4738a1b0eb4a">
* Remove meta charset from HTML5 documents (#24744)silverwind2023-05-164-4/+0
| | | | | | | When `<!DOCTYPE html>` is present, the default (and only valid) charset it `utf-8` so it does not need to be specified. Also we do serve with HTML with `Content-Type: text/html; charset=utf-8`, so it is duplicate info anyways.
* Fix WEBP image copying (#24743)silverwind2023-05-161-16/+11
| | | | | Fix regression from https://github.com/go-gitea/gitea/pull/23801, where I forgot that the new module will not throw, so the `catch` handlers were never triggered and in turn, the WEBP was not converted to PNG.
* Reorganize CSS files (#24739)silverwind2023-05-1616-28/+35
| | | | | Reorganize various CSS files for clarity, group together by subdirectory in `index.css`. This reorders some of the rules, but I don't think it should introduce any issues because of that.
* Don't run build and test if only docs changed (#24530)Lunny Xiao2023-05-1611-5/+101
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [skip ci] Updated translations via CrowdinGiteaBot2023-05-162-1/+141
|
* Rework Oauth login buttons, swap github logo to monocolor (#24740)silverwind2023-05-1511-100/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Diff without whitespace: https://github.com/go-gitea/gitea/pull/24740/files?diff=unified&w=1 - Use SVGs for GitHub and GitLab oauth providers - Replace section wrapping with a divider - Rework icon rendering, increase size from 32px to 40px Before: <img width="853" alt="Screenshot 2023-05-15 at 21 54 23" src="https://github.com/go-gitea/gitea/assets/115237/6ab5cfb4-46ff-469a-bd1f-06780d4a6a0b"> After (more providers): <img width="849" alt="Screenshot 2023-05-15 at 21 51 21" src="https://github.com/go-gitea/gitea/assets/115237/fa84f92f-98e0-4aed-9357-5d62ddd98195"> <img width="856" alt="Screenshot 2023-05-15 at 21 56 45" src="https://github.com/go-gitea/gitea/assets/115237/d3edd7ed-dadd-4302-aca7-08f20adc220e"> Ref: https://codeberg.org/Codeberg/Community/issues/1023 --------- Co-authored-by: Giteabot <teabot@gitea.io>