summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove jQuery `.attr` from the common global functions (#30023)Yarden Shoham2024-03-231-7/+6
| | | | | | - Switched from jQuery `.attr` to plain javascript `getAttribute` - Tested the show/hide modal buttons, they work as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Migrate font-size helpers to tailwind (#30029)silverwind2024-03-238-16/+26
| | | | | | | | | | Migrate `gt-font-*` to `tw-text-*` All tailwind-original class names are also available and render like they would with 16px root font size. We currently have root font size at 14px, but I would like to eventually migrate us to 16px so that the tailwind docs apply to us unchangend and because 16px is the recommended root font size for web pages in general. Also the number 16 is much better dividable than 14 so will result in more integers.
* Replace all simple inline styles with tailwind (#30032)silverwind2024-03-239-10/+14
| | | | | | These should be all simple inline styles that were left in the templates. Co-authored-by: Giteabot <teabot@gitea.io>
* Migrate font-weight helpers to tailwind (#30027)silverwind2024-03-2312-17/+18
| | | | | | | | | | | Commands ran: ```sh perl -p -i -e 's#gt-font-light#tw-font-light#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-normal#tw-font-normal#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-medium#tw-font-medium#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-semibold#tw-font-semibold#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-bold#tw-font-bold#g' web_src/js/**/* templates/**/* ```
* Remove jQuery from the issue "go to" button (#30028)Yarden Shoham2024-03-231-17/+14
| | | | | | | | | | - Switched to plain JavaScript - Tested the "go to" button functionality and it works as before # Demo using JavaScript without jQuery ![demo](https://github.com/go-gitea/gitea/assets/20454870/76add18f-3294-4117-98b7-a97f576370e2) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Determine fuzziness of bleve indexer by keyword length (#29706)65432024-03-234-37/+29
| | | also bleve did match on fuzzy search and the other way around. this also fix that bug.
* Escape paths for find file correctly (#30026)wxiaoguang2024-03-231-2/+3
| | | Fix #30020
* Remove jQuery `.attr` from the diff page (#30021)Yarden Shoham2024-03-231-10/+13
| | | | | | | | | | | - Switched from jQuery `.attr` to plain javascript `getAttribute` and `setAttribute` - Tested the review box counter and Previous/Next code review conversation buttons. They work as before --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Remove jQuery `.attr` from the repository settings (#30018)Yarden Shoham2024-03-231-14/+16
| | | | | | | | | | - Switched from jQuery `.attr` to plain javascript `getAttribute` and `setAttribute` - Tested the collaborator access mode change, team search box, and branch protection form. They all work as before --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery `.attr` from the image diff again (#30022)Yarden Shoham2024-03-231-2/+4
| | | | | | | - Follows https://github.com/go-gitea/gitea/pull/29917 Missed these Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Introduce `.secondary-nav` and handle `.page-content` spacing universally ↵silverwind2024-03-2218-46/+40
| | | | | | | | | | | | | | | | | | (#29982) Fixes: https://github.com/go-gitea/gitea/issues/29981. Introduce `.secondary-nav` as a universal way for styling and margin adjustments inside `.page-content`. If the first child of `.page-content` is `.secondary-nav`, we add margin below it, otherwise we add padding to the first child. Notable changes: - `--color-header-wrapper` is replaced with `--color-secondary-nav-bg`. - `navbar` class is removed. --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove jQuery `.attr` from the branch/tag selector (#30010)Yarden Shoham2024-03-221-1/+1
| | | | | | | - Switched from jQuery `.attr` to plain javascript `.setAttribute` - Tested the cherry-pick from the branch/tag selector and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery `.attr` from the commit graph (#30006)Yarden Shoham2024-03-221-4/+4
| | | | | | | | Switched from jQuery `.attr` to plain javascript `.getAttribute` and `.setAttribute` --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery from the citation modal (except fomantic) (#30008)Yarden Shoham2024-03-231-19/+21
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the citation modal functionality and it works as before # Demo using JavaScript without jQuery ![demo](https://github.com/go-gitea/gitea/assets/20454870/65bba1eb-dd4c-477f-8a2d-08e65f1e9f42) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Remove jQuery `.attr` from the project page (#30004)Yarden Shoham2024-03-221-4/+4
| | | | | | | | | | | - Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the issue movement between columns, column background color setting, and column deletion. It all works as before --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix incorrect tailwind migration (#30007)silverwind2024-03-2277-165/+165
| | | | | | | | | | | Fixes https://github.com/go-gitea/gitea/issues/30005. Regression from https://github.com/go-gitea/gitea/pull/29945. There was only once instance of `tw-content-center` before that PR, so I just ran below command and reverted that one instance. ```sh perl -p -i -e 's#tw-content-center#tw-items-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/* ```
* 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.