aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Enforce trailing comma in JS on multiline (#30002)silverwind2024-03-2248-117/+117
| | | | | | | | To keep blame info accurate and to avoid [changes like this](https://github.com/go-gitea/gitea/pull/29977/files#diff-c3422631a14edbe1e508c4b22f0c718db318be08a6e889427802f9b6165d88d6R359), it's good to always have a trailing comma, so let's enforce it in JS. This rule is completely automatically fixable with `make lint-js-fix` and that's what I did here.
* Replace 10 more gt- classes with tw- (#29945)silverwind2024-03-22123-322/+308
| | | | | | | | | | | | | | | | | | | | Likely the biggest change of the tailwind refactors. Only thing of note is that `tw-flex-1` resolves to `flex: 1 1 0%` while our `gt-f1` was `flex: 1 1 0`, I don't think it will make any difference. Commands I've ran: ```sh perl -p -i -e 's#gt-vm#tw-align-middle#g' web_src/js/**/* templates/**/* models/**/* perl -p -i -e 's#gt-fw#tw-flex-wrap#g' web_src/js/**/* templates/**/* models/**/* perl -p -i -e 's#gt-f1#tw-flex-1#g' web_src/js/**/* templates/**/* models/**/* perl -p -i -e 's#gt-fc#tw-flex-col#g' web_src/js/**/* templates/**/* models/**/* perl -p -i -e 's#gt-sb#tw-justify-between#g' web_src/js/**/* templates/**/* models/**/* perl -p -i -e 's#gt-je#tw-justify-end#g' web_src/js/**/* templates/**/* models/**/* perl -p -i -e 's#gt-jc#tw-justify-center#g' web_src/js/**/* templates/**/* models/**/* perl -p -i -e 's#gt-ac#tw-content-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/* perl -p -i -e 's#gt-df#tw-flex#g' web_src/js/**/* templates/**/* models/**/* tests/**/* perl -p -i -e 's#gt-dib#tw-inline-block#g' web_src/js/**/* templates/**/* models/**/* tests/**/* Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add border radius for wiki pages (#29937)Lunny Xiao2024-03-221-0/+1
| | | | | | | | | | | Before <img width="1312" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/26a6dec2-9fea-4c0c-b6fb-290eab12a55a"> After <img width="1298" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/01f7a714-eae9-4729-918f-3b4795094d0b">
* Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)Lunny Xiao2024-03-2215-81/+43
|
* Small refactors in anchors.js (#29947)silverwind2024-03-221-19/+21
| | | | | Some minor refactors, remove unnecessary `:is` selector and move the `:target` check out of the function. Might as well backport for the rare browser that does not support `:is`.
* Refactor markdown attention render (#29984)wxiaoguang2024-03-225-65/+145
| | | Follow #29833 and add tests
* Remove fomantic site module (#29980)silverwind2024-03-224-681/+79
| | | | | Had to fiddle a bit with the css ordering, but seems to work well now and should render exactly like before. Some of the CSS may be unnecessary, but I kept it for now.
* Fix: Abnormal strings appear when comments are saved after editing (#29991)HEREYUA2024-03-221-1/+1
| | | | | | | | | | | | | | | | | Partially resolved(The second problem): [#29986](https://github.com/go-gitea/gitea/issues/29986) **Before** HTML strings appear when comments are saved after editing ![image](https://github.com/go-gitea/gitea/assets/37935145/c356d99a-8473-4cc5-8e38-1b207ccd8b12) **After** https://github.com/go-gitea/gitea/assets/37935145/525601f9-3ee1-4266-9105-36d82b91b1c8
* Fix some pending problems (#29985)wxiaoguang2024-03-2212-47/+37
| | | | | | | | | | | | | | | | | These changes are quite independent and trivial, so I don't want to open too many PRs. * https://github.com/go-gitea/gitea/pull/29882#discussion_r1529607091 * the `f.Close` should be called properly * the error message could be more meaningful (https://github.com/go-gitea/gitea/pull/29882#pullrequestreview-1942557935) * https://github.com/go-gitea/gitea/pull/29859#pullrequestreview-1942324716 * the new translation strings don't take arguments * https://github.com/go-gitea/gitea/pull/28710#discussion_r1443778807 * stale for long time * #28140 * a form was forgotten to be changed to work with backend code
* Fix bugs in rerunning jobs (#29955)Zettat1232024-03-225-6/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #28761 Fix #27884 Fix #28093 ## Changes ### Rerun all jobs When rerun all jobs, status of the jobs with `needs` will be set to `blocked` instead of `waiting`. Therefore, these jobs will not run until the required jobs are completed. ### Rerun a single job When a single job is rerun, its dependents should also be rerun, just like GitHub does (https://github.com/go-gitea/gitea/issues/28761#issuecomment-2008620820). In this case, only the specified job will be set to `waiting`, its dependents will be set to `blocked` to wait the job. ### Show warning if every job has `needs` If every job in a workflow has `needs`, all jobs will be blocked and no job can be run. So I add a warning message. <img src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b" width="480px" />
* remove PATH and GOPATH modification in Makefile (#29978)silverwind2024-03-211-3/+0
| | | | We don't need these modifications anymore since all tool dependencies run via `go run`.
* Refactor external URL detection (#29973)wxiaoguang2024-03-227-62/+40
| | | | Follow #29960, `IsExternalURL` is not needed anymore. Add some tests for `RedirectToCurrentSite`
* Refactor repo header/list (#29969)wxiaoguang2024-03-219-65/+51
| | | | 1. Use general "mobile-only" and "not-mobile" CSS styles, remove some`@media (max-width: 767.98px)` tricks 2. Use `CountFmt` for repo list, just like the repo header (and it matches GitHub, to avoid big numbers bloat the page)
* Fix various loading states, remove `.loading` class (#29920)silverwind2024-03-219-34/+18
| | | | | | | | | | | | | | | | | | | | | | | Various code was using fomantic `loading` class which I think got broken a while ago and rendered only a full circle. Fix those to use `is-loading`. Before: <img width="295" alt="Screenshot 2024-03-19 at 22 56 26" src="https://github.com/go-gitea/gitea/assets/115237/dbe83395-5db4-4868-90bc-3613866a35f0"> After: <img width="60" alt="Screenshot 2024-03-19 at 22 54 35" src="https://github.com/go-gitea/gitea/assets/115237/8ac19b7e-035a-4c6d-850b-53a234ef69c2"> <img width="294" alt="Screenshot 2024-03-19 at 22 54 56" src="https://github.com/go-gitea/gitea/assets/115237/34e819d7-25f7-43a1-9d48-4a68dcd2b6ad"> <img width="320" alt="Screenshot 2024-03-19 at 22 55 16" src="https://github.com/go-gitea/gitea/assets/115237/05127544-47ff-4e18-9fd8-c84e44c374f8"> <img width="153" alt="Screenshot 2024-03-19 at 23 01 43" src="https://github.com/go-gitea/gitea/assets/115237/a33248c6-b11d-40ff-82d8-f5a3d85b55aa"> <img width="1300" alt="Screenshot 2024-03-19 at 23 56 25" src="https://github.com/go-gitea/gitea/assets/115237/562ca876-b5d5-4295-961e-9d2cdab31ab0"> <img width="136" alt="Screenshot 2024-03-20 at 00 00 38" src="https://github.com/go-gitea/gitea/assets/115237/44838ac4-67f3-4fec-a8e3-978cc5dbdb72">
* Update register application URL for GitLab (#29959)yp053272024-03-212-2/+2
| | | | | | Fix #26593 The old URL was updated 7 years ago. Maybe no need to hold it any more. ![image](https://github.com/go-gitea/gitea/assets/18380374/95a0b364-832b-4f10-800e-21845d64df1a)
* Refactor StringsToInt64s (#29967)wxiaoguang2024-03-2112-27/+30
| | | And close #27176
* Switch to happy-dom for testing (#29948)silverwind2024-03-214-1066/+323
| | | | | | | | | | | | | Use `happy-dom` again in vitest as it has caught up recently to `jsdom` in terms of features and it is a much more lightweight solution. I encountered [one bug](https://github.com/capricorn86/happy-dom/issues/1342), but it's an easy workaround until fixed. I regenerated the lockfile to get rid of the transitive dependencies so that's why the diff also has some upgrades in it. In total, this change removes 39 npm dependencies.
* Performance improvements for pull request list page (#29900)Lunny Xiao2024-03-2114-50/+86
| | | | | | | | | | | This PR will avoid load pullrequest.Issue twice in pull request list page. It will reduce x times database queries for those WIP pull requests. Partially fix #29585 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor URL detection (#29960)wxiaoguang2024-03-219-40/+93
| | | "Redirect" functions should only redirect if the target is for current Gitea site.
* Solving the issue of UI disruption when the review is deleted without ↵HEREYUA2024-03-211-1/+7
| | | | | | | | | | | | | | | | refreshing (#29951) **After deleting the review and refreshing, the display is normal. However, Without refreshing, the interface will be broken** https://github.com/go-gitea/gitea/assets/37935145/f5cb19a6-eb26-47b0-b8ee-15b575bbe1ac **after** https://github.com/go-gitea/gitea/assets/37935145/aa65922c-2ebf-4fce-ad91-35661f70329a
* Fix JS error and improve error message styles (#29963)silverwind2024-03-212-1/+3
| | | | | | | | | | | | | | | | Fixes: https://github.com/go-gitea/gitea/issues/29956. This error exposed a existing bug in the code, it was just never noticed because the jQuery expression evaluated without error before while the new one doesn't. Also improves error message styles: Before: <img width="1338" alt="Screenshot 2024-03-21 at 09 16 07" src="https://github.com/go-gitea/gitea/assets/115237/1cc1ef89-ad94-491e-bbca-75387f7547a0"> After: <img width="1335" alt="Screenshot 2024-03-21 at 09 15 44" src="https://github.com/go-gitea/gitea/assets/115237/312efc79-5353-4e2a-a703-1bccd3c01736">
* Fix the bug that user may logout if he switch pages too fast (#29962)Lunny Xiao2024-03-211-17/+9
| | | | | | | | | | | | This PR fixed a bug when the user switching pages too fast, he will logout automatically. The reason is that when the error is context cancelled, the previous code think user hasn't login then the session will be deleted. Now it will return the errors but not think it's not login. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Cancel previous runs of the same PR automatically (#29961)Jason Song2024-03-215-17/+18
| | | | | | | | | | | Follow #25716. Also cancel previous runs for `pull_request_sync`. It's not a bug since it original PR said "if the event is push". The main change is https://github.com/go-gitea/gitea/pull/29961/files#diff-08adda3f8ae0360937f46abb1f4418603bd3518522baa356be11c6c7ac4abcc3. And also rename `CancelRunningJobs` to `CancelPreviousJobs` to make it more clear.
* Exclude `routers/private/tests` from air (#29949)silverwind2024-03-211-1/+10
| | | | | | Exclude this and reformat the toml option to multiline. I wasn't able to get `exclude_regex` to work so it would include a `tests` directory anywhere. I think that option only works on files.
* Remove codecov badge (#29950)silverwind2024-03-212-2/+0
| | | It's been broken since the migration to actions, so lets remove it.
* Misc color tweaks (#29943)silverwind2024-03-202-15/+15
| | | | | | | | | | | | | Minor color tweaks: - Better text contrasts - Better distinguish nav and header wrapper in light theme - Input boxes are now white on light theme - Slightly darker dark theme background <img width="503" alt="Screenshot 2024-03-20 at 19 31 54" src="https://github.com/go-gitea/gitea/assets/115237/c7802a84-2386-4332-bd91-f419473ff644"> <img width="510" alt="Screenshot 2024-03-20 at 19 32 24" src="https://github.com/go-gitea/gitea/assets/115237/21d3529e-6e0a-413a-9e9e-a03bea2405eb">
* Fix and rewrite markup anchor processing (#29931)Lunny Xiao2024-03-211-33/+51
| | | | | | | Fix #29877 --------- Co-authored-by: silverwind <me@silverwind.io>
* Remove fomantic grid module (#29894)silverwind2024-03-205-2004/+502
| | | | Removed the grid module and moved the used parts it into our own CSS, eliminating around 75% unused CSS in turn.
* Add background to dashboard navbar, fix missing padding (#29940)silverwind2024-03-203-5/+7
| | | | | | | | | | | | | Two small CSS fixes: 1. Add background and reduced padding/avatar size to dashboard navbar. We use that background already in a number of "secondary navbars", so it fits. <img width="1344" alt="Screenshot 2024-03-20 at 18 18 21" src="https://github.com/go-gitea/gitea/assets/115237/ce5ebedc-e607-42c7-b7b4-b7a4c0ee68f2"> 2. Fix padding on top of user settings and subscriptions, regressed by https://github.com/go-gitea/gitea/pull/29922.
* Prevent layout shift in `<overflow-menu>` items (#29831)silverwind2024-03-203-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is a small layout shift in when active tab changes. Notice how the actions SVG is unstable: ![](https://github.com/go-gitea/gitea/assets/115237/a6928e89-5d47-4a91-8f36-1fa22fddbce7) This is because the active item with bold text is wider then the inactive one. I have applied [this trick](https://stackoverflow.com/a/32570813/808699) to prevent this layout shift. It's only active inside `<overflow-menu>` because I wanted to avoid changing HTML and doing it in regular JS would cause a flicker. I don't expect us to introduce other similar menus without `<overflow-menu>`, so that place is likely fine. ![after](https://github.com/go-gitea/gitea/assets/115237/d6089924-8de6-4ee0-8db4-15f16069a131) I also changed the weight from 500 to 600, slightly reduced horizontal padding, merged some tab-bar related CSS rules and a added a small margin below repo-header so it does not look so crammed against the buttons on top. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix loadOneBranch panic (#29938)wxiaoguang2024-03-202-5/+7
| | | | | | Try to fix #29936 Far from ideal, but still better than panic.
* Fix comment review avatar alignment (#29935)wxiaoguang2024-03-201-4/+3
| | | Fix #29934
* Remove the negative margin from `.page-content` (#29922)silverwind2024-03-205-13/+12
| | | | | | | | | | | | | | | | | | | | | | The negative margin was suboptimal and presents a few unnecessary challenges while styling the page. Remove it and add custom margin values, which slightly changes the height a few things near the top of the page as well: 15px less height of explore and login navbar: <img width="899" alt="Screenshot 2024-03-20 at 00 52 34" src="https://github.com/go-gitea/gitea/assets/115237/72a01ca4-5d17-4a0f-b915-61f95054fcb1"> 15px reduced padding-top height of "user bar" and equal 4px padding added: <img width="484" alt="Screenshot 2024-03-20 at 00 52 50" src="https://github.com/go-gitea/gitea/assets/115237/a8507e6d-372d-4a8b-9048-66fcf8a5facd"> 3px less padding on top of repo: <img width="552" alt="Screenshot 2024-03-20 at 00 53 49" src="https://github.com/go-gitea/gitea/assets/115237/dede6e44-7688-440f-a1b6-13532638ae03">
* Move notifications to a standalone file (#29930)Lunny Xiao2024-03-202-457/+472
| | | | There is no code change. Just move notification list related structs/functions from one file to another.
* Remove unnecessary ".Link" usages (#29929)wxiaoguang2024-03-206-15/+15
| | | Follow #29909
* Remove unnecessary ".Link" usages (#29909)wxiaoguang2024-03-2019-108/+108
| | | In HTML, `?key=val` already means "use the current link with new query parameters"
* Show Actions post step when it's running (#29926)Jason Song2024-03-202-2/+46
| | | | | | | | | | | | | | The post step was always waiting, even if all steps were done. Then, once the task was done, the post step became success immediately. Before: <img width="915" alt="xnip_240320_120228" src="https://github.com/go-gitea/gitea/assets/9418365/00347430-f998-4c43-917a-bf6dd6d0e333"> After: <img width="905" alt="xnip_240320_120443" src="https://github.com/go-gitea/gitea/assets/9418365/a419b111-17c2-4029-a022-c761cc419091">
* Fix the wrong default value of ENABLE_OPENID_SIGNIN on docs (#29925)Lunny Xiao2024-03-202-2/+2
| | | Fix #29923
* Restore deleted branches when syncing (#29898)Jason Song2024-03-203-5/+24
| | | | | | | | | | | Regression of #29493. If a branch has been deleted, repushing it won't restore it. Lunny may have noticed that, but I didn't delve into the comment then overlooked it: https://github.com/go-gitea/gitea/pull/29493#discussion_r1509046867 The additional comments added are to explain the issue I found during testing, which are unrelated to the fixes.
* Don't lock using GitHub actions (#29913)Yarden Shoham2024-03-201-23/+0
| | | | | | | | We have our bot for this. See: - https://github.com/GiteaBot/gitea-backporter?tab=readme-ov-file#locks - https://github.com/GiteaBot/gitea-backporter/blob/main/src/lock.ts Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Remove jQuery `.attr` from the user search box (#29919)Yarden Shoham2024-03-201-3/+6
| | | | | | - Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the user search box and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery `.attr` from the archive download and compare page branch ↵Yarden Shoham2024-03-201-4/+4
| | | | | | | | | selector (#29918) - Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the archive download and compare page branch selector functionality and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery `.attr` from the image diff (#29917)Yarden Shoham2024-03-191-1/+1
| | | | | | - Switched from jQuery `.attr` to plain javascript `.setAttribute` - Tested the image diff functionality and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery `.attr` from the quick pull request button text (#29916)Yarden Shoham2024-03-191-1/+1
| | | | | | | - Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the quick pull request button text change functionality and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery `.attr` from the issue author dropdown (#29915)Yarden Shoham2024-03-191-3/+3
| | | | | | - Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the issue author dropdown functionality and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Switch to the maintained vitest extension (#29914)Yarden Shoham2024-03-202-3/+3
| | | | | | | https://marketplace.visualstudio.com/items?itemName=zixuanchen.vitest-explorer was moved to https://marketplace.visualstudio.com/items?itemName=vitest.explorer Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Forbid jQuery `.css` and refactor all usage (#29852)silverwind2024-03-197-73/+78
| | | | | | | | | Tested all functionality. There is a [pre-existing bug](https://github.com/go-gitea/gitea/issues/29853) when moving a project panels which is not caused by this refactoring. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix border on focus in dashboard repo search (#29893)silverwind2024-03-191-1/+7
| | | | | | | | | | | Before: <img width="449" alt="Screenshot 2024-03-18 at 22 35 10" src="https://github.com/go-gitea/gitea/assets/115237/f2893870-e7a3-4e34-b0cf-4610735c9b36"> After: <img width="453" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/36a9f800-28a4-40fc-b6d2-a2e717ddba01">
* Fix invalid link of the commit status when ref is tag (#29752)yp053272024-03-192-3/+132
| | | | | | | | | | Fix #29731 Caused by #24634 Also remove fixme. ps: we can not fix the existed runs, as wrong refs are all recorded in DB, and we can not know whether they are branch or tag: ![image](https://github.com/go-gitea/gitea/assets/18380374/cb7cf266-f73f-419a-be1a-4689fdd1952a)
* Notify reviewers added via CODEOWNERS (#29842)Jimmy Praet2024-03-194-24/+75
|